Ok to paint a picture the pc is at an Inn. I want them to go upstairs to the inn sleep and then when they go back downstairs the scene/area should be different.
My question is it possible for the door to both be able to go back downstairs to the original area, and then have the destination change after the pc goes to sleep? I know I can make a copy a of the upstairs and place the pc there after they click on the bed and go to sleep but and have the door in that version take them to the changed area. But I was just wondering if there was another way.
SetTransitionTarget()
That article suggests that it’s mostly used with CopyArea() etc, but it works just as well for pre-made areas.
Thank you. So I just put that into say a actions taken in the conversation?
Use it at the point where the PC sleeps. If that’s a conversation option with a bed or whatever, you’re right, it goes in the Action Taken script. The PC won’t be aware anything has changed until they use the door again.
If the new area has tile changes, do it this way.
Otherwise, there’s a trade-off.
Making a new area saves the chore of scripting lots of changes to objects in the old area, but needs some scripting for continuity, e.g. duplicating items the PC dropped in the old area, looted chests etc
Alright I get you. My question is (this is going to be very basic I know sorry I am very bad at coding). When putting in the door and the new transition area, do I go by tag or ResRef?
So this is what I got so far
void main()
{
SetTransitionTarget(object oTransition “test”,object oTarget “Inndoor2”);
}
And it’s telling me there is an error when compiling it, any help would be grateful. I know this is probably a basic issue, it’s just that I am coming back to this after like a year and I really need to refresh myself.
Edit: Never Mind I figured it out. The answer was obvious. Kind of glad no one helped something needed to learn on my own.
Edit 2: Never mind it’s compiling now it still isn’t changing the door transition.
The tag identifies object instances, so that’s the way to go here.
The resref identifies object templates, so it’s only used in scripting to create new object instances from a template or suchlike.
The code should look something like this (assuming your strings are door tags):
void main()
{
object oDoor = GetObjectByTag("test");
object oTargetDoor = GetObjectByTag("Inndoor2");
SetTransitionTarget(oDoor, oTargetDoor);
}
Thanks but just doesn’t want to work for me I’ve tried everything including your code here.
I appreciate the help but I think I’ll just go with the spawn the player in a clone of the upstairs area.
That or have the door locked until they sleep, might warn them before they go up originally that once they do so, they won’t be able to go down again.
This might not work, if you allow them to not sleep and go back downstairs, but you could just have the original inn area send them one way to their room area, and have the door back to the “inn” go to your different Inn area.
Inn door → sleeping area door back out → different Inn
1 Like
Appreciate that you’re going another way now, but, just for info, my script works for me in a vanilla module. Most likely you have a typo in one of the door tags, which are case-sensitive.
Alright let me try one more time.