[SOLVED] Change actor control/NPC possesion?

Status
Not open for further replies.

Acidicjester

Cool Guy
Veteran
Joined
Apr 16, 2015
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hi forums I hope you're all doing well. I've come to a segment in my game where I need the player to take control of a robot. How would I go about this? I'm sure this is something super simple that I'm overlooking but I still have a lot to learn from the engine and was hoping someone had a simple solution. The robot would be stationed somewhere out of the players reach and has to use a terminal to control them. I have a camera plugin that can move to that event but controlling is where I'm stumped. Thanks guys :)
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
What I did to address a similar requirement was to change the actor sprite and graphic with 'Change Actor' like so:

change_actor.png

In my case the original actor sprite needed to remain onscreen while the player controlled the 'new' toon, which I address by using an event that flipped on during the changeover and used the original actor sprite.
 

Acidicjester

Cool Guy
Veteran
Joined
Apr 16, 2015
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hm I'm not too sure I follow. Could you elaborate on the Switch you're using? Maybe screencaps? Though I understand if you want to keep your project under a little secrecy.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
Sure thing.

So a quick overview: This 'Wrix_1' event is an elf that the player speaks with, and eventually controls for a mission.

In this first shot, you can see that the event Image is that of an elf girl. Once it's time for the player to become her for the mission, I do a fadeout to cover up all the visual hijinx, the flip Self Switch B on, then do all of the Change Actor Image and other housekeeping items:

1.png

Self Switch B is what changes this event into the player graphics, and handles the flip back over once the mission is complete:

2.png

Once it all runs, the player become the elf, and the event becomes the player (visually).

You can also use the Transfer Player and Set Event Location capabilities to move the player (now a robot from the sounds of it) and event where they need to be, as from the sounds of it the player is going to move a ways on your map, and since the event will become the player temporarily, it will need to move too.

I have no idea if this is the easiest/best way to do this, but it works perfectly.
 

Acidicjester

Cool Guy
Veteran
Joined
Apr 16, 2015
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMMV
I think I understand this a bit more now I'm going to do a test run
 

Acidicjester

Cool Guy
Veteran
Joined
Apr 16, 2015
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMMV
Okay so after about an hour I think I got this figured out and got to a point where I'm satisfied with it.

For anyone who is wondering about the process I'm going to try to break this down the best I can. Much like @akoniti said, you can use transfer player and set event locations.

The robot in question is 'Rolly' so I have an event that pans to Rolly thanks to SRD's Camera Core and activates a switch 'Control-Rolly'
robo-control_3.png

Before I forget I should mention that I created some variables.
---
EX
EY
mapid
EX-player
EY-player
---
These variables are important because Rolly needs to stay where I left him. Make sure to have a parallel process event that tracks this. Like shown below:
robo-control_4.PNG
For the first line you want the mapid variable to Operand to Game Data>Map ID
For the two below have EX go to Game Data>Character(Rolly in this case)>Map X
Do the same for EY but to 'Map Y' instead.
EX-player and EY-player works the same way but instead of rolly it's the player.

Now that that's out of the way let's move to the event itself.

In the Rolly event he has 5 event pages total. Page 1 is blank as an idle state. There are some things in here you can totally ignore depending on your game. For example I have Terrax Lighting and use a plugin command to remove the player lighting when controlling Rolly. Basically what's happening here is as soon as the camera pan from the last event moves and the switch is turned on, the player is set to Transparent and the walking sprite is switched to Rolly's active sprite. I've also removed followers so they don't teleport behind the player is Rolly's form. For the Transfer Player command comes the variables we made earlier. Instead of a destination it's set to designation with variables. These being the ones we set up earlier('mapid' for ID, 'EX' for X coordinate, and 'EY' for y coordinate). What this basically does is transfer the player right on top of Rolly. This won't look weird because we're transparent. Once that is done you can turn the transparency off and move on to a Self Switch.
robo-control_7.png

When controlling Rolly, you want to be able to leave control of him by some means right? For me I simply made it the [Cancel] button. The page for Self Switch A would be parallel process waiting for the [Cancel] input which would in turn set off another Self Switch . Now this is where it gets a little hard to look at but it's really not that all hard. Most of it is Movement Routes. To start,make it an autorun process. I have the player switch the image to Rolly's deactivated state followed by a "Turn Down" motion. The "Rolly" event would follow up by turning down as well and will then no longer be transparent. Much like we moved the player to Rolly, we're going to do the same but reverse. Instead of the transfer player command we're going to use the 'Set Event Location' and set the X and Y coordinates to 'EX-player' and 'EY-player'. The 'mapid' variable won't be necessary. From this point you will want to make the player Transparent so the transition doesn't look weird and out of place. Transfer the player back to the terminal where Rolly was activated and switch back to the original graphic of the actor. Might want to turn him as well. From this point you can turn off the transparency and turn off our 'Control-Rolly' switch. Hit that self switch and we can get on to the last part.
robo-control_8.PNG
robo-control_9.PNG

The last thing I did was make sure all those self switches get reset when we're done AND place a dummy player in place of where I am controlling Rolly.

The Dummy is simple. I placed it anywhere in the map and had it under the 'Control-Rolly' switch. Simply used the 'Set Event Location' to go in place where my actor would be at the terminal and made that parallel so he's always there. When the switch is off, he disappears.
robo-control_10.PNG

and at last the final step is to make ONE more parallel event that turns off the Self Switches on Rolly's event when the Control-Rolly switch is off. I use a simple script call as shown below.
First number is Map ID, second number is Event ID, and last is the letter corresponding to the event. In this case my map ID and event ID share a number and I'm turning off all self switches.
robo-control_11.PNG

And there you have it! Here it is in action:


Thank you @akoniti for getting my brain moving and I hope this can help anyone looking to solve the same issue :)

-Mods may close-
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
Nicely done (and well documented), you're welcome!

The ability to proactively switch between them wasn't necessary in my usecase, but I like how you solved it, and that the switch is so seamless; that may well come in handy someday.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,787
Reaction score
5,209
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,555
Messages
1,014,635
Members
137,233
Latest member
hokiterus787
Top