Help - Search - Members - Calendar
Full Version: NPC Movement Help
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
jay10990
heya, did a bit of searching but couldnt find this exact problem. I want to talk to one npc, and after i do, i want it to have triggered another npc to move. The npc i want to move is on another map, blocking a path. Any suggestions ? Thanks im still very new to rmxp.
maximusmaxy
This is a pretty simple problem which can be solved with a switch. Basically after you talk to the npc, have it turn on a switch(which can be found on the top right of the first page of event commands), which you can name accordingly (talked to npc). Then on the map which you want the npc to move, add a new blank event page to the npc (which can be found at the top) and set its switch condition to 'talked to npc' or whatever you named it. This will erase that npc when the switch is activated, but you want him to have moved somewhere else right? Create a new event with the same npc graphic, and its switch condition to 'talked to npc'. This will have him appear as if he has moved when the switch is activated, when really you have just erased him and created him in a new location.

Hope that helped
jay10990
that was well explained, thank you very much for your time. Im going to give it a try when i get home from work.
Tsukihime
QUOTE (maximusmaxy @ Sep 5 2011, 11:12 PM) *
This is a pretty simple problem which can be solved with a switch. Basically after you talk to the npc, have it turn on a switch(which can be found on the top right of the first page of event commands), which you can name accordingly (talked to npc). Then on the map which you want the npc to move, add a new blank event page to the npc (which can be found at the top) and set its switch condition to 'talked to npc' or whatever you named it. This will erase that npc when the switch is activated, but you want him to have moved somewhere else right? Create a new event with the same npc graphic, and its switch condition to 'talked to npc'. This will have him appear as if he has moved when the switch is activated, when really you have just erased him and created him in a new location.

Hope that helped


Now the challenge is, is it possible to do it without an extra switch!

I generally don't like to explicitly define switches or variables for the sake of checking whether a condition has been met. It makes my events dependent on that switch and makes it so I can't easily re-use it somewhere else.

Especially for something like moving an event from one location to another and then keeping it there.
maximusmaxy
Well yeah there are many ways to do it, you could use a variable instead of the switch (just set the variable to 1 and the variable condition to 1 or above). Or you could use a parallel process and self switches. But why not just use the switch? You get 5000 switches (more with scripts) to play around with, and it really is the simplest way.
Tsukihime
I would give up performance for the sake of being able to duplicate the same event in multiple maps without having to create multiple switches for it, which for me usually becomes a clutter cause my designing process isn't the most rigorous.

Though that's just me and my preference for clean-looking work despite being lazy.
ipsissimus10
do you have them on a parralell process or have an ev. variable switch on one of the pages switch on ..... did you need to turn off any switches, after an event page is active
ForeverZer0
Script call that uses no switches:

CODE
data = [MAP_ID, EVENT_ID, 'A']
$game_self_switches[data] = true/false


Replace MAP_ID with ID of the map that the event is on.
Replace EVENT_ID with the event's ID
You can then select which self-switch you want to change. The example will change A. Just make sure its in quotes and capitalized.

Now you can just have a separate page for the event whose condition uses its own self-switch.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.