#Global Action

16 messages · Page 1 of 1 (latest)

torpid sleet
#

what exactly do you mean?

oblique wyvern
#

Imagining create a variable isUnitPlagued and a function called aura_env.IsOpponentInRange

I would like to be able to use the function in every other aura trigger without creating the action for every aura. Also, I would like to be able to get/set the variable from any trigger.

torpid sleet
#

thats a default trigger.

oblique wyvern
#

A default trigger?

torpid sleet
#

yes.

oblique wyvern
#

What do you mean?

torpid sleet
#

a trigger with no code involved

#

it sounds like you want to create a rotation helper

oblique wyvern
#

Yes, I just chosen that as example

torpid sleet
#

by far the easiest way is by not duplicating all the triggers everywhere, but creating one aura per action. and putting them in a dynamic group in the order you have them.

#

then set a limit of 1

oblique wyvern
#

Imagine I make a rotation helper. I need to check if the unit is alive and in combat. It will requires to add the two default trigger for every aura while creating a global variable and function could reduce it to only one.

#

I don't think my question is well written 😕

#

I would like to be able to create function and variable that are available to every other aura. Example:

Aura 1

Action

if IsOpponentInRange then
    counter = counter + 1
end

Aura 2

Action

if counter > 10 then
    print("More than 10 enemi in range."
end

The only solution I found for function is copying it in each aura. Concerning variable, I haven't found a solution to make variable global.

torpid sleet
#

!scanevents