preserve trigger

Asked by german on 2014-02-07

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:
2014-02-15
Last query:
2014-02-15
Last reply:
2014-02-12

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

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.

Kyran Jackson (erstmap) said : #3

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

Best Kyran Jackson (erstmap) said : #4

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

german (pepeelgranjero) said : #5

Thanks Kyran Jackson, that solved my question.