Home   Help Search Login Register  

Author Topic: Trigger condition problem..  (Read 1061 times)

0 Members and 1 Guest are viewing this topic.

Offline NoMore

  • Members
  • *
  • Location: Denmark
Trigger condition problem..
« on: 04 Dec 2009, 08:36:32 »
Ok here is my problem:
I have two triggers and one of them has the condition field:
Code: [Select]
this && not(GrpSpot)And activation:
Code: [Select]
secondOBJ=true
The second trigger has the codition:
Code: [Select]
this && not(secondOBJ)And activation
Code: [Select]
GrpSpot=true
I'm very unsure of the "&& not(GrpSpot)" parts of the conditions...
But what am I doing wrong?  :dry:

And any suggestions for a subject name..?
"He who stands with me shall be my brother." - Warhammer 40k: Dawn of War

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Trigger condition problem..
« Reply #1 on: 04 Dec 2009, 14:33:20 »
The syntax looks okay to me, although you probably need to initialise the variables GrpSpot and secondObj as false in your init.sqs for the triggers to work properly.

You could also write the trigger condition without brackets as

Code: [Select]
this && not GrpSpotor
Code: [Select]
this && !GrpSpot
What exactly isn't working about it?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Trigger condition problem..
« Reply #2 on: 08 Dec 2009, 21:50:50 »
You might find it easier to read if you used and instead of &&:

this and not GrpSpot.

My guess is bedges as has it right.  You need to initialise the varaiables first.  Any condition that includes an undefined varaible will return a False

So the condition in both:

If undefined_variable then {...}
and
If not undefined_variable then {...}

Will return false and the neither block of code will be run.




Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Trigger condition problem..
« Reply #3 on: 06 Jan 2010, 16:21:25 »
You don't need the 'this' part in the condition unless someone will actually be walking into the trigger and activiating it.
If that is the case then ignore me. However, if its just the case of having a trigger on the side to check a variable condition and running some code after it becomes true; you do not need the 'this' part.

So the two conditions would just be:

not(GrpSpot)

and

not(secondOBJ)

I know I probably bumped this but I'm pretty sure that is the problem if you are using the trigger for what I said.