preserve trigger

Asked by german

how can i do that in a map? (like for example starcraft triggers)

Question information

Language:
English Edit question
Status:
Solved
For:
Stratagus Edit question
Assignee:
No assignee Edit question
Solved by:
Kyran Jackson
Solved:
Last query:
Last reply:
Revision history for this message
Andre Novellino Gouvêa (andre-ng) said :
#1

What do you mean by being able to preserve the trigger?

Revision history for this message
german (pepeelgranjero) said :
#2

and example that occurs me now, a trigger: if you move a unit ("unit-archer" for example) to an X location ({45,32}), then play a wav file. In normal conditions you would move the archer to square 45,32 and a wav file should be played, but only one time, if you move away that archer and then you put em back in the square 45,32 nothing happens anymore, in starcraft for example adding the preserve trigger condition, the trigger least during the entire game, and in that example, anytime you move an archer to the square the wav file will be played.

Revision history for this message
Kyran Jackson (erstmap) said :
#3

if (unitlocation = blah) and (trigger1 == nil)) then
  trigger1 = True
 playsound
end

Revision history for this message
Best Kyran Jackson (erstmap) said :
#4

if (unitlocation = blah) then
  if (trigger1 == false) then
    playsound()
    trigger1 = true
  else
    donothing()
  end
else
  trigger1 = false
end

Revision history for this message
german (pepeelgranjero) said :
#5

Thanks Kyran Jackson, that solved my question.