Jump to content
Sign in to follow this  
Bremmer

Editing problem with @ and ||

Recommended Posts

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

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 sad.gif

Share this post


Link to post
Share on other sites

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

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

</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

</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 tounge.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×