Home   Help Search Login Register  

Author Topic: Simple trigger question  (Read 636 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Simple trigger question
« on: 18 Feb 2005, 10:38:26 »
Hi all,

How do I make a trigger ([player] join group man) only activate if another trigger has been activated.
Like, a trigger that activates only when the player is within its area, and has completed the last trigger.  ;)

Thanks
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Simple trigger question
« Reply #1 on: 18 Feb 2005, 10:48:03 »
When the first trigger fires you set a variable to true.

Then use that variable in the condition field in the second trigger. For example...

Condition: This AND myVariable

Instead of just

Condition: This
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple trigger question
« Reply #2 on: 18 Feb 2005, 10:48:10 »
Use variables to communicate between triggers.   For example:-

Trigger1
Activation:  as you like
On activation:   trig1=true; blah blah

Trigger2
Activation:   trig1 and (blahdy blah)

Trigger2 can fire only if trigger 1 has already fired.
Plenty of reviewed ArmA missions for you to play

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Simple trigger question
« Reply #3 on: 18 Feb 2005, 11:35:14 »
Hmmm.....I must be doing this wrong. This is what I have:

Code: [Select]
Trigger 1

Name: trig1
Radio alpha
Activation: trig1= true; a1 sidechat "blah"
Condition: this

Trigger 2

Name: trig2
West present
Activation: guy setdamage 1
Condition: trig1=true and this

But its not working. How do I fix it?  :-[
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

StonedSoldier

  • Guest
Re:Simple trigger question
« Reply #4 on: 18 Feb 2005, 12:46:05 »
Code: [Select]
Name: trig2
West present
Activation: guy setdamage 1
Condition: trig1=true and this

should be

Code: [Select]
Name: trig2
West present
Activation: guy setdamage 1
Condition: trig1 and this

when using a bool as a condition you only need to put the varible name and not bool1=true

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple trigger question
« Reply #5 on: 18 Feb 2005, 12:53:56 »
In OFP code,

= means "set one thing equal to another"

== means "check and see if these two things are the same"

Except with booleans you don't need the ==, you just need the variable name as StonedSoldier right says.

It's all in the comref.
Plenty of reviewed ArmA missions for you to play

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Simple trigger question
« Reply #6 on: 18 Feb 2005, 13:10:03 »
OK, corrected it as Stoned Soldier said, but it still doesn't work. I got this error when I started the mission:

Code: [Select]
'trig1 and this |#|': Error and: Type Object, expected Bool
And then the trigger didn't work at all. Either of them  :-[
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple trigger question
« Reply #7 on: 18 Feb 2005, 17:18:34 »
You are using trig1 as the name for a trigger and also the name of a variable.  Try the following:

Trigger 1

Name: (leave blank)
Radio alpha
Activation: trig1= true; a1 sidechat "blah"
Condition: this

trig1 is now a variable.  Note it is good practice to set trig1 = false at the start of the mission.  It will have no effect here, but if later you want another trigger to fire on:

this and not trig1

then failing to initialise trig1 will cause a problem.

Trigger 2

Name: (leave blank)
West present
Activation: guy setdamage 1
Condition: trig1 and this

You only need to give triggers names if you want to access them in someway from somewhere else - for example if you want to move them or get a list of the units that triggered them.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Simple trigger question
« Reply #8 on: 19 Feb 2005, 09:01:32 »
OK, thanks  ;D
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Infierie Blou

  • Members
  • *
  • Keep your friends close but your enemies closer
Re:Simple trigger question
« Reply #9 on: 19 Feb 2005, 14:34:38 »
No no no it's
Code:
Trigger 1

Name: trig1
Radio alpha
Activation: trig1= true; a1 sidechat "blah"
Condition: this

Trigger 2

Name: trig2
West present
Activation: guy setdamage 1
Condition: this && trig1=true
« Last Edit: 19 Feb 2005, 14:39:08 by inblow »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Simple trigger question
« Reply #10 on: 19 Feb 2005, 14:38:54 »
inblow, what are you trying to say?   I think you may have posted the original, wrong, code.
Plenty of reviewed ArmA missions for you to play

Offline Infierie Blou

  • Members
  • *
  • Keep your friends close but your enemies closer
Re:Simple trigger question
« Reply #11 on: 19 Feb 2005, 14:41:56 »
all i'm trying to say is that AND is replaced by &&
well thats what i do && always work with me

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple trigger question
« Reply #12 on: 19 Feb 2005, 16:01:42 »
and is easier to understand than &&
or is easier to understand than ||
not is easier to understand than !

But they all work!

You are still suggesting that the triggers are given names and that these names match the names of variables - it will never work.
« Last Edit: 19 Feb 2005, 16:02:10 by THobson »