OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?
-
try var1 || var2
*lines are shift backslash
-
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
-
Thank you for your replies, Bremmer and Scorpion. I'll give them both a try when I"m home later.
-
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