Home   Help Search Login Register  

Author Topic: "or" doesn't work in a trigger's condition field?  (Read 1147 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
"or" doesn't work in a trigger's condition field?
« on: 28 Oct 2002, 23:49:32 »
For example, let's say I have two boolean variables, var1 and var2.  Let's say I use them in an or statement in a trigger's condition field as follows:

var1 or var2

If I did that, it won't work.  One or both variables can be set to true, but the condition won't be met and the trigger won't activate.

Does anyone else have this problem?  Is there a workaround?
Ranger

sgt.scorpion

  • Guest
Re:"or" doesn't work in a trigger's condition field?
« Reply #1 on: 29 Oct 2002, 07:38:08 »

try var1 || var2

*lines are shift backslash

Bremmer

  • Guest
Re:"or" doesn't work in a trigger's condition field?
« Reply #2 on: 29 Oct 2002, 10:39:49 »
I had the same problem - the solution is thankfully very easy:

Make sure you start off with both var1 and var2 set as false. If one of the variables is undefined the condition will never be true, even if you set the other true. Personally I think this is a flaw in the editor, but everyone else seems to think its fine  :-\

Cheers

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:"or" doesn't work in a trigger's condition field?
« Reply #3 on: 29 Oct 2002, 22:27:26 »
Thank you for your replies, Bremmer and Scorpion.  I'll give them both a try when I"m home later.
Ranger

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:"or" doesn't work in a trigger's condition field?
« Reply #4 on: 29 Oct 2002, 23:07:22 »
Personally I think this is a flaw in the editor, but everyone else seems to think its fine

You should always define all your variables... just good programming practice :)

But yes, it can be a pain in the arse sometimes ;D