Instances and when to use them

Various development-related discussions
Post Reply
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Instances and when to use them

Post by whoosh »

Hey,

I've been working on the Temple of Ikov quest and there's a point that you attach a lever handle to a lever bracket to create a lever that can then be pulled. This lever stays pulled and it allows a gate to be opened.

Here's some YT vids with timestamps at the point that the lever handle gets attached.

https://youtu.be/uvGrn6SuQ-8?t=46
https://youtu.be/eQdXnLEDoAk?t=135 (good music as well, lucky us)
https://www.youtube.com/watch?v=OKYM2oFOUtk&t=119s

In all of these videos, it doesn't seem like the player gets teleported to another instance, all the NPC's stay on the same square etc but also, we don't seem to have any varbits attached to the objects in question.

I've looked into the suggested solution of using an instance and I've tested scenery replacement with something like: `SceneryBuilder.replace(leverBracket, leverBracket?.transform(87));`. I think this is part of what I want, but obviously I need to create a new area for the player because this replacement becomes visible for all. The problem with using the scenerybuilder to replace the object though is that when I attempt to pull the new lever, I get a message in the chatbox saying that I cannot reach it.

So my questions are:

We have a RegionManager and I can get the regionId of where the lever is. I believe with this I can create an instance and then use the SceneryBuilder to create the lever in this instance, is this correct?

Is there a reason why when I use the SceneryBuilder to replace an object the new object becomes unreachable?

Thanks
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Instances and when to use them

Post by Ceikry »

There's a lot of confusion in this post, keep in mind it's possible jagex just didn't instance this at all and there's simply a time period after which the lever reverts back to normal. Intern quests can be like that.
Nerds
User avatar
whoosh
Noob
Posts: 23
Joined: Fri Aug 12, 2022 7:38 am
Has thanked: 1 time
Been thanked: 2 times

Re: Instances and when to use them

Post by whoosh »

"There's a lot of confusion in this post"

Yeah you're right... I'll put in some rudimentary implementation for the lever and move on with the rest of the quest. As I implement more, hopefully my understanding improves + I was getting a bit demotivated by being stuck (not knowing which direction to go in ether).
Post Reply