Hey everyone, I'm trying to make a passive ability for one of my characters, but I'm not sure where to even put the code for it.
I'm using Yanfly's Standard Turn Battle plugin.
When any actor in the party has their HP lowered to 30% of max HP, actor with the ID of 1 will immediately act, no matter if it has already acted on that turn or not. This can only happen 1 time per battle.
This is the effect that I'm looking for and I'm pretty sure it's possible because I did a similar thing in a previous post, but that won't work for this case because I can't put this in a skill's note section like I did there.
My coding knowledge is next to none, so after a bit of research I tried to put some things in troops battle event pages but the effect either doesn't work, crashes the game, only funcions after everyone has acted on that turn, etc.
There's also the problem that by default you can't make it so battle events trigger after certain actors or enemies act.
My latest attempt (in a script command in a battle event):
const actors = $gameParty.battleMembers();
const targetActor = actors.find(actor => actor.hp / actor.mhp <= 0.3);
if (targetActor && !$gameSwitches.value(1)) {
$gameTemp.reserveCommonEvent(7);
BattleManager.forceAction($gameActors.actor(2));
BattleManager.inputtingAction().setTarget(target);
$gameSwitches.setValue(1, true);
BattleManager.processTurn();
}
I'm thinking about trying to do this with states instead but im not sure how or with what plugins yet, can someone help me or at least point me in the right direction?
I'm using Yanfly's Standard Turn Battle plugin.
When any actor in the party has their HP lowered to 30% of max HP, actor with the ID of 1 will immediately act, no matter if it has already acted on that turn or not. This can only happen 1 time per battle.
This is the effect that I'm looking for and I'm pretty sure it's possible because I did a similar thing in a previous post, but that won't work for this case because I can't put this in a skill's note section like I did there.
My coding knowledge is next to none, so after a bit of research I tried to put some things in troops battle event pages but the effect either doesn't work, crashes the game, only funcions after everyone has acted on that turn, etc.
There's also the problem that by default you can't make it so battle events trigger after certain actors or enemies act.
My latest attempt (in a script command in a battle event):
const actors = $gameParty.battleMembers();
const targetActor = actors.find(actor => actor.hp / actor.mhp <= 0.3);
if (targetActor && !$gameSwitches.value(1)) {
$gameTemp.reserveCommonEvent(7);
BattleManager.forceAction($gameActors.actor(2));
BattleManager.inputtingAction().setTarget(target);
$gameSwitches.setValue(1, true);
BattleManager.processTurn();
}
I'm thinking about trying to do this with states instead but im not sure how or with what plugins yet, can someone help me or at least point me in the right direction?