How to add actor based on Varaibale?

Bruh99

Villager
Member
Joined
Jul 27, 2020
Messages
10
Reaction score
3
First Language
English
Primarily Uses
N/A
I think I will need script buy I'm not sure.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,934
Reaction score
1,382
First Language
EN
Primarily Uses
RMMZ
You could use Conditional Branch commands, e.g.
Code:
◆Comment:Set variable value (for testing)
◆Control Variables:#0001 Actor ID = 1
◆Comment:Check variable value and add appropriate actor
◆If:Actor ID = 1
  ◆Change Party Member:Add Harold
  ◆
:Else
  ◆If:Actor ID = 2
    ◆Change Party Member:Add Therese
    ◆
  :Else
    ◆If:Actor ID = 3
      ◆Change Party Member:Add Marsha
      ◆
    :Else
      ◆Comment:etc
      ◆
    :End
    ◆
  :End
  ◆
:End

Or a single Script command:
JavaScript:
// Get actor ID = value of game variable 1
var id = $gameVariables.value(1);
// Add that actor to the party!
$gameParty.addActor(id);
Change the 1 to match the ID of your game variable.
 

Bruh99

Villager
Member
Joined
Jul 27, 2020
Messages
10
Reaction score
3
First Language
English
Primarily Uses
N/A
Thank you so much!It works perfectly!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Success, my character has harnessed the power of the particle, and now she leaves a speed streak.:kaopride:



I'm breaking up with QSprite. :kaolivid:
Ami
--- Spoiled Food ---

M.Knight: Oh,no! the Bread has been Mold!
Chef: It's not Mold,it's in Fermentation.
M.Knight: Are you sure?
Chef: Y'know Cheese? It's safe to eat
(Chef eat the Moldy Bread,after that he take into the Hospital with Green Face)
Suddenly I remember the days when I create something just by pure wild imagination. I wasn't thinking about concept, structure, or anything else. Just create (even if it's unfinished in the end). Somehow I kinda want to have that wild imagination again. :D
Google "The Great Stink"
Enjoy.

Forum statistics

Threads
104,334
Messages
1,005,624
Members
135,849
Latest member
Eryops
Top