Page 1 of 1
how to find if someone is dead
Posted: Sat Aug 31, 2002 12:54 pm
by UBER_SOLDAT
in this obj map im doing, ive got a church, and i'm going to have it like in M4 where you go in those underground tunnels. Im going to have a Gestapo officer in the tunnels, and the allies have to find and kill him. I know you can use if (isAlive $targetname) to see if someone is alive, but how do you find out if hes dead? also, is there a way of having him in a random place, like where the Flak switches places in the Hunt, to make it harder to find him.
Posted: Sat Aug 31, 2002 8:10 pm
by UBER_SOLDAT
i thought about a way i might be able to do it, but im still not sure. Could someone tell me if this will work:
officer_death:
if (isAlive $officer_vip)
{
end
}
else
{
iprintnoloc "The Allies have killed the Officer!"
round winning stuff....
}
Posted: Sun Sep 01, 2002 1:51 am
by Mirek
That should work, it does in SP games.
Another possible way of doing it would be to start a thread at the begginning to put the AI in a waittill death state.
It would work better, I think, as you don't need to add any constant looping to keep checking if he's dead.
it would go something like this:
$officer_vip thread officer_death
officer_death:
self waittill death
iprintnoloc "The Allies have killed the Officer!"
round winning stuff....
end
Again this work in SP games - I don't know about OBJ or DM
Cheers
Mirek
bomb1
Posted: Sun Sep 01, 2002 7:55 am
by tltrude
Wouldn't it work if you just name the officer "$bomb1". The obj_dm script already checks to see if bomb1 is exploded.
For the random location thing, just look at the script for "the Hunt" map. I'm sure it is just a random float type thread.