I'm trying to give a unit four abilities for it to modify its combat performance: Power to Weapons, Power to Shields, Power to Engines and Restore Power. The first three will halt the unit's energy regeneration, "diverting" it in order to improve the rate-of-fire, shield armor amount, and movement speed, respectively, while the fourth one is a reset button to turn the energy regeneration back on.
Each ability applies a behavior to the unit. What I want is for the four of them to be mutually exclusive. If you already turned one on, turning on a second will remove the behavior of the first. I'm trying to achieve this with validators that can track when a given behavior or ability is in use, but I'm not sure what type would be best used for this. So far I've tried "Unit Ability" and "Unit Compare Behavior Count". The first one simply switched the behavior back off the instant it was applied, while the second would just prevent other abilities from being used once any one was activated.
What kind of validator should I be using here? Or is this even the right way to go about it?
I'm pretty sure there's a validator that can count the number of behaviours on a unit. So you would just have to add four validators each checking for the behaviour counter to be zero.
This will just prevent the unit from using the other abilites though. I just looked at your post again and realized that you want the next ability to remove the previous behaviours. In that case, I wouldn't suggest using validators. Just create a couple of effects to remove the according behaviours when you used the ability...
Okay, so I've got an effect that removes the behaviors, but there's no field in an Ability - Behavior for me to make it use an Effect and no field in an Effect - Remove Behavior to make it go off when the Ability is used. And I need multiple effects to fire when the Ability gets used, one to remove each possibly-conflicting Behavior.
Edit: Nevermind, figured it out. Going to give each Behavior an Initial Effect, which is an Effect - Set that fires other effects to kill the conflicting Behaviors. That way, the already-existing Behavior won't be able to prevent a new one from being applied.
Okay, using that I've gotten three of the four abilities working, but the fourth is proving obnoxiously stubborn.
The way I've got it now, the chain for the "Power to Engines/Shields/Weapons" abilities goes like so:
Ability (Effect - Instant)
- Effect - Set
- Effect - Remove Behavior A
- Effect - Remove Behavior B
- Effect - Apply Behavior C
For the "Restore Power" ability, it's pretty much the same but with three Remove Behaviors instead of two Remove and one Apply.
What's weird is that the Power to Engines, Power to Shields and Restore Power abilities are working perfectly, but the Power to Weapons one is not. When I activate the ability, it will clear off either of the other two Behaviors but won't apply its own. It's especially bizzare because it does this even if I change the Ability to only use the "Turn Behavior A On" effect, rather than the whole set. When configured that way it shouldn't do anything to the Engine or Shield behaviors, but it still does.
As far as I can tell the three Behaviors are identical save for their Modification parameters (i.e. what they actually do to the unit), as are the On/Off/Set Effects. And if I just stick the plain Behavior on the unit, it shows up fine until one of the other Abilities removes it.
Is there some weird quirk with rate-of-fire multiplier Behaviors that stops them being applied to a unit? I've scrapped the whole set of Power to Weapons abilities/effects/behaviors and re-built them from scratch, but they still don't work. :(
I'm trying to give a unit four abilities for it to modify its combat performance: Power to Weapons, Power to Shields, Power to Engines and Restore Power. The first three will halt the unit's energy regeneration, "diverting" it in order to improve the rate-of-fire, shield armor amount, and movement speed, respectively, while the fourth one is a reset button to turn the energy regeneration back on.
Each ability applies a behavior to the unit. What I want is for the four of them to be mutually exclusive. If you already turned one on, turning on a second will remove the behavior of the first. I'm trying to achieve this with validators that can track when a given behavior or ability is in use, but I'm not sure what type would be best used for this. So far I've tried "Unit Ability" and "Unit Compare Behavior Count". The first one simply switched the behavior back off the instant it was applied, while the second would just prevent other abilities from being used once any one was activated.
What kind of validator should I be using here? Or is this even the right way to go about it?
@JimStarluck: Go
I'm pretty sure there's a validator that can count the number of behaviours on a unit. So you would just have to add four validators each checking for the behaviour counter to be zero.
This will just prevent the unit from using the other abilites though. I just looked at your post again and realized that you want the next ability to remove the previous behaviours. In that case, I wouldn't suggest using validators. Just create a couple of effects to remove the according behaviours when you used the ability...
Greetings
Okay, so I've got an effect that removes the behaviors, but there's no field in an Ability - Behavior for me to make it use an Effect and no field in an Effect - Remove Behavior to make it go off when the Ability is used. And I need multiple effects to fire when the Ability gets used, one to remove each possibly-conflicting Behavior.
Edit: Nevermind, figured it out. Going to give each Behavior an Initial Effect, which is an Effect - Set that fires other effects to kill the conflicting Behaviors. That way, the already-existing Behavior won't be able to prevent a new one from being applied.
Make a Set effect and add all your "Remove Behaviour" effects as well as your ability effect into that set.
Now go to your ability and set it's "Effect" to your set.
Okay, using that I've gotten three of the four abilities working, but the fourth is proving obnoxiously stubborn.
The way I've got it now, the chain for the "Power to Engines/Shields/Weapons" abilities goes like so:
Ability (Effect - Instant) - Effect - Set - Effect - Remove Behavior A - Effect - Remove Behavior B - Effect - Apply Behavior C
For the "Restore Power" ability, it's pretty much the same but with three Remove Behaviors instead of two Remove and one Apply.
What's weird is that the Power to Engines, Power to Shields and Restore Power abilities are working perfectly, but the Power to Weapons one is not. When I activate the ability, it will clear off either of the other two Behaviors but won't apply its own. It's especially bizzare because it does this even if I change the Ability to only use the "Turn Behavior A On" effect, rather than the whole set. When configured that way it shouldn't do anything to the Engine or Shield behaviors, but it still does.
As far as I can tell the three Behaviors are identical save for their Modification parameters (i.e. what they actually do to the unit), as are the On/Off/Set Effects. And if I just stick the plain Behavior on the unit, it shows up fine until one of the other Abilities removes it.
Is there some weird quirk with rate-of-fire multiplier Behaviors that stops them being applied to a unit? I've scrapped the whole set of Power to Weapons abilities/effects/behaviors and re-built them from scratch, but they still don't work. :(
Mind uploading your map? Or PMing it if you have privacy concerns. I think this above is likely an oversight somewhere in your code.