Change NPCs' positions after an event.

Mr. Detective

NATO Special Operative
Veteran
Joined
Sep 9, 2012
Messages
664
Reaction score
232
First Language
English
Primarily Uses
N/A
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?
 

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
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.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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).
 

Mr. Detective

NATO Special Operative
Veteran
Joined
Sep 9, 2012
Messages
664
Reaction score
232
First Language
English
Primarily Uses
N/A
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? :(
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Mr. Detective

NATO Special Operative
Veteran
Joined
Sep 9, 2012
Messages
664
Reaction score
232
First Language
English
Primarily Uses
N/A
This is what I currently have.





 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So what DOES happen when you run it?

IS that switch (16) on at any point on this map?

If it IS, I expect you would find that the game would freeze - because you have an autorun event that's not turning itself off after doing something.

If the event that turns on switch 16 is on the same map, go to that event, and add the following commands (where ID is the id of the event you've just posted):

Code:
Set Event Location: (EVID) X, YScript: $game_map.events[id].save_pos
If it's on a different map, you'll need to put in the full script call, which I can't find at the moment because I can't see that script in my custom scripts project.
 

Mr. Detective

NATO Special Operative
Veteran
Joined
Sep 9, 2012
Messages
664
Reaction score
232
First Language
English
Primarily Uses
N/A
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. ;)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
You should read (Oh no cant remember who wrote that blog entry), about npcs not being events. It will help you out :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
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.
That's true, but he's still using the Npcs event pages to trigger events (setting events location and such). I just mean that he can do all that in a empty event, without having to use the npcs event page. But I see your point :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top