New account registration is temporarily disabled.

[RM2K3] HOW TO PREVENT AN NPC'S LOCATION FROM RESETTING

Posts

Pages: 1
i have an event where an npc climbs out of bed and runs across the room & the protagonist can then go over and talk to them. once they leave the room, an item spawns that is necessary to continue the plot. this event works perfectly if the protagonist stays in the room the whole time, but if she leaves and comes back, the npc is in the bed again with the dialogue for the second part of the event, and because the npc can't move out of the room like they could if the event was happening in the right place, they don't leave and the item doesn't spawn. how can i make sure the npc stays in the right place after the first part of the event even if the protagonist leaves the room?
Marrend
Guardian of the Description Thread
21806
Do you activate a switch after the NPC does the initial "wake up" event? If so, you could probably use that switch to set up an event where the NPC is supposed to be after it's move-route is done.

You can also use that same switch as a condition on a new event-page where the NPC started, so that the graphic would not show up. Nor would there be any dialog, or whatever.

*Edit: At least, I think this might be a viable solution? I'm having a bit of trouble parsing that post.
Marrend's idea is the correct solution. Have one event in the bed, and another event at the location the NPC should be at for the start of the second half of the cutscene. Use a switch to control progress. If the switch is false (the default) then the first event in the bed is shown and the 2nd event is hidden. After the first part of the cutscene plays and the bed event walks to the floor event, flip the switch. To the player nothing will change, but in reality the bed event will disappear and the floor sprite will appear. Then continue the cutscene normally with with 2nd event. Since this is working with switches now, the new location of the event will be preserved even if you exit the room and return.
thank you both! unfortunately i couldn't figure out how to get that to work. i put in a switch as well as a new event, but it proceeds the same way as it did earlier, before i added the switch. and if i add a page to the bed event to make the graphic disappear, the event begins with both sprites visible. i took some screenshots of what the events look like right now in case that helps show what i might be doing wrong:

(bed event)



(new location event)
It's hard to tell what your exact issue is from these images because you cut out the part that shows us what you set as the sprite on these event pages.

But one thing I'll mention is that when you have multiple pages on an event, the one furthest to the RIGHT which has it's preconditions met will be the only one that is active.

So page 1 of the event should be the visible bed with any of its code. No precondition.

You can have as many pages in the middle as you want, but the order you have the preconditions matters.

The last page of the event should be blank. No sprite, no code, not parallel or autorun. The page precondition can be anything, it doesn't always have to be a switch and sometimes it shouldn't be a switch.

This is when you want an event to visible at first, but later be gone. If you want something to be invisible at first, until you trigger something elsewhere, then the first page should be blank with NO preconditions. And the last page have a precondition, with sprite and/or code.




When I do cutscenes I always use a variable to track it's progress. You would add 1 to that variable, and then use event pages with the precondition of that variable.

Page 1 - precondtion Var1 "Cutscene1" = 0

Do some code, talking, moving, and then at a certain point you add 1 to the cutscene variable. That would be the last piece of code on that page.

Add a new page


Page 2 - precondtion Var1 "Cutscene1" = 1

Doing this means that you can have other events change at this point in the cutscene. This event will continue on with talking and moving, the main script if you will. Other events will have preconditions on their event pages for this variable being equal to 1, which means they change as you change the variable.

So instead of using many many switches to achieve this, you only need one variable. Adding 1 to it is the same as turning on a new switch for such a temporary thing.

If this doesn't solve it, post bigger screens of your event pages.
What Link said about pages is very important: event pages are always read right-to-left, with the highest page taking precedence.

Also, name your switches more distinctly. You'll thank yourself in the future. When you've got hundreds of switches to keep track of, you'll be glad you gave them descriptions.
Out of the house enable a switch.

Inside the house,
if the event is on
Put a event like:
Parallel process start

Change the position of a event,
X, Y, Direction (Position that you want)
Erase event

--------
There is many ways, like saving variables
of the npc position, and change position related to the values saved, etc
Pages: 1