I have been trying to create an effect that kicks in when a unit runs out of energy, but trouble has ensued (!!). Basically, it will make the unit move and attack slower until its energy is topped up again.
What I tried to do: make a buff that periodically checks a validator and then applies a behaviour if the validator returns true.
My behaviour was a buff: Combat - modification (change attack speed and movement speed, decrease by 50%)
The validator was in the effect: apply behaviour and was a Unit Compare Vitals validator to check if the unit had less than 1 energy.
So it goes buff (always on, checks periodically), effect (check validator), apply behaviour (movement decrease)
When it became confusing, I tried placing the validator at different places (changing it when appropriate to reflect the negative/positive check)
The results: no matter what, the movement speed is always decreased, even if the buff doesn't show. This is strange to me as it is in the same buff as the weapon speed decrease, and yet the weapon speed decrease was not always applied.
The buff itself (which I gave an X symbol to test it) would either appear all the time (when the unit had energy as well as when it didn't), none of the time, or, once, the reverse to what I wanted (on when the unit had energy and off when it didn't).
I've spent some time on it, and I don't know what sort of validator I need in order to get it apply the buff when the unit has no energy and unapply it when the unit has 1 or more energy.
Any ideas?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi guys,
I have been trying to create an effect that kicks in when a unit runs out of energy, but trouble has ensued (!!). Basically, it will make the unit move and attack slower until its energy is topped up again.
What I tried to do: make a buff that periodically checks a validator and then applies a behaviour if the validator returns true. My behaviour was a buff: Combat - modification (change attack speed and movement speed, decrease by 50%) The validator was in the effect: apply behaviour and was a Unit Compare Vitals validator to check if the unit had less than 1 energy. So it goes buff (always on, checks periodically), effect (check validator), apply behaviour (movement decrease) When it became confusing, I tried placing the validator at different places (changing it when appropriate to reflect the negative/positive check)
The results: no matter what, the movement speed is always decreased, even if the buff doesn't show. This is strange to me as it is in the same buff as the weapon speed decrease, and yet the weapon speed decrease was not always applied.
The buff itself (which I gave an X symbol to test it) would either appear all the time (when the unit had energy as well as when it didn't), none of the time, or, once, the reverse to what I wanted (on when the unit had energy and off when it didn't).
I've spent some time on it, and I don't know what sort of validator I need in order to get it apply the buff when the unit has no energy and unapply it when the unit has 1 or more energy.
Any ideas?