I wanted to know a few things about the trigger editor.
1) When you put several conditions in a condition field, without using 'and' or 'or', does it imply a 'and' or a 'or' for the conditions ?
2) When you define an array of, say 5, is the first element of the array [0], [1], or is it automatically updated based on which element you first fill ?
3) Is there a way to start an action and continue the execution without waiting for the end of the action ? It's possible for triggers with 'run trigger without waiting', but didn't find the same for actions.
What I want to do is a loop :
The problem is it waits 5s for each player. I don't want to write a 'for' loop for each different stuff, end it for the 'wait', and start it again after. Nor do I want to define a new timer for each 'wait' as well, I would end with a lot of timers and needlessly complex code. Maybe I don't have a choice and must use a timer.
The 'wait' action just drives me crazy the more I use it, it makes so many bugs in a map ...
4) Is it possible to do the opposite from a trigger event based ?
I mean a particular event can happen several times, each time it starts an action, but sometimes I don't want several times the same action running for reasons of synchronisation (it can introduce a lot of really painful bugs when modifying global variables). There's a 'wait for trigger end' action, but I didn't seem to make it work as I wanted.
I wanted to know a few things about the trigger editor.
1) When you put several conditions in a condition field, without using 'and' or 'or', does it imply a 'and' or a 'or' for the conditions ?
'and'
Quote:
2) When you define an array of, say 5, is the first element of the array [0], [1], or is it automatically updated based on which element you first fill ?
if you define an array of size 5, the fields from [0] to [4] are useable.
Quote:
3) Is there a way to start an action and continue the execution without waiting for the end of the action ? It's possible for triggers with 'run trigger without waiting', but didn't find the same for actions. What I want to do is a loop :
The problem is it waits 5s for each player. I don't want to write a 'for' loop for each different stuff and end it for the 'wait', and start it again after or define a new timer for each 'wait' as well, I would end with a lot of timers and needlessly complex code. Maybe I don't have a choice and must use a timer. The 'wait' action just drives me crazy the more I use it, it makes so many bugs in a map ...
You can either create another trigger and pass values with global variables or create a custom action with the flag to start a separate thread (which internally does the exact same thing as the first option)
Quote:
4) Is it possible to do the opposite from a trigger event based ? I mean a particular event can happen several times, each time it starts an action, but sometimes I don't want several actions running at the same time for reasons of synchronisation (it can introduce a lot of really painful bugs when modifying global variables). There's a 'wait for trigger end' action, but I didn't seem to make it work as I wanted.
Not sure what you want here. Actions cannot run at the same time. Global variable manipulation will only interfere, if you use waits, in this case you can use local variables to pass values to after the wait.
You can either create another trigger and pass values with global variables or create a custom action with the flag to start a separate thread (which internally does the exact same thing as the first option)
Not sure what you want here. Actions cannot run at the same time. Global variable manipulation will only interfere, if you use waits, in this case you can use local variables to pass values to after the wait.
Thanks for the idea of local variables. Didn't think about it.
And what you said means that if a trigger event based is started twice at the exact same time, and in this trigger you call an action which doesn't have a 'wait', the action in the second trigger is started only if the action in the first trigger is finished ?
for each player PlayerID in player group
do
run trigger 'toto'(PlayerID) without waiting
end
trigger 'toto'
parameter PlayerID
stuff(PlayerID)
wait 5s
other stuff(Player ID)
yes. You could always just try it yourself :)
Quote:
And what you said means that if a trigger event based is started twice at the exact same time, and in this trigger you call an action which doesn't have a 'wait', the action in the second trigger is started only if the action in the first trigger is finished ?
Yes, basically. At least the code executions do not interfere with each other.
Hello,
I wanted to know a few things about the trigger editor.
1) When you put several conditions in a condition field, without using 'and' or 'or', does it imply a 'and' or a 'or' for the conditions ?
2) When you define an array of, say 5, is the first element of the array [0], [1], or is it automatically updated based on which element you first fill ?
3) Is there a way to start an action and continue the execution without waiting for the end of the action ? It's possible for triggers with 'run trigger without waiting', but didn't find the same for actions. What I want to do is a loop :
The problem is it waits 5s for each player. I don't want to write a 'for' loop for each different stuff, end it for the 'wait', and start it again after. Nor do I want to define a new timer for each 'wait' as well, I would end with a lot of timers and needlessly complex code. Maybe I don't have a choice and must use a timer. The 'wait' action just drives me crazy the more I use it, it makes so many bugs in a map ...
4) Is it possible to do the opposite from a trigger event based ? I mean a particular event can happen several times, each time it starts an action, but sometimes I don't want several times the same action running for reasons of synchronisation (it can introduce a lot of really painful bugs when modifying global variables). There's a 'wait for trigger end' action, but I didn't seem to make it work as I wanted.
Hey
'and'
if you define an array of size 5, the fields from [0] to [4] are useable.
You can either create another trigger and pass values with global variables or create a custom action with the flag to start a separate thread (which internally does the exact same thing as the first option)
Not sure what you want here. Actions cannot run at the same time. Global variable manipulation will only interfere, if you use waits, in this case you can use local variables to pass values to after the wait.
:)
So would this work ?
Thanks for the idea of local variables. Didn't think about it.
And what you said means that if a trigger event based is started twice at the exact same time, and in this trigger you call an action which doesn't have a 'wait', the action in the second trigger is started only if the action in the first trigger is finished ?
yes. You could always just try it yourself :)
Yes, basically. At least the code executions do not interfere with each other.