Hi guys,
I am still not quite sure about the use of "Set Event Location". I tried to use it before, but when I talk to the NPC, it would teleport to another place on the map. I didn't need to use it so I just forgot about that. Now, I am wondering how I can place the same NPCs on the same map after an event is finished.
For example, the MC goes to school on the first day, and the NPCs are at the right corner of the class. If I want them to move to the left corner on the second day, do I have to make different events for them and put them there? Or do I use "Set Event Location" after a certain switch is on and then put save_pos on their move route?
What you could do is, just put it inside a event and branch it off with new event pages. Like you said, enable a switch for 'day 2' and use the event to set new locations for the npcs. This way, when the event in question has taken place and the new event triggers (day 2) the npcs will appear in their new locations once you enter the map again. Use fade-out and fade in screens in order to hide their movements from the player.
As for the position saving, I guess you are referring to Shaz's script (make sure to link to the script next time since there are people not familiar with it) yes you can use the save_pos script call in a move-route to always remember the new and current position for the npcs. As long as you want them to have their current position saved that is. You can also use the script call (and the event) inside transfer event leading to the map, that way you can also use it if the player will leave the map instead of just a fade out.
save_pos does require the script to be installed - it's not an RTP thing.
Normally you'd put a move route on your NPC events, and at the end of the move route (but still a part of the move route), you'd do a Script: save_pos call. That's basically telling it to move, and when it's finished, remember where it moved to for next time.
However, it sounds like you DON'T want to use a move route. And I'm also not sure if you're leaving the map and returning, or if you're just fading the map and want them to move while it's faded out. Set Event Location will only work for events on the current map.
So my suggestion would be to take one of two approaches, and you know both of them already:
1. use separate events, with switches to indicate when they're active (remember you do NOT need a blank first page if the second page has the sprite and a condition - you can have a condition on the first page with a sprite, and if the condition isn't met, that event just won't be there).
2. use the script, and do one of the following:
If you are going to a different map and then coming back, on the 'exit' event do a Script call to save the positions but pass in the coordinates - so something like this:
$game_map.events[10].save_pos(8,9,2)$game_map.events[12].save_pos(9,9,2)$game_map.events[18].save_pos(8,11,8)This means they won't move NOW, but next time you come back to that map, they'll be in the new positions facing the new directions.If you are not leaving the map, but just fading, repositioning everyone, then fading back in, after the fade, do Set Event Locations commands for each event. Then if you WANT them to be in the same place if the player leaves the map and comes back, do a save_pos on each one.
In either case, you can do the script call as I've shown above - using $game_map.events.... to do several in a single call, or you can do each one as an individual Set Move Route, with a save_pos in a Script command within the move route (which means you don't need to add the $game_map.events[id] bit).
This is so weird, I am not sure what else I am missing. I made a new page for the NPC events, conditioned it to a new switch, set it on autorun, then use the comand "Set Event Location". I made another new page and put it on another switch. But when I tested it, the NPC still remains in the same position as before.
I tried to use save_pos(), make a blank page with self-switch on after the first autorun page, but none of that worked. What exactly do I have to do? 🙁
show us your pages. I'm not sure why you're using autorun.
As already said, Set Event Location does NOT permanently move the event. Anything else we'd have to see your event to know what you're doing wrong. Show us ALL pages, and the WHOLE page, not just the list of commands.
Switch 16 isn't on the same map. I found it strange how it didn't freeze, so I also tried to make another page to turn it off. But it didn't change anything, so I deleted it.
Is this really that complicated? I wonder how the other people did it. 😉
You're making it complicated 🙂
Just use two events and ditch the script. First event has a sprite on the first page, and on the second page conditioned by the switch is no sprite.
Second event has a sprite on the first page, and it's conditioned by that switch.
You really don't use autorun events with Set Event Location JUST to move an event from one place to another - you either do it as a part of another list of events and save it by using the script, or you use two events that are set to be visible at different times.
You should read (Oh no cant remember who wrote that blog entry), about npcs not being events. It will help you out 🙂
It's called "Events Aren't NPCs: The Biggest Mistake in Cutscenes" or something like that, and it's on the blog under the Tips heading. Written by TouchFuzzy.
However, that's not what he's trying to achieve here. He's not doing a cutscene. He wants an NPC to appear in one place at one point in the game, but in a different place on the same map at another point in the game. Following that blog article won't solve this problem.