Home   Help Search Login Register  

Author Topic: Trigger activation  (Read 578 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Trigger activation
« on: 27 Jul 2005, 13:11:22 »
Hi all,

I've got a annoying problem with triggers activating triggers. I tried seaching and searching, but, 'no results found'. Again.   ::)
I know its been mentioned somewhere, but I can't find anything here, so sorry for bringing it up.

Anyway, heres what I have:

Code: [Select]
Trigger 1:
Name trig1
Condition: this
Activation: guy1 setbehaviour "SAFE"; trig1=true

Trigger 2:
Name trig2
Condition: this
Activation: guy2 setbehaviour "SAFE"; trig2=true

Trigger 3:
Name trig3
Condition: this
Activation: guy3 setbehaviour "SAFE"; trig3=true

And it goes on like that up to trigger 6

I wanted another trigger to activate when they've all activated, so I have in it:

Code: [Select]
Trigger 7:
Name trig7
Condition: trig1 AND trig2 AND trig3 etc...
Activation: a1 sidechat "blah"

But I get a boolian error

I've also tried:

Code: [Select]
Trigger 7:
Name trig7
Condition: trig1 && trig2 && trig3 etc...
Activation:

and

Code: [Select]
Trigger 7:
Name trig7
Condition: trig1=true && trig2=true && tig3=true && etc...
Activation:

Anyone know how to get this to work?

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

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Trigger activation
« Reply #1 on: 27 Jul 2005, 13:25:26 »
Your method and syntax in the six first triggers is correct, and the two first ways of trigger #7 are correct. The last example of trigger #7 however, is incorrect, but I guess you sort of knew that already and just tried it when everything else failed.

So, to sum it up, I have no idea what the problem is. Are you sure all of the triggers are activating? Try adding a hint to each trigger hint "trig1 activated. go activate the next one"

Also, could you post the error message here. It might say a lot.
Not all is lost.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Trigger activation
« Reply #2 on: 27 Jul 2005, 13:34:19 »
I have an idea what's wrong ;)

Compare the names of your triggers to the booleans you are
using. Then you will see that you use each name as a boolean
and as an object name.

Solution; simply remove the triggernames - you don't need a
trigger named, unless you want setpos the trigger later or
you want to refer to it's trigger-list.

~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

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Trigger activation
« Reply #3 on: 27 Jul 2005, 13:35:35 »
I've made sure the triggers are activating, and their activating fine.

The error is one of the ones in the top left corner when gameplay starts. It says:

Code: [Select]
trig1 AND trig2 AND|#| trig3: Error and: Type Object, expected Bool
« Last Edit: 27 Jul 2005, 13:40:09 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Trigger activation
« Reply #4 on: 27 Jul 2005, 13:47:34 »
Doh! Obviously. Chris is right, and that's exactly what the error message is referring to - the trigX variable's aren't boolean, but indeed they are the trigger objects.

Way to go eagle-eye Chris.  ;)
Not all is lost.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Trigger activation
« Reply #5 on: 27 Jul 2005, 14:25:33 »
Thanks for the help so far  ;)

So how would I fix it?
All the triggers have the same sort of thing in them.
guy1 setunitpos "DOWN"
doStop guy1
guy1 dotarget tank1

Would I have to remove these commands?

@Chris Death
I don't understand. If I remove the trigger names, how will the 7th trigger know which ones been activated?  :-\
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Trigger activation
« Reply #6 on: 27 Jul 2005, 14:38:59 »
Quote
I don't understand. If I remove the trigger names, how will the 7th trigger know which ones been activated

Because you say: trig1 = true
and the 7th trigger is waiting for trig1.

Once trig1 = true, the 7th trigger isn't waiting for this anymore.

A trigger is an object, if you give a trigger a name like trig1
then trig1 is an object name. An object cannot be true or false,
it can be an object.

Now if you say trig1 = true, then nothing happens, because: read the lines above.

Furthermore the condition trig1 AND trig2 AND blablabla
will check if trig1 is true, but it realizes that trig1 is already the
name of the trigger (= object) and thus it says:

error type object, expected bool

And; no you don't need to remove any commands from your triggers, nor do you need to remove the triggers - just delete
the text, which you wrote into the trigger's name field.

~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

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Trigger activation
« Reply #7 on: 27 Jul 2005, 14:47:41 »
Ah, that makes more sense

Deleted the names, now it works  ;D

Thanks guys for the help  :thumbsup:
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB