View attachment 205452
Code:
<swordANDshield>
<Custom Passive Condition>
if (user.isStateAffected(204) && user.isStateAffected (205)) {
BattleManagerTBS.activeBattler().addNewState(210);
condition = true;
} else {
BattleManagerTBS.activeBattler().eraseState(210);
condition = false;
}
</Custom Passive Condition>
Tried both syntaxes. Seems like in either case yanfly can't properly talk to LeTBS. maybe I got the syntax wrong or something.
I'm considering just ripping out the auto-state stuff and doing the same condition comparisons directly in the LeTBS functions in stead. That would work, but it wouldn't solve the problem I'd really like to solve which is getting the yanfly conditional tags to work so I can use them for other stuff later in a similar fashion to automate state interactions.
Edit: SOLVED it.
Turns out the real problem was that yanfly auto passives aren't ACTUALLY removed under any circumstances, and thus the LeTBS functions weren't triggering because according to LeTBS the SwordANDShield state was still there (even though its icon stopped existing in the buff monitor and any effects it had were removed)
So here's what I did, very simple:
Made a single global auto-state, called it Dual_Wield_Manager
Removed the custom scripting from the SwordANDshield state so it just has the meta tag my sprite changing code checks.
Set up the yanfly note tags thus:
Code:
<Custom Passive Condition>
if (user.isStateAffected(204) && user.isStateAffected (205)) {
user.addState(210);
} else {
user.removeState(210);
}
</Custom Passive Condition>
Then just repeated that for each dual wield case. Now that the state is actually added or removed appropriately, it works just like it should. Arban spawns in to battle with both his sword and shield, I dispel the sword, his sprite is updated to be holding just the shield. I can still read the dual wield states for evals on abilities and stuff like I wanted, and in general everything works perfectly (aside from needing to add some note tags to remove the popups from the invisible states when removed)
Turns out I the problem all along wasn't that LeTBS wasn't seeing a state change, but that as far as LeTBS was concerned the state wasn't changing at all!
Here's a video!