conor

Warper
Member
Joined
Oct 8, 2015
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Is it possible to control the movements of an event using the arrow keys? I want to have a part where the player has to use control an NPC to push a switch that would ordinarily be out of reach.

I've tried looking for a script that does this but I didn't have much luck.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,763
Reaction score
8,975
First Language
German
Primarily Uses
RMMV
You can make a parallel process checking the buttons, and depending on what is or is not pressed that parallel process can then set a move route for the event you want to move (set move route can be targeted by the dropdown list top left)
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,859
First Language
English
Primarily Uses
RMVXA
If the player isn't moving at the same time, and you're not using the Party Followers option, then you could just make the NPC the "player" and (if the main character would still be visible) temporarily make the player into an NPC.

Otherwise, Andar's solution is probably pretty good.  Alternately, if this is something you're doing a ton, you could hijack one of the Move Route commands (like "Move Away From Player") that you're not using in the Script Editor to have it behave the same way that the Game_Player object responds to movement.
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
Sounds like a part in an old PS1 game called Legend of Legaia where your party has to split up and you advance the dungeon by controlling each one separately and each one could only get sofar before you had to switch to the other party members

First you need and event (or a script depending on your needs) to initiate the switch.

If your player character might be in a different location each time you switch save the map location of your character in several variables

Fadeout the screen

jump the player to the "NPC" location and change the sprite of the character to the NPC sprite

Jump the NPC event to the location of the player (use the variables you saved before if you have them) and change the sprite to the player character sprite

Fadein the screen

Complete the action of the NPC then do the same steps to switch back (using a 2nd set of variables if you need to for the new NPC location)
 
Last edited by a moderator:

conor

Warper
Member
Joined
Oct 8, 2015
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Thanks for your replies, all. I had considered switching the NPC and the Player from the get go, but figured there may be a better way.

I did have this planned to be something that happens multiple times in the game so Wavelength's idea interests me. Is it literally a matter of copying the Game_Player script and pasting it in whichever move route i choose?

I tried messing around with parallel processes but I'm gonna need to read up on them before I fully get how they work.

For some more context, My idea was to have the character use a key item to control an NPC, by going up to them, speaking to them from behind a counter, and then taking control of them until the switch is pushed, at which point control would go back to the Player character.

Thanks again for your help guys
 

conor

Warper
Member
Joined
Oct 8, 2015
Messages
4
Reaction score
0
First Language
English
Primarily Uses
Last edited by a moderator:

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
events can't trigger other events by touch by default if you are trying to activate another event with the action button you'd be better off just switching the player and NPC around because event on event action button activation would require more scripting.

that or have your switch be a kind of pressure plate on the ground and have the event compare it's x and y to the controlled event's X and Y
 
Last edited by a moderator:

conor

Warper
Member
Joined
Oct 8, 2015
Messages
4
Reaction score
0
First Language
English
Primarily Uses
I ended up sorting it out by having a control switch activate when the x and y of the controllable NPC lines up below the button and deactivate when it leaves this place, and when its activated i just had it so that the space above the player acts as the switch.
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
38
First Language
English
Primarily Uses
nice, glad it worked out for you
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

5 months and no progression at all, i love me.
1.6 update incoming with quality breakthrough! :kaoluv:

1643254634071.png
I might try the mechanical bull at the fair on Friday... for one of the challenges, if you stay on for two minutes, you win $200. I might give that a try and see if I win--I'm pretty good at holding on to things.
Remaking a more streamlined version of my Remote Move map skill in MZ, just one switch and one variable to handle everything. If you seen the Move skill in Golden Sun before, moving far away items with your mind is pretty cool

MZtestRemoteMove.gif
I don't want to brag or anything but I was entertaining a woman the other night. I told her jokes while she bandaged my foot.

Forum statistics

Threads
118,734
Messages
1,118,335
Members
155,890
Latest member
Tempest_144
Top