Basically I want to check if a certain unit has a certain ability on auto-cast (not just flagged, but actually activated) in an if-then-else condition.
Goal:
I have 20 units, and each spawns additional units. The 20 units have various abilities with auto cast option. Depending on which one of them is activated with auto cast, the spawned units (by this unit) should have enabled auto cast for this ability as well.
Example:
A barracks has a Stimpack ability with auto cast (dummy ability of course). If it's enabled, the marines that spawn from this structure have Stimpacks on auto cast as well.
Because the auto cast flag is set for all of the units in general. All of them should be able to auto cast, but for some it is deactivated (as when you right-click on an auto cast ability in the unit's command card).
EDIT: Maybe I was overthinking things. Basically it doesn't matter if the flag is set at the beginning. With Unit Ability Command State I can toggle it on/off if the conditions are met.
That's what I need and I can't find it.
Basically I want to check if a certain unit has a certain ability on auto-cast (not just flagged, but actually activated) in an if-then-else condition.
Goal: I have 20 units, and each spawns additional units. The 20 units have various abilities with auto cast option. Depending on which one of them is activated with auto cast, the spawned units (by this unit) should have enabled auto cast for this ability as well.
Example: A barracks has a Stimpack ability with auto cast (dummy ability of course). If it's enabled, the marines that spawn from this structure have Stimpacks on auto cast as well.
Thanks!
@Winryamo: Go
I've never tried this myself, but I would look into the Catalog Field of triggers.
It allows you to retrieve (what you want to look at) and modify data fields of units
Use the Unit Ability Command State function with the Is Auto Cast flag checked.
Catalog functions can only tell you about how unit types are configured in the data module, not the state of specific units.
@temhawk: Go
Ah, i see. thanks! I just learned something new. Actually, that is extremely useful for many reasons.
@temhawk: Go
Is "Is Auto Cast" flag = activated auto cast?
Because the auto cast flag is set for all of the units in general. All of them should be able to auto cast, but for some it is deactivated (as when you right-click on an auto cast ability in the unit's command card).
EDIT: Maybe I was overthinking things. Basically it doesn't matter if the flag is set at the beginning. With Unit Ability Command State I can toggle it on/off if the conditions are met.
Thanks!