Home   Help Search Login Register  

Author Topic: Trigger = script continue  (Read 514 times)

0 Members and 2 Guests are viewing this topic.

max_killer_payne

  • Guest
Trigger = script continue
« on: 06 Apr 2004, 11:27:57 »
What would I put in my script that would make it continue once a trigger was active, would I put something like this? I want the loop to detect if the trigger has been activated and if it has, I want it to go onto the next phase of the script, but if it hasnt I want the script to keep trying to see if the trigger has been activated.

Code: [Select]
Scripting stuff up here
goto "detect"

#detect
nameoftrigger=true : goto "trigtrue"
nameoftrigger=false : goto "detect"

#trigtrue
Script continued down here

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Trigger = script continue
« Reply #1 on: 06 Apr 2004, 12:03:41 »
Code: [Select]
Scripting stuff up here
goto "detect"

#detect
?mycondition: goto "trigtrue"
~1
goto "detect"

#trigtrue
Script continued down here

in the triggers on activation line you would use mycondition = true
Not all is lost.

max_killer_payne

  • Guest
Re:Trigger = script continue
« Reply #2 on: 06 Apr 2004, 12:51:26 »
Thanks Artak!  ;D

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Trigger = script continue
« Reply #3 on: 06 Apr 2004, 15:50:20 »
uhm...i always thought @ would make a script wait for a condition

scripting stuff here
goto "detect"

#detect
@myvariable

script continues here


tell me if i'm wrong

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Trigger = script continue
« Reply #4 on: 06 Apr 2004, 16:08:10 »
the way I understand it, you are not wrong, but the way artak wrote it will lag less than the way you did, but your method will work also.  I have found loops will cause less lag then the @ does, not sure why tho ;)

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Trigger = script continue
« Reply #5 on: 06 Apr 2004, 16:19:27 »
ah...yes..thats it....thx for it

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Trigger = script continue
« Reply #6 on: 06 Apr 2004, 16:23:57 »
Loops do cause less lag than @ commands.   The reason is that loops only operate as often as you ask them to, say every 0.5s or whatever.   However @ commands are checked every frame.

If it's a small mission, it's not a big deal.  However, if you have  lot going on changing all your @ commands to slower loops can make a difference.
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Trigger = script continue
« Reply #7 on: 06 Apr 2004, 18:07:58 »
Indeed.  :)
Not all is lost.