Make Conditional Branch use variable as Actor ID?

Basically, when I call a conditional branch in a common event to check an actor's state, is there a way to designate the actor ID of the actor who will have their state checked as a variable?
Capture.PNG

Like instead of:
"Conditional Branch: If [Noah] is [Poison] Inflicted then;"

Make it so:
"Conditional Branch: If [Actor ID: Variable #3] is [Poison] Inflicted then;"

Is this possible through a script call or something? Thank you.
Ooh, ooh, I know this one.

khl1uaA.png


So @Solr, you're gonna want to use Member ID in the variable section for this kind of thing. The example I posted has it so an NPC copies whoever is in front of the party, and I've had cutscenes in my games where the sequence is modified depending on who is the leader.

I hope this can help you!

(Oh you meant checking if actor ID is poisoned. That could complicate things...)
Ooh, ooh, I know this one.

khl1uaA.png


So @Solr, you're gonna want to use Member ID in the variable section for this kind of thing. The example I posted has it so an NPC copies whoever is in front of the party, and I've had cutscenes in my games where the sequence is modified depending on who is the leader.

I hope this can help you!

(Oh you meant checking if actor ID is poisoned. That could complicate things...)
Yeah @RCXDan, the state thing is really important for what I'm trying to accomplish. Thanks for showing me your cool moveroute technique though. I'm curious, what do you use it for? Is it for like a mirror effect done through an event or something?

Basically, I'm trying to design a complex-ish stat gaining system. I'm using a script that gives equipment states and assigns those states automatically to whichever actor equips that equipment. Whenever an actor level's up, their states are checked through a common event, and they will be assigned stat points for the states they have (or don't have).

Like if an actor equips an 'Iron Sword', they gain the state 'Strength_1'. After a battle (or any event in which an actor can gain EXP) a common event will check if the actor has leveled up, and if they have, another common event will be trigger, and if they still have the Iron Sword equipped (and thus still having the Strength_1 state), they will be assigned between 1 - 2 stat points in strength. If they ONLY have strength-based weapon(s) equipped (the actor only has the Strength_1 state, not Magic_1 or Technique_1) they will be granted an additional point in strength for their dedication.

As you can imagine, this common event will be pretty long and want to be able to pass actors through it on an ID basis instead of copying and pasting a massive common event and having to painstakingly modify it for each time the actor's name is mentioned. So I want a way to specify actor IDs using game variables.
try putting this into a Conditional Branch in the Script section:
$gameActors.actor(x).isStateAffected(y);
replace x with the ID number of the actor (you can see it in the Actor tab in the database) and y by the ID number of the state (same as in database). Poison has an ID of 4 by default, for example.

if you use RCXDan's tip above to use Control Variable to set a variable to an actor ID, you can find the actor ID like this:
$gameActors.actor($gameVariables.value(x)).isStateAffected(y);
just replace y the same way, and make x the variable number you saved the ID to.

you could use a Loop to go through the whole party this way.
Thanks for showing me your cool moveroute technique though. I'm curious, what do you use it for? Is it for like a mirror effect done through an event or something?

A few things.

The first was to see if NPCs can change appearance based on who is the leader of the party. The second was to see if they could use the stats of the player, since I have a feature where you can scan NPCs and see their stats. A doppelganger effect, where the NPC's stats / appearance will shift using conditional branches.

I thought it would be useful since the Member ID variable is very powerful for this kind of thing, but unfortunately I have not grasped how to make the game check if actor [x] is poisoned.

(This is part of the reason why I hopped in to the thread, since I have something similar planned.)

$gameActors.actor(x).isStateAffected(y);

This is unfortunately the MV onward version of the script call, and it doesn't work in VX Ace. 😅
The VX Ace version isn't much different.

$game_actors[x].state?(y)
This is unfortunately the MV onward version of the script call, and it doesn't work in VX Ace. 😅
woops, got my wires crossed 😅

$game_actors[x].state?(y)
beat me to it haha. I believe you could check the actor id saved to variable like this, where n is the variable number:
$game_actors[$game_variables[n]].state?(y)

and to reference who's in a particular position in the lineup, it's:
$game_party.members[index].id
where index is the position (starting at 0 for the leader)
try putting this into a Conditional Branch in the Script section:
$gameActors.actor(x).isStateAffected(y);
replace x with the ID number of the actor (you can see it in the Actor tab in the database) and y by the ID number of the state (same as in database). Poison has an ID of 4 by default, for example.

if you use RCXDan's tip above to use Control Variable to set a variable to an actor ID, you can find the actor ID like this:
$gameActors.actor($gameVariables.value(x)).isStateAffected(y);
just replace y the same way, and make x the variable number you saved the ID to.

you could use a Loop to go through the whole party this way.
@LyraVulture Thank for your help! But I think I made error implementing the script calls.
Capture.PNG
@LyraVulture Thank for your help! But I think I made error implementing the script calls.
sorry, I wrote the RPG Maker MV/MZ call and not the VXAce version. Trihan has posted the VXAce version 🙂
@LyraVultur @Trihan Thank you so much, it worked!!! It made the check correctly. I really appreciate your help 🙂
Capture.PNG

@RCXDan NPC's stats you can scan? So there is a mechanic in your game that involves stealing or copying NPC/Actor stats and appearances? It sounds really interesting, I can't think of a game with this mechanic. Luckily in VXA the Actor Change (stat) event command has an option where you can specify stat changes to an actor by designating the actor ID using a variable. I can't wait to see your project!
I poked around for a while and figured out how to do something else interesting 🙂
Capture2.PNG

By putting

$game_actors[$game_variables[10]].skills.include?($data_skills[$game_variables[11]])

in the script of a conditional branch, you can check if a certain actor has a certain skill while designating that actor (and the skill) using game variables (variable 10 and 11 in this example respectively. Alternatively you could just specify the skill ID you want to check directly with

$game_actors[$game_variables[10]].skills.include?($data_skills[89])

instead of having to set up a variable representing the skill ID first. (skill 89 happens to be Claw Dance)

VXA already has a built in way to make actors learn skills by specifying an Actor's ID as a variable, so with this handy line of script, there is now also a way to actually check the skills an actor already has using a common event (by specifying an Actor ID as a variable).

So with this, you could make a single common event complex skill learning system (with skill checking to make sure the same actors aren't learning the same skills over and over) that works by simply changing a single variable to match the Actor ID of the Actor who you want to (potentially) learn a new skill. My project uses a Saga-like skill system where skills are learned (assigned semi-randomly from a tier; lv.1 sword_skills, lv.2 sword_skills, ect.) when characters reach certain stat\weapon proficiency requirements, so this will definitely be useful.

Credit goes to @zadck @LyraVultur @Trihan

Original thread: https://forums.rpgmakerweb.com/threads/make-conditional-branch-use-variable-as-actor-id.146021/