I have a custom unit and I want to be able to set a custom data field "choosen_number" to a number 1-7 based on the button pressed in the command panel. Later in a trigger I then want to be able to fetch this value and use it.
So when I press one of these buttons, a variable local to the unit should be set to the number on the button. But I can't figure out how I can create a custom data field or anything to store this value. It seems like I need to create an "Attribute" type Behavior to store the value. I would then create a custom ability for each button that would set this attribute to the value on the button. I am unsure how that would work either. But I am pretty sure that later on in my Trigger I can get the value of the attribute from the catalog.
TLDR:
How can I create a custom integer attribute behavior with an integer field corresponding to the button that was pressed?
How can I set this field using an ability trigger by pressing a button in the command window?
Is there a way for me to use one ability and then pass variables to it somehow, so I don't need to create a separate ability for each button?
Why not just use the Custom Unit Value trigger action? That sets an integer to that specific unit for a specific integer slot. The Abathur Coop commander uses it to cound the biomass stacks.
I have a custom unit and I want to be able to set a custom data field "choosen_number" to a number 1-7 based on the button pressed in the command panel. Later in a trigger I then want to be able to fetch this value and use it.
So when I press one of these buttons, a variable local to the unit should be set to the number on the button. But I can't figure out how I can create a custom data field or anything to store this value. It seems like I need to create an "Attribute" type Behavior to store the value. I would then create a custom ability for each button that would set this attribute to the value on the button. I am unsure how that would work either. But I am pretty sure that later on in my Trigger I can get the value of the attribute from the catalog.
TLDR:
Thanks so much, I appreciate the help
Why not just use the Custom Unit Value trigger action? That sets an integer to that specific unit for a specific integer slot. The Abathur Coop commander uses it to cound the biomass stacks.
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