Nope. Trigger don't have parameters (except those bools inbuilt for evaluation and execution). But you can either use a GUI action and check the box that says something like "create in a seperate thread".
This basically creates a trigger for this action and a global variable for every parameter. The "global parameters" are set to local variables of the same name inside the trigger, so it's basically a trigger with parameters.
If you don't need to have a seperate thread (= you won't use waits and stuff like that inside), then you could just use a normal action (=function)
Actions and functions are pretty much the same thing. The major difference is how the GUI treats them. You won't find functions in the "General" function list when you create a new line in your trigger/whatever.
To find a function that returns an int, you will for example need to
MyIntVar = MyFunctionThatReturnsInt("whatever",42)
Possible?
If not, any other way to pass variables into a trigger other than global variables?
Nope. Trigger don't have parameters (except those bools inbuilt for evaluation and execution). But you can either use a GUI action and check the box that says something like "create in a seperate thread". This basically creates a trigger for this action and a global variable for every parameter. The "global parameters" are set to local variables of the same name inside the trigger, so it's basically a trigger with parameters.
If you don't need to have a seperate thread (= you won't use waits and stuff like that inside), then you could just use a normal action (=function)
Ah thanks. I'm already doing something similar to how the GUI creates a global variable then sets it to the local variables within the trigger.
I'm using triggers because of the ability to call them dynamically, whereas functions I cannot. So I guess this is my only option... thanks though. :)
@Vermore: Go
you can call function and actions dynamically.... functions generally require you to set a variable = to the function. and actions you can just call.
You can pass variables through to both types...
Actions and functions are pretty much the same thing. The major difference is how the GUI treats them. You won't find functions in the "General" function list when you create a new line in your trigger/whatever.
To find a function that returns an int, you will for example need to
MyIntVar = MyFunctionThatReturnsInt("whatever",42)
Sorry, I think I was unclear about what I meant calling functions dynamically.
MyIntVar[i] = Functioni(SomeParameters);
... is not possible. On the other hand...
int global_i;
global_i = i; TriggerExecute(t[i], false, true); (Where you pass in a global_i as a parameter into the trigger) MyIntVar[i] = global_i;
... is possible. :)