Home   Help Search Login Register  

Author Topic: refering to a trigger's name to know if it's been activated?  (Read 959 times)

0 Members and 1 Guest are viewing this topic.

wastzzz

  • Guest
is there a way to catch the boolean value that sets up when a trigger gets activated (assuming the trigger has got a name)?
i have a trigger named "trg1" with condition set on True, countdown 5 secs; then i have another trigger named "trg2".
i would like to activate trg2 when trg1 activates, but setting trg2's condition to "trg1" doesn't work.
i know how to do it in other ways, but i was wondering if i could get this one to work as well.

cheers,
wast

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: refering to a trigger's name to know if it's been activated?
« Reply #1 on: 30 Aug 2006, 08:47:03 »
Rather than trying to access the trigger directly in this way it is more normal to create your own boolean that is set when the first trigger fires by putting something like:
trig1Fired = true
in the on Activation field of the first trigger.  Note: trig1Fired is any name you wish to give it.

When using booleans in this way it is very good practice to initialsie their values at the start of the mission.  For example in init.sqs put:
trig1Fired = false

The reason for this is that any boolean expression that makes use of an undefined variable will always resolve to false.

So in your case if you wanted to allow something to happen if the first trigger had not fired then you might use:
not trig1Fired

but if trig1Fired is undefined then both trig1Fired  and not trig1Fired will be false!

wastzzz

  • Guest
Re: refering to a trigger's name to know if it's been activated?
« Reply #2 on: 30 Aug 2006, 10:55:00 »
ye that was the way i always used to do, but thanks anyway for the quick reply :)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re: refering to a trigger's name to know if it's been activated?
« Reply #3 on: 30 Aug 2006, 15:42:03 »
Well, there's one other way, if you want avoid using booleans;

Place a gamelogic and give it two waypoints
Syncronize the first waypoint with the trigger you want check for it's status
and lead the second wayoint into the second trigger's area
Now group the gamelogic with the second trigger so that it
will activate trigger 2 after trigger 1 let it pass.  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted