- Joined
- Aug 30, 2017
- Messages
- 3
- Reaction score
- 3
- First Language
- English
- Primarily Uses
- RMMV
Switching Actors – An elegant way !
This is a short tutorial for an elegant way to switch from one primary actor to another in games with multiple playable characters.
Requirements: RPGMaker MV, basic mapping and eventing skills
Aim:
In this example, we have a game with three actors Adam, Bob and Cara (A,B & C). You start off as Adam. Whenever you meet Bob, you should be able to make Adam wait there and continue the game with playing character as Bob (Same for Cara).You should be able to change your character any number of times, even if you visit other maps in between changes.
Steps:
We start with a simple test map.
We need to Create two NPC Events called BODY1 and BODY2 to "hold" the two secondary actors. (Ignore sprites for time being)
Create the following Variables:
WhoAmI (the primary playing actor)
BODY1_Actor (actor inside BODY1 event)
BODY2_Actor (actor inside BODY2 event)
Event BODY1
Start with event BODY1. Open the event editor and create two new event pages
Enter the following details [IMPORTANT: FINE DETAILS]
All Event pages
Priority: Same as character Trigger: Player touch
Event page 1
Conditions: Variable: BODY1_Actor ≥ 1 Image: Actor 1 (Adam)
Code:
◆ Change Party Member:Add Adam
◆ Change Party Member:Remove Bob
◆ Change Party Member:Remove Cara
◆ Control Variables:#0003 Body1_Actor = WhoAmI
◆ Control Variables:#0001 WhoAmI = 1
Conditions: Variable: BODY1_Actor ≥ 2 Image: Actor 2 (Bob)
Code:
◆ Change Party Member:Remove Adam
◆ Change Party Member:Add Bob
◆ Change Party Member:Remove Cara
◆ Control Variables:#0003 Body1_Actor = WhoAmI
◆ Control Variables:#0001 WhoAmI = 2
Conditions: Variable: BODY1_Actor ≥ 3 Image: Actor 3 (Cara)
Code:
◆ Change Party Member:Remove Adam
◆ Change Party Member:Remove Bob
◆ Change Party Member:Add Cara
◆ Control Variables:#0003 Body1_Actor = WhoAmI
◆ Control Variables:#0001 WhoAmI = 3
Number of event pages depend on the total number of actors including player character. Each page decides what to do when the playing character wants to change into the actor that this event presently holds. The image on each event page shows what BODY1 must look like depending on the actor it is supposed to be.
The code consists of two parts (1) Change player character (2) Change NPC event BODY1
To change player character, we simply use the Change Party Member
To change the NPC to look like player character, we simply alter BODY1_Actor variable.
Finally change WhoAmI to keep track of who's the new player character
The code consists of two parts (1) Change player character (2) Change NPC event BODY1
To change player character, we simply use the Change Party Member
To change the NPC to look like player character, we simply alter BODY1_Actor variable.
Finally change WhoAmI to keep track of who's the new player character
Event BODY2
Copy-paste event BODY1 to adjacent square and name it BODY2 in the event editor
Edit each event page to change "BODY1_Actor" to "BODY2_Actor"
Total six changes need to be made in our example, three in conditions and three in code
Event BODY2 is now complete !
INITIALIZE VARIABLES AND START THE GAME
I prefer to set initial settings in a separate map. Create a small map called INITIALIZE (No one will see this map)
Set Starting Position --> Player anywhere in this map
Setup an event with trigger set to autorun (it will run once, you will never visit this map again)
Enter the following code:
Code:
◆Comment:----- INITIALIZE VARIABLES -----
: :WhoAmI is active player
: :Body1_Actor is initial appearance of Body 1
: :Body2_Actor is initial appearance of Body 2
◆Control Variables:#0001 WhoAmI = 1
◆Control Variables:#0003 Body1_Actor = 2
◆Control Variables:#0004 Body2_Actor = 3
◆Change Party Member:Remove Cara
◆Change Party Member:Remove Bob
◆Transfer Player:TEST (5,4)
ADD SOME DRAMA !
Add an animation before the player change. Make both of them turn away from each other afterwards.
Example code for Event Page 1 of BODY1:
You have to edit every event page of both BODY1 and BODY 2 as shown above
Example code for Event Page 1 of BODY1:
Code:
◆Show Animation:Player, Ball of Light (Wait)
Change Party Member:Add Adam
Change Party Member:Remove Bob
Change Party Member:Remove Cara
◆Set Movement Route:This Event (Wait)
: :◇Turn 180°
◆Set Movement Route:Player (Wait)
: :◇Turn 180°
Control Variables:#0003 Body1_Actor = WhoAmI
Control Variables:#0001 WhoAmI = 1
OFFER A CHOICE WHETHER TO CHANGE PLAYER
Place the entire code into a conditional statement to give the player a choice whether or not to change player character
You have to edit every event page of both BODY1 and BODY 2
You have to edit every event page of both BODY1 and BODY 2
EVENT PAGE SCREENSHOTS FOR BODY1
DIALOGUE OPTION
Place the entire code into a conditional statement to give the player a choice whether to Talk to NPC or Change player
Trigger a common event for dialogue
Use conditional statements in the common event to carry out dialogue based on value of [WhoAmI] and [BODY1_Actor] or [BODY2_Actor]
Also change Autonomous Movement to Random with low frequency to make NPCs move and give them more authenticity
You have to edit every event page of both BODY1 and BODY 2
Trigger a common event for dialogue
Use conditional statements in the common event to carry out dialogue based on value of [WhoAmI] and [BODY1_Actor] or [BODY2_Actor]
Also change Autonomous Movement to Random with low frequency to make NPCs move and give them more authenticity
You have to edit every event page of both BODY1 and BODY 2
Last edited:


