The thing that makes this not an immediately easy answer is the lack of context. But the pertinent functions are:
Code:
$gameVariables.setValue(variableID, value);
and
So if you have a JavaScript variable for an actor someplace, and you want to store that into a game variable, you'd do:
Code:
$gameVariables.setValue(variableID, actor.actorId());
where variableID is, of course, the number ID of the game variable.
So to clarify (to make sure I understand), not enough context would depend on the situation you're in? For example, whether I was calling this inside or outside of combat?
I am creating a "dual tech" function (for those of you familiar with Chrono Trigger), and when the player selects the option, I have to do a check to make sure that the appropriate actor is in the active battle party (since my game has more than four actors), else, the ability will cancel or fail. Being able to set a variable to an actor's ID would help me cut down on the amount of "If-Else" statements I would need in the script (since there are no "AND" or "OR" options in the menu).
So the function is $gameVariables.setValue(X,X).
The first X should be ID# of the variable to be set.
The second X should be the function "actor.actorid()," which sets the variable to the actor's ID#.
If I understand this correctly, I should be able to use "actor.actorid()" to assess which party members are in which slot when a dual tech is selected. I hope I understood that right. It's going to take a while before I can test this to make sure it all works.
Thanks for all your help.
🙂