@ShadowDragon I don't think that is the problem.
the description sounds as if that script is not part of the player decisions, more for some kind of management and as such should only run once per turn after one action, not after every action if the actor has multiple.
@ws6tbz for that, the plugin you're using to run that script needs to be modified.
so yopu need to link us to that plugin and probably the script you're running from it
At the begining of battle, a picture would display.
(Sorry I'm really unfamiliar with using script to call image, such as "sprite", "bitmap" ...
So I used the battle event to show picture.)
Then a script would move the picture after every actor/enmemy's action.
Below is my script(plugin) for the requirement
JavaScript:
/*:
* @plugindesc image moves when an action ends.
*/
var Imported = Imported || {};
Imported.TestForActionUpdate = true;
var TesT = TesT || {};
TesT.parameters = PluginManager.parameters('TestForActionUpdate');
var actionCount = 0;
var TesT_startBattle = BattleManager.startBattle;
BattleManager.startBattle = function() { // initialize the actionCount
actionCount = 0;
TesT_startBattle.call(this);
};
var TesT_endAction = BattleManager.endAction; // move the image after an action ends
BattleManager.endAction = function() {
actionCount++;
if(actionCount % 2 == 0) {
$gameScreen.movePicture(1, 0, 200, 0, 100, 100, 255, 0, 30); // when the actionCount%2 == 0, move the image to the right
} else {
$gameScreen.movePicture(1, 0, -200, 0, 100, 100, 255, 0, 30); // otherwise, move the image to the left
}
TesT_endAction.call(this);
}
Before I used the YEP_InstantCast, the picture can move left and right normally.
But now, the picture does not only move after an action, even after an instant cast(item or skill), the picture would also move.
😢
always mention all relevant plugins at the very least. Im assuming by endAction youre referring to Yanfly's buffs and states <Custom Action End Effect> notetags?
regardless, the instant cast plugin adds a function to tell if an action is instant to not. since you already have a way to run js on a battler's action, the code to use to see if the action isnt instant is
Code:
if (!user.isInstantCast(user.currentAction().item()))
assuming "user" is a valid reference to the battler in the method youre using
Thanks, I used the Yanfly's BuffStateCore, but I can't see what's wrong with the plugin.
I tried to look for the flag of "whether actor/enmey used an Instant Cast", in the Yanfly's InstantCast plugin, however I can't find it.