I would love a clean way to get enemy AI smart enough to use an ATB interrupting skill on an a player actor that is mid-cast.
I have been wracking my brain trying to crack this, and all I can come up with is to rewrite each skill with a cast time as an action sequence, and put a state? on the actor? And use vizu Battle AI plugin to focus on actors with that state? idk sounds janky.
Any help would be appreciated.
I have moved this thread from RPG Maker MZ Tutorials to RPG Maker MZ Support.
yeah, i tried "actor" as well, with no luck. i also looked at rmmz_managers.js, to see what kind of variables it might use, and it looks like it uses something called _ActionState, so i tried that in place of _tpbState and that wasnt it either.
thanks a bunch for your help
[EDIT:
Hmmm, seems like it's just programmed in a "confusing" way. Like it only accepts some kind of expressions or something. I think I got it to work by using:
($gameActors.actor(1)._tpbState === "casting") === true
I'll check if it accepts it somehow like this using the "target" thing...]
I'll bump this, since it's only a month old and I have the exact same question.
Even if we ignore the target or whatever would be the correct variable, what does it mean when it also says that "Reference error: casting is not defined"?
I tested it with:
$gameActors.actor(1)._tpbState === "casting"
but even that gives the same error (or when the actor is in the charging phase, it starts saying "charging is not defined".
However, when I put a script "$gameActors.actor(1)._tpbState" into a variable and make a text box with it, it does say either "casting" or "charging", so clearly it has a value? So what's the problem?
Ah, I didn't see the edit earlier, no. I guess it's some quirk of how VisuStella's plugin parses that condition. 😴
The core engine has BattleManager._targets, which is an array containing the remaining targets for the current action (does not include the current target). I don't imagine that'll help much.
Maybe try $target instead of target? I think I saw someone use something like that in a VisuStella action sequence once.
Hmm, can't get it to work. But thanks for the help. Hope someone knows how the target can be referenced...