Bremmer 0 Posted September 10, 2002 Hello I just came across a problem with the editor, trying to use a combination of @ and OR. If this problem is well known then please forgive me for bringing it up again. Basically the OR in a condition line such as : @ (condition1 or condition2) is not recognised correctly, and is interpreted as an AND instead. Any feedback would be greatly appreciated. Thanks Ian Share this post Link to post Share on other sites
ralphwiggum 6 Posted September 11, 2002 here's what i tried trigger #1: radius=0, Alpha Radio, repeatedly., condition=this, activation=condA=!condA trigger #2: radius=0, Charlie Radio, repeatedly., condition=this, activation=condB=!condB both condA and condB were intialized as false from the beginning. then i wrote a simple script. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#dd gg domove getmarkerpos "jj" @(condA or condB) gg stop true goto "dd" exit <span id='postcolor'> gg=name of a soldier, jj=name of a marker where soldier runs to when i execute this in player initialization field, gg runs across me to the marker position "jj" when i press 0-0-1 or 0-0-3, he stops running. so i think it works... hope this helps Share this post Link to post Share on other sites
Bremmer 0 Posted September 11, 2002 Thanks Ralph Your right! It appears that @ is sensitive to whether the variables are undeclared. The only other time I've needed to declare variables false at the beginning is when checking for a not condition type. ie. cond1 - not declared not cond1 = false cond1 = false I wonder why having some ambiguity in one of the OR terms (by not declaring them) causes the command to fail ? Thanks again Ian Share this post Link to post Share on other sites
suma 8 Posted September 11, 2002 I am sure this has been discussed before (I remmember Kegetys participated in the discussion) - but I am unable to find it (it is likely it was in the periord when topic registration for search database did not work). Share this post Link to post Share on other sites
kegetys 2 Posted September 11, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Bremmer @ Sep. 11 2002,10:01)</td></tr><tr><td id="QUOTE">I wonder why having some ambiguity in one of the OR terms (by not declaring them) causes the command to fail ?<span id='postcolor'> Any statement that uses "uninitialized" variables will never be true. The reason why it mostly only affects OR statement is because with AND, usually all variables in it will have a value. For example, "x AND y" would get triggered when both x and y are already set true, and when they are set to true they both are assigned their first ever variable and they begin to exist. But with "x OR y" doing "x = true" will still leave y as an unexisting variable unless you do "y = false" first, and thats why it will not trigger. "x AND NOT y" would also be affected by this and never would trigger unless you would set y to false first. Share this post Link to post Share on other sites
suma 8 Posted September 11, 2002 See also Command reference, topic Variables. Share this post Link to post Share on other sites
shadow 6 Posted September 11, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Sep. 11 2002,12:17)</td></tr><tr><td id="QUOTE">I am sure this has been discussed before (I remmember Kegetys participated in the discussion) - but I am unable to find it (it is likely it was in the periord when topic registration for search database did not work).<span id='postcolor'> Hehe I remember... You and Kegetys were part of the solution and I was part of the problem Share this post Link to post Share on other sites