Scripted battle help

So basically I was hoping for a way to use the party's prior actions in a conditional. So if turn 1, party defends, I'd like a way to make the dialogue during turn 2 reflect that they defended rather than attacked. The issue I'm having is that the Guard STATE doesn't get applied until AFTER the dialogue in each turn, and of course goes away as the turn ends, so the dialogue never has a chance to reflect that.
Could you post some screenshots perhaps of how you are currently trying to do this?
You could just add a common event to Guard that turns on a switch.

Then have a troop event with the trigger of that switch. Or, if you want it to happen the turn after, you make it a troop event with the trigger of every turn, then check for that switch to be on.

You could also use a plugin like Yanfly's Skill Core (or Yanfly's Buffs & States) to flip the switch when the skill is executed/state is applied.
You could just add a common event to Guard that turns on a switch.

Then have a troop event with the trigger of that switch. Or, if you want it to happen the turn after, you make it a troop event with the trigger of every turn, then check for that switch to be on.

You could also use a plugin like Yanfly's Skill Core (or Yanfly's Buffs & States) to flip the switch when the skill is executed/state is applied.
I'll give that a shot. I can adjust the dialogue for whenever it comes up to reflect prior turn or current turn under guard.

Yep, common event does exactly what I want. I did check those 2 plugins, and I couldn't find a way to do what you were saying with them but I think I can live with this the way it is.

Edit: So it's not quite as perfect as I had hoped. As the enemy ALSO uses Defend throughout this fight, that threw me off a bit. No biggie, I just copy/pasted the Defend skill, removed the common event effect and had the enemy use that one. The problem now is that with this copy/pasted skill, the enemy will, instead of just pulling out his shield, step forward a bit, do the casting animation, pull out his shield, then move back to his original position.

I got past the casting animation with an action sequence that forced him to just use the guard animation which he does now, but he still steps forward to do it.

Is there something hard-coded in skill #2 that prevents any motion other than the spritesheet's guard animation that doesn't get carried over when copy/pasting? And is there an action sequence command that would keep him in place on that secondary Defend command? The sequence that's there now is short and sweet:


<target action>
motion guard: user
action effect: target
wait: 30
</target action>

Edit edit: Figured that part out too with a <setup action>, so I think I'm good here, at least for now.
Figured that part out too with a <setup action>
Right, the stepping forward and casting animation is a default part of Yanfly's setup action.

I did check those 2 plugins, and I couldn't find a way to do what you were saying with them
Yanfly's Skill Core, notetag in the Guard skill:
Code:
<Before Eval>
if (user.isActor())
    $gameSwitches.setValue(X, true);
</Before Eval>

Or, Yanfly's Buffs & States Core, in the Guard state:
Code:
<Custom Apply Effect>
if (user.isActor())
    $gameSwitches.setValue(X, true);
</Custom Apply Effect>

where X is the ID of the switch you want to turn on, no leading zeros. Both of those check for it to be done by an actor, so you don't care about action sequence stuff for enemies.
Is there something hard-coded in skill #2
It might be, because skill #2 is hardcoded to the guard button as well.
The same way skill #1 is hardcoded to be used by the attack button.

Original thread: https://forums.rpgmakerweb.com/threads/scripted-battle-help.158175/