• 0

    posted a message on [Ability] Add data field for single variable to Unit

    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:

    1. How can I create a custom integer attribute behavior with an integer field corresponding to the button that was pressed?
    2. How can I set this field using an ability trigger by pressing a button in the command window?
    3. 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?

    Thanks so much, I appreciate the help

     

     

    Posted in: Data
  • To post a comment, please or register a new account.