AI isalive question

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

AI isalive question

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

'else' should be preceded with 'if', not with 'while' :wink:
Image
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post by digitac »

did that to but still not work
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post 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 )"
Post Reply