I have an ability that's a behavior. The behavior gives my unit a new weapon, but when i select the icon in game, the ability works but the icon goes away. I wonder why this is and how to fix it?
did you use the ability type "Behavior"? That would explain it. If you want the behavior to be toggleable, go to the flags and check the toggle flag, then go to commands, add a button to on and another to off (different buttons, what they are aren't that important you just need to remember which one is which), then create 2 buttons on the command card, one to turn the behavior on and one to turn it off. The second button appears when the first one disappears and vice versa.
If it's a timed behavior and you don't want it toggleable, use an ability of type "Effect - Instant", create an "Apply Behavior" Effect, set it's behavior to the behavior you wanted and it's target to "caster", then set the abilities "Effects" field to the Apply Behavior. After that modify everything else you need (costs, etc.) This definitely won't make the button disappear.
You're using two behaviors? Off should actually remove the behavior... Well, never tried it out myself, so I guess using two behaviors could be possible.
Use validators. go to the validator tab, create a new one of type "count behavior stack" (or something like that... compare behavior stack, unit compare behavior stack, something that's connected to behavior and numbers in any case), create one that has the behavior set to your On behavior, comparison type "Equal to" and the value should be "0"
Go to your off behavior, there's a field Behavior (Disable), put the validator in there.
The disable/remove field in the behavior disables/removes the behavior when the validator returns false (so our validator says "On behavior must be 0", if on behavior is not 0 (i.e. it's actually there) the validator is wrong and your off behavior is disabled)
Yea, 2 behaviors, 1 to enable a weapon, the other to disable that weapon and enable a new weapon, vise-versa. Thanks for the quick reply, I tried everything you recommended, after putting in the validater, the icon disappears again
I have an ability that's a behavior. The behavior gives my unit a new weapon, but when i select the icon in game, the ability works but the icon goes away. I wonder why this is and how to fix it?
did you use the ability type "Behavior"? That would explain it. If you want the behavior to be toggleable, go to the flags and check the toggle flag, then go to commands, add a button to on and another to off (different buttons, what they are aren't that important you just need to remember which one is which), then create 2 buttons on the command card, one to turn the behavior on and one to turn it off. The second button appears when the first one disappears and vice versa.
If it's a timed behavior and you don't want it toggleable, use an ability of type "Effect - Instant", create an "Apply Behavior" Effect, set it's behavior to the behavior you wanted and it's target to "caster", then set the abilities "Effects" field to the Apply Behavior. After that modify everything else you need (costs, etc.) This definitely won't make the button disappear.
@TheAlmaity: Go
Wow that's awesome thanks! Any idea how I can make the "on" behavior disable the "off" behavior?
You're using two behaviors? Off should actually remove the behavior... Well, never tried it out myself, so I guess using two behaviors could be possible.
Use validators. go to the validator tab, create a new one of type "count behavior stack" (or something like that... compare behavior stack, unit compare behavior stack, something that's connected to behavior and numbers in any case), create one that has the behavior set to your On behavior, comparison type "Equal to" and the value should be "0"
Go to your off behavior, there's a field Behavior (Disable), put the validator in there.
The disable/remove field in the behavior disables/removes the behavior when the validator returns false (so our validator says "On behavior must be 0", if on behavior is not 0 (i.e. it's actually there) the validator is wrong and your off behavior is disabled)
@TheAlmaity: Go
Yea, 2 behaviors, 1 to enable a weapon, the other to disable that weapon and enable a new weapon, vise-versa. Thanks for the quick reply, I tried everything you recommended, after putting in the validater, the icon disappears again
I presume your unit will be having >2 weapons to choose from? If not Look at this map I made
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