Home   Help Search Login Register  

Author Topic: COnditions and triggers  (Read 728 times)

0 Members and 2 Guests are viewing this topic.

Knight_Sky

  • Guest
COnditions and triggers
« on: 31 Jan 2003, 17:52:09 »
Is it possible to put more then one condition in a trigger ive tried seperating them with ";" but to no avail? Any ideas?
Also if i put a condition in  a trigger as soon as the condition is met the trigger activates regardless of if ive only set it to activate if a certain unit is present , any ideas with that?
Cheers
KS

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:COnditions and triggers
« Reply #1 on: 31 Jan 2003, 18:10:41 »
question 1: yes it is

you can combine conditions by using the feature called: AND

e.g: this AND not (alive whoever)

question 2: seems you didn't setup the trigger's condition
to be met by only a certain unit then.
More info would be required to give you a definitely answer
onto that.

Just a few tips here:

variant a: unit in thislist
as a condition

or

variant b: group (F2 + drag a line from unit to trigger) the trigger with the unit, so that only this unit can activate the
trigger.

~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

Knight_Sky

  • Guest
Re:COnditions and triggers
« Reply #2 on: 01 Feb 2003, 11:39:25 »
The trigger is allready grouped with the unit, if there is no condition the trigger will only activate if the unit is present. To show you what i mean here is the context.

The mission has an element of yur clichéd hostage rescue.
I want the hostages to be freed, ie stop there surrender stance and join the group.

Here is what i have done
I have set a trigger so that when all of east are gona within a certain area, a variable i have called eastgone becomes true. I have set another trigger grouped with the players unit, so that when the unit gets within 5 metres of the prisoner AND all the east are dead, the prisoners join the group and are effectively freed.

Here is the problem.
The trigger to free the hostages activates as soon as eastgone become true regardless of weather the unit is an where near them.

Any ideas?

Knight Sky

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:COnditions and triggers
« Reply #3 on: 01 Feb 2003, 12:40:54 »
Welcome to the forums, Knight_Sky

Try this one:

Trigger

Radius: Covering all East units
Condition: East not present
Condition Field: this and (player distance hostage < 5)
OnActivation: hostage switchmove "null"; [ hostage ] join (group player)

That trigger will go off when there is no east inside it's area, and when the player is less than 5m from hostage. hostage will then get out of the surrender pose, and join the player's group.

Hope that helps you out ;)

Knight_Sky

  • Guest
Re:COnditions and triggers
« Reply #4 on: 01 Feb 2003, 14:15:11 »
That is perfec! thanks alot!
Cheers
KS

Kojak

  • Guest
Re:COnditions and triggers
« Reply #5 on: 02 Feb 2003, 15:13:40 »
Sorry for breaking in like this in a finished topic, but I have a similar problem:

I want to use a (sort of) random event to make things happen - if west squad A destroys east squad 1 some west choppers will move in, if east squad 1 instead destroys west squad A some russian tanks will come rolling instead.

I tried this with using variables and the OR command, but nothing really happened, no matter what event should take place, and the combat between the two squads has a 50-50 chance for either event. So, what am I doing wrong?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:COnditions and triggers
« Reply #6 on: 02 Feb 2003, 18:12:44 »
hmmmm ... doesn't sound like you're doing anything toooooo badly wrong.  I use hints to help me sort out problems like this - when a variable is set, or a trigger fired, a hint pops up.

Anyway, try this

in init.sqs put this

westwin=false
eastwin=false

Now you need two triggers


TriggerWest
synchro with a hold waypoint for the west choppers
type switch
condition: (not eastwin) and (count units East1 ==0)
on activation:   westwin=true


TriggerEast
synchro with a hold waypoint for the east tanks
type switch
condition: (not westwin) and (count units WestA ==0)
on activation:   eastwin=true

Syntax not guaranteed but you get the picture.    Once one trigger has been fired the other one cannot be fired.  

You have to define the variables in init.sqs otherwise:   if OFP finds a variable that has not previously been defined it assumes that the whole expression is false (I think).

Hope that helps!


Plenty of reviewed ArmA missions for you to play

Kojak

  • Guest
Re:COnditions and triggers
« Reply #7 on: 02 Feb 2003, 20:20:15 »
Thanks, I'll try that!