Jump to content
Sign in to follow this  
xx-Cougar-xx

Trigger/Conditon Logic not working

Recommended Posts

I have followed the Merciles, refrence guide, and searched this forum for the answer as well. I made a simple CTF, swapping textures for the flags much like the guide.

I have 4 triggers, 2 to set vars, one is for east one for west, true if the are near the flag, set back to false if not.

1st Trig

On Act: alpha_w = true;

On dea: alpha_w =false;

2nd

On Act: alpha_e = true;

On Dea: alpha_e =false;

Now when it comes to the 3rd trigger if i just make the condition:

alpha_w

and i am in the area all is fine, but this would not work if both teams were in the flag area, and as the guide says i tried:

alpha_w and not alpha_e;

didn't work

I also tried:

!(alpha_w && alpha_e);

alpha_w && !(alpha_e);

and a few others....

what gives ? why can I only check the one Bool, as soon as I start to put some logic to it it doesn't work.

Thnx in Advance

Share this post


Link to post
Share on other sites

Try defining your variables in an init field or init script (they must be initially set to false).

Share this post


Link to post
Share on other sites

thanks, I didn't know sq* was more of a strong typed Lang, yesterday was first day working with it, from guide you think it is more like php where you can just have var's all over.

Share this post


Link to post
Share on other sites
Quote[/b] ]Try defining your variables in an init field or init script (they must be initially set to false).

Not completely true. Boolean variables doesn't need to be initialized, since a non-existing variable can't be "true", therefor it will be handled as "false".

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

(alpha_w) && (! Alpha_e)

might work.

Myke out

Share this post


Link to post
Share on other sites
Quote[/b] ]Try defining your variables in an init field or init script (they must be initially set to false).

Not completely true. Boolean variables doesn't need to be initialized, since a non-existing variable can't be "true", therefor it will be handled as "false".

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

(alpha_w) && (! Alpha_e)

might work.

Myke out

Actually no, any variable that hasn't been defined is a scalar bool array string 0xe0ffffef, thus it's not even a boolean and is not false, even though it's not true either. If you haven't defined the variable the game doesn't know what kind of variable it is, that's why you have to initialize a boolean sometimes.

Share this post


Link to post
Share on other sites
Quote[/b] ]Try defining your variables in an init field or init script (they must be initially set to false).

Not completely true. Boolean variables doesn't need to be initialized, since a non-existing variable can't be "true", therefor it will be handled as "false".

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

(alpha_w) && (! Alpha_e)

might work.

Myke out

I tried to test the logic for that and it didn't work, I did have to set them both to false in order for it to work the way i wanted

Share this post


Link to post
Share on other sites

What are the conditions for the 1st and 2nd trigger? And are they repeating?

--Ben

Share this post


Link to post
Share on other sites

Just to clear things up, the condition '!SomeVariable' won't be true unless SomeVariable has a value of false. SomeVariable will not have a false value unless you define it so with 'SomeVariable = false'. The only way to define a variable as a boolean is to set it to either true or false.

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  

×