Home   Help Search Login Register  

Author Topic: Help with triggers  (Read 1284 times)

0 Members and 1 Guest are viewing this topic.

Manti

  • Guest
Help with triggers
« on: 02 Jun 2003, 22:16:16 »
Hi, colud someone help me w/ this situation plz:

I'm developing a Multiplayer COOP mission and during that mission the Squad (after killing all east soldiers) is given the choice to stay in that area for the night (and continue after the night has passed) or to leave the area in 2 minutes to continue with the actual time...

a) I have a trigger in that area that "triggers" when East is NOT present and on the "on Activation" field I have written "Choice = TRUE";

b) I then created a 2nd trigger w/ "Choice" in the condition field and ACTIVATED by West w/ TIMEOUT = 120 secs.

This was done with the intension to the 2nd trigger only be activated if "Choice was true and WEST was present for ALL the 120secs.

However it seams that the 2nd trigger TRIGGERS no matter if WEST is there or not...I' tried leaving the area in less than 120secs but it allways triggers...

Am I doing something wrong???  :-\


Thanks in advance.  :)

hurlothrumbo

  • Guest
Re:Help with triggers
« Reply #1 on: 03 Jun 2003, 06:19:33 »
Yes.  The timer only means that once activated, the trigger will fire after 120s delay.  You'll have to fiddle around a bit more to get it to check time.  Sorry my brain has gone to sleep so I cant help more :(

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Help with triggers
« Reply #2 on: 03 Jun 2003, 21:23:36 »
I think this is best solved with a script.

1. Delete your current trigger and create a new one that simply checks for the presence of West.  Give it the appropriate area.

2. Give your trigger a name.  I'll use trigger1 for my example.

3. Create a script.  I'll name mine, PresentWest.sqs.

4. In the script, put the following code:

Code: [Select]
; Check if Choice = true and if there are 1 or more West units in the trigger's area.

@Choice and count (this list) > 0

; Wait for 120 seconds.

~120

; Check if any West units are still in the area.  If not, exit the script.

? count (list trigger1) < 1 : exit

; Advance time by some number of hours to get daylight.
; Change the 2.5 to whatever you need.

skipTime 2.5

exit

As an option, you can loop the script back to the top if you want to allow the players to change their minds and go back within the area to skip the time to daylight.

Good luck!
Ranger

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Help with triggers
« Reply #3 on: 03 Jun 2003, 21:31:56 »
Whoops.  I forgot to tell you what to do with the script.

In your trigger that activates when all East units are not present, add the following code:

[] exec "PresentWest.sqs"

Since you already have the Choice = true, the On Activation field would be as follows:

Choice = true; [] exec "PresentWest.sqs"
Ranger

Manti

  • Guest
Re:Help with triggers
« Reply #4 on: 04 Jun 2003, 00:55:10 »
Ok Ranger,


Thanx for your help.  Cheers!  :)


See U  8)