I want an animation to run within a state whenever the user inflicted with the state deals damage to an enemy. I'm using the VisuStella BattleCore command "INJECT: Animation Begin". This does work inside the Common Event of a skill, and other commands inside the <JS Post-Damage as User> notetag of the state also work. It's only the plugin command which has a problem. No errors are returned, it just does nothing. Here's the code of interest:
I've tried all combinations of
a) replacing this with $gameTroop._interpreter
b) replacing Targets: ["user"] with ["target"], ["current target"], even ["actor id 4"]
c) replacing "INJECT: Animation Begin" with "ActSeq_Inject_AnimationStart"
I've even tried other, simpler plugin commands with no luck.
Edit: @rpgLord69 provided the correct answer:
I didn't even think to look in the Battle Core plugin for the command name; I assumed the code was obfuscated. I was using the Battle Core wiki as my reference and it never mentions ActSeq_Inject_AnimationStart. Also, I'm enough of a JavaScript newb that
"Targets:arraystr" : JSON.stringify(["user"]),
was dark magic.
Code:
<JS Post-Damage as User>
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "INJECT: Animation Begin", {
Targets: ["user"],
Filename: "Shock",
HorizontalCells: "4",
VerticalCells: "1",
FrameDelay: "30",
SmoothBitmap: "false",
Offset: "",
OffsetX: "+0",
OffsetY: "+0"
});
</JS Post-Damage as User>
I've tried all combinations of
a) replacing this with $gameTroop._interpreter
b) replacing Targets: ["user"] with ["target"], ["current target"], even ["actor id 4"]
c) replacing "INJECT: Animation Begin" with "ActSeq_Inject_AnimationStart"
I've even tried other, simpler plugin commands with no luck.
Code:
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ANIM: Show Animation", {
Targets: ["user"],
AnimationID: "65"
});
Edit: @rpgLord69 provided the correct answer:
Code:
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ActSeq_Inject_AnimationStart", {
"Targets:arraystr" : JSON.stringify(["user"]),
"Filename:str" : "Shock",
"horzCells:num" : 4,
"vertCells:num" : 1,
"frameDelay:num" : 30,
"smooth:eval" : false,
"Offset" : 0,
"offsetX:eval" : +0,
"offsetY:eval" : +0
});
I didn't even think to look in the Battle Core plugin for the command name; I assumed the code was obfuscated. I was using the Battle Core wiki as my reference and it never mentions ActSeq_Inject_AnimationStart. Also, I'm enough of a JavaScript newb that
"Targets:arraystr" : JSON.stringify(["user"]),
was dark magic.