Breaking the thread will make the bot to finish that thread and this suppose to be a loop thread...Actualy, I'm very confused

...The "while" statement suppose to check for the condition every time (dunno..

)...Actualy, I'm uderstanding that "if" check for that condition one time and make the choice, no look behind

"while", for instance, suppose to ALWAYS check for the condition, right?
I discovered that doing this example:
In a certain moment, cit3 ( it's a third guy) do this:
if((level.busychair[chair2] == 1) && (isalive self))
{
self turnto $lightpost1_aim
wait 1
waitthread lightpost1
}
self anim atease
self waittill animdone
end
That means that, while chair2 is occuppied, cit3 will play the lightpost thread, if not play an atease anim. Now the lightpost thread:
lightpost1:
while (level.busychair[chair2] != 0)
{
self anim scientist_wallchart_depressed_sci2
wait 1
}
end
A very simple loop!

It's working!!

If I kill cit2, cit3 stops the animation and goes on with the thread!

(probably coz the thread reaches the "}" every 1 sec. and THEN check the condition again...

)
Well,now cit1: He have a very similar part as cit3:
if((level.playcards[cit2] == 1) && (isalive self))
{
iprintln "Citizen 1 is in the game!"
self waitthread playtype_1
}
level.playcards[cit1] = 0
level.busychair[chair1] = 0
self anim chair_curious_stand // STAND UP
self waittill animdone
iprintln "Citizen 1 runs out of money!"
If chair1 is available (and he's alive of course), he will playcards! But now, the difference!!! Check my playtype thread:
playtype_1:
while((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor2_king // GIVE ME YOUR KING
self waittill animdone
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor1_fish // COMMENT GO FISH
self waittill animdone
self anim chair_actor1_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor2_king // GIVE ME YOUR KING
self waittill animdone
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
self anim chair_actor1_idleloop // MAIN LOOP
self waittill animdone
self anim chair_actor1_drawcard // YOU ALWAYS CHEAT
self waittill animdone
}
end
If I join as a player and shoot cit2 in the head (

), cit3 stops imediatly his animation and goes on w/ his life ( cool!)...but cit1 insists on keep playing cards w/ that dead body on the floor.

...gr...

( probably coz the thread will reach the "}" ONLY AFTER doing the whole animations!

)
So I did this monster:
playtype_1:
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_king // GIVE ME YOUR KING
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor1_fish // COMMENT GO FISH
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor1_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_king // GIVE ME YOUR KING
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor2_drawcard // PICK UP A CARD
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor1_idleloop // MAIN LOOP
self waittill animdone
}
if((level.busychair[chair2] == 1) && (isalive self))
{
self anim chair_actor1_drawcard // YOU ALWAYS CHEAT
self waittill animdone
}
end
That was the only way out of the problem! I must say, it's working, but it's funny how "while" do not check if the chair was available or not...Once it started the sequence of animations, it was going on 'til the end...
Anyway, the big problem: the waiting animation!

I'm using a thread as a counter :
counter_15min:
iprintln "Timeout Started!"
wait 15
level.timeout = 1
iprintln "Time is over!"
end
Very crappy, I know

, but works!
And the d*** waiting thread ( cit1):
waitcardsloop1: // I had to add the #1 to the label
//level.timeout = 0
thread counter_15min // starts the counter
while ((level.timeout != 1) || (level.busychair[chair2] != 1)) //d*** line
{
self anim chair_waiting_idleloop_nocards
self waittill animdone
}
end
I Tryed:
while (level.timeout != 1 || level.busychair[chair2] != 1)
while ((level.timeout == 0) || (level.busychair[chair2] == 0))
while (level.timeout == 0 || level.busychair[chair2] == 0)
and other options I can't remember now

Don't work!!
But when I try only one of the conditions, it work! Like:
while (level.busychair[chair2] !=1)
while (level.timeout == 0)
Both works!!!

So my timer system works and the busy chair check works also... "||" is indeed OR...There's another "bitwise or" which is "|"...tryed and nothing... buaaaa...
What am I doing wrong
