Now I can make items (pills?) that do rerolls for any of the party members, too!
I mean, you technically could do that already with Conditional Branch and Plugin Command. Could get tedious if you have many actors, though. Or maybe you meant randomising only specific params or something.
As we've seen, VisuStella has a cache system, so if you do change any traits then you should refresh the trait bearer afterwards, e.g.
$gameActors.actor(1).refresh().
For variable inputs you can just call the named function bound to the plugin command, e.g.
JavaScript:
ExtraTraits.command.get("Randomise Param Rates")({
Actor: $gameVariables.value(123)
});
I.e. "randomise param rates for the actor with ID equal to the value of game variable 123." This has the advantage of replicating the plugin command, including the battler refresh.
(It's "get etc" here just because I used a
Map for storing the commands, instead of a normal object.)
In case you're interested: it'd be
relatively simple to rewrite the plugin command (or add a new one) to accept a variable ID and use the value of that variable as the actor ID instead. You could change:
- The arg in the header from
@type actor to @type variable;
- How the actor ID is obtained from the input arguments.
In that case you'd probably also want to change the arg name in both places, too.