Home   Help Search Login Register  

Author Topic: Enabling a trigger at a given time.  (Read 1158 times)

0 Members and 1 Guest are viewing this topic.

Offline James Spence

  • Members
  • *
Enabling a trigger at a given time.
« on: 13 Sep 2008, 16:41:18 »
I've searched all over OFPEC and can't find the exact answer to what I'm looking for, it is probably an easy question.

In my mission, you play a sniper and must blow up a convoy then escape back on your own territory. I've made an "end" trigger at the safe zone, where the player must go after he's blown up the convoy. But I have a problem of people possibly running into that trigger before completing their objectives first.

I have a "not present" trigger for the convoy which is fine. How do I make it so that the "end" trigger can only be used after the convoy is destroyed?

Thanks.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Enabling a trigger at a given time.
« Reply #1 on: 13 Sep 2008, 17:58:27 »
You must add to the trigger a condition for all the convoy being dead. Say your convoy vehicles are called c1,c2,c3,c4 then you would add the following to your end trigger condition &&:
Code: [Select]
({alive _x} count [c1, c2 ,c3, c4]) == 0)This will only be true if all vehicles are destroyed. Just remember that sometimes a vehicle can look dead, but not be with canMove being false. You should really put this condition in its own trigger so that you can display a message letting the player know the obj has been completed. In this trigger the following should be in the OnActivation:
Code: [Select]
ConvoyDestroyed = True; hint "You have destroyed the convoy";Then to your end trigger add &&:
Code: [Select]
ConvoyDestroyedFinally, for good measure, add the following line to your init.sqs:
Code: [Select]
ConvoyDestroyed = False;
« Last Edit: 13 Sep 2008, 19:11:39 by Mr.Peanut »
urp!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: Enabling a trigger at a given time.
« Reply #2 on: 02 Oct 2008, 10:40:02 »
Hi, here's what I do to activate a trigger at any time. Use what's called a variable.

ok, you have a "not present" trigger for the convoy which is fine.

keep that, but in the "On Activation" Field of the "not present" trigger type this:

Code: [Select]
Convoy=true
The word "convoy" is the variable name which tells the game it's ready to be used. 
And well true, activates it.

Now create a trigger in your territory where you want the player to end the mission.

TRIGGER:
Axis A: 50 Axis B: 50
TYPE: End1
CONDITION: Convoy


Remember the variable we created earlier after convoy was destroyed? Yes you can use it to put it in the condition field of a trigger.

Next comes a bit tricky part. After trigger is created. Ensure the trigger is highlighted, then hit "F2"-Group Button, and click on the trigger with your mouse and continue to hold the mouse button and drag it to the player and there should be a blue line going from the trigger to the player.

Then go back to the trigger you draged it from and open it and then where it says "Activation" Click "Group Leader".

See this will make the trigger end only when your player has destroyed the convoy and the variable "Convoy" is activated..

I tried to explain, did it work?


Who's hyped for Arma4, long live Arma!