Page 1 of 1

AI isalive question

Posted: Wed Jan 21, 2004 5:11 am
by digitac
Hi i am making a lib mod for AA

now i have the following problem

if i put this in main :

Code: Select all

while ( isalive ($soldier1) )
{
wait 5
}
else
{
thread guards "Allied ( Alex )"
}


my script will not load this also happens when it's in his own thread

can someone tell me what i am doing wrong ?


thnx DigitaC

Posted: Wed Jan 21, 2004 8:45 am
by jv_map
'else' should be preceded with 'if', not with 'while' :wink:

Posted: Wed Jan 21, 2004 10:40 am
by digitac
did that to but still not work

Posted: Wed Jan 21, 2004 1:55 pm
by Angex
It may be better to use this example, depends if you want to continuously check if the character is alive:

Code: Select all

if (isAlive $soldier1) {
    $soldier1 waittill death
}

thread guards "Allied ( Alex )"
Or if you want to repeat certain things untill the character dies you could use something like this:

Code: Select all

while (isAlive $soldier1) {
    // Do something ...

    waitframe // Or use wait 5
}

thread guards "Allied ( Alex )"