So I was wondering... we can call a Common event from a Skill. Let's say we want to refer to a targeted enemy inside the common event of that skill and make a conditional branches and do stuff by probabilities and stuff.
How can I set a variable to contain the targeted enemy?
I know how to set a value to a specific variable, referring to it by its #id on the database (var).
$gameVariables.setValue(var, value);
What I don't know is how to set on value this:
value should be 0 if no enemy is selected or battle occurs (by default).
else
value becomes 1,2,3,4,5,or 6 according to the currently targeted enemy.
Remember, this script command will execute while a spell is cast thus the spell already has a target.
I WANT THAT TARGET VALUE!
How can I set a variable to contain the targeted enemy?
I know how to set a value to a specific variable, referring to it by its #id on the database (var).
$gameVariables.setValue(var, value);
What I don't know is how to set on value this:
value should be 0 if no enemy is selected or battle occurs (by default).
else
value becomes 1,2,3,4,5,or 6 according to the currently targeted enemy.
Remember, this script command will execute while a spell is cast thus the spell already has a target.
I WANT THAT TARGET VALUE!


