Skip to content

Current questions and answers regarding the map editor.

User Avatar
#2357
Auto-translated
Oligarch
I've been struggling with this question for a while:
If there's a function of this type:
if p==1 then...
else if p==2 then...
else if p==3 then
Trigger(.., nil)
end
...
trigger
so that the player activates it three times (with p=1, 2, 3)
will the trigger reset only after ALL instructions are executed, i.e., only after the 3rd activation?

So, this function will check the value of p only once. That is, it will not check p in order, but only once. This is clear. Next, the trigger will be reset only when the value of p reaches 3. Until then, the function will be checked.
If you immediately set p = 3, the function will work like this:
p is not equal to 1, maybe p == 2?
p is not equal to 2, maybe p == 3?
p is equal to 3, hooray, we execute only what is written there! We reset the trigger function.

Whatever