I'm trying to have a footman auto-cast its "Defend" ability in a war3 map. The footman has an Ability called "Defend", of type behavior. It has the flag "toggle" and can be turned on/off with buttons defined in the Ability: Commands+. (We can assume here that the research requirement is fulfilled). The corresponding behavior is called "Defend (trigger dummy)" and will do some model and damage response modifications when enabled.
I need a Validator to check if this behavior is enabled or disabled on the unit, or equivalently if the ability is toggled on or off.
I created a "DefendIsOn" validator of type "Unit Compare Behavior Count" that checks count of "Defend "Trigger Dummy", but it doesn't work since then footman never has this dummy behavior (it only has the ability on/off).
Arf, one of those times when you find the solution just after posting the question! I think actually writing and asking the question made it clearer in my mind, that's how I found.
If anyone reads this and is interested in the solution, I used the "Unit Compare Ability Level" validator for my 'DefendIsOn' and 'DefendIsOff' validators. If the ability is disabled, its ability level will be 0.
Since the ability is a toggle on/off, you need to think of the state in which it is before you apply it (here, I want to turn it off when the fight is over). My auto-cast for the footman's Defend ability is something like:
(DefendIsOff AND EnemiesNearby) OR (DefendIsOn AND NoEnemiesNearby)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I'm trying to have a footman auto-cast its "Defend" ability in a war3 map. The footman has an Ability called "Defend", of type behavior. It has the flag "toggle" and can be turned on/off with buttons defined in the Ability: Commands+. (We can assume here that the research requirement is fulfilled). The corresponding behavior is called "Defend (trigger dummy)" and will do some model and damage response modifications when enabled.
I need a Validator to check if this behavior is enabled or disabled on the unit, or equivalently if the ability is toggled on or off.
I created a "DefendIsOn" validator of type "Unit Compare Behavior Count" that checks count of "Defend "Trigger Dummy", but it doesn't work since then footman never has this dummy behavior (it only has the ability on/off).
Can you help me please?
@Chewiest: Go
Arf, one of those times when you find the solution just after posting the question! I think actually writing and asking the question made it clearer in my mind, that's how I found.
If anyone reads this and is interested in the solution, I used the "Unit Compare Ability Level" validator for my 'DefendIsOn' and 'DefendIsOff' validators. If the ability is disabled, its ability level will be 0.
Since the ability is a toggle on/off, you need to think of the state in which it is before you apply it (here, I want to turn it off when the fight is over). My auto-cast for the footman's Defend ability is something like: (DefendIsOff AND EnemiesNearby) OR (DefendIsOn AND NoEnemiesNearby)