OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ranger on 28 Oct 2002, 23:49:32

Title: "or" doesn't work in a trigger's condition field?
Post by: Ranger 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?
Title: Re:"or" doesn't work in a trigger's condition field?
Post by: sgt.scorpion on 29 Oct 2002, 07:38:08

try var1 || var2

*lines are shift backslash
Title: Re:"or" doesn't work in a trigger's condition field?
Post by: Bremmer 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
Title: Re:"or" doesn't work in a trigger's condition field?
Post by: Ranger 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.
Title: Re:"or" doesn't work in a trigger's condition field?
Post by: Sui 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