So I have a behavior with an effect and a button that applies it! GREAT!
But my problem is with removing the behavior when the button is pressed again and/or the remove button is pressed.
I'm trying to create more unique army variations by toggleing loadouts, i.e. Hydra:movement speed+/weapon dmg- and Battlecruise-Acceleration+/Weapon dmg-, etc. with the ability to change them for each unit.
Is this an issue with validators or requirements or am I just passing over something I missed?
edit: the problem I'm at now is that the remove button is not there or it tries to stack the initial behavior.
You need ot have 2 buttons and two abilities. One for applying the behavior, and another one for removing it. The applying ability command need a visibility requirement "number of instances of the behavior on unit equals zero". The removing ability' command need "number of instances of the behavior on unit more than zero".
So, when a unit owns the behavior, it only has the remove button, and vice versa.
And your behavior need to have max stack = 1 if you want to avoid stacks.
I take it you are using a Behavior ability? If not, do so.
In flags, check Toggleable.
Then set up the Commands field (It will want one button for on and one for off)
So I have a behavior with an effect and a button that applies it! GREAT!
But my problem is with removing the behavior when the button is pressed again and/or the remove button is pressed.
I'm trying to create more unique army variations by toggleing loadouts, i.e. Hydra:movement speed+/weapon dmg- and Battlecruise-Acceleration+/Weapon dmg-, etc. with the ability to change them for each unit.
Is this an issue with validators or requirements or am I just passing over something I missed?
edit: the problem I'm at now is that the remove button is not there or it tries to stack the initial behavior.
You need ot have 2 buttons and two abilities. One for applying the behavior, and another one for removing it. The applying ability command need a visibility requirement "number of instances of the behavior on unit equals zero". The removing ability' command need "number of instances of the behavior on unit more than zero".
So, when a unit owns the behavior, it only has the remove button, and vice versa.
And your behavior need to have max stack = 1 if you want to avoid stacks.
You could also try to use the "Behavior" ability. It allows behaviors to be toggled. The cloaking abilities of the banshee or ghost work this way.
They apply a behavior when pressed and remove it when pressed again.
@PooLatka: Go
I take it you are using a Behavior ability? If not, do so. In flags, check Toggleable. Then set up the Commands field (It will want one button for on and one for off)
I solved it earlier this morning, but thanks for your help.
I went the route of using triggers. -event->If any unit uses ability (removebutton), -action->Remove behavior from triggering unit.
its working flawlessly.
I personally would have used a Specialize ability and made each button apply a Set effect adding the one behaviour and removing the other options.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg