how to find if someone is dead

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
UBER_SOLDAT
Warrant Officer
Posts: 127
Joined: Wed Aug 07, 2002 7:44 pm
Location: ENGLAND
Contact:

how to find if someone is dead

Post 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.
UBER_SOLDAT
Warrant Officer
Posts: 127
Joined: Wed Aug 07, 2002 7:44 pm
Location: ENGLAND
Contact:

Post 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....
}
Mirek
Colour Sergeant
Posts: 77
Joined: Mon Jul 08, 2002 2:12 am
Location: Melbourne, Australia
Contact:

Post 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
Mapping !!! Who needs sleep anyway !?!?!?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bomb1

Post 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.
Tom Trude,

Image
Post Reply