Already have the old style barracks and powerplant made, will make them destroyable sometime. The old music plays mapwide as well.
Watching for player death
Moderator: Moderators
Watching for player death
I have been looking for a suitable means on knowing when a player dies. Cannot find this info. My goal is to make a map that does the old 95 C&C game in First Person. Just like Renegade, except with weapons that are more in line with the old game. I want it so EVA says "unit lost" when an allie - or even self dies.
Already have the old style barracks and powerplant made, will make them destroyable sometime. The old music plays mapwide as well.
Already have the old style barracks and powerplant made, will make them destroyable sometime. The old music plays mapwide as well.
death animation/sound?
What you say could be possible, but would require altering original game files. I still want it to fit inside the pk3. Besides, if I did that, I would override pain sounds in the process.
What I have below actually works, but with issues:
If the player lay dead for more than 6.9 seconds, the report of "Unit Lost" will occur twice. Also, I am uncertian as to how the script will handle multiple dead units.
What I have below actually works, but with issues:
Code: Select all
eva:
if ($player[local.playtm].dmteam == "allies")
{
if ($player[local.playtm].health < 1)
{
$gdi_speaker playsound lost_snd
wait 6.5
}
}
wait .5
goto eva
endI don't think that works I mean you have an undefined local variable local.playtm . This may work
Code: Select all
eva:
while(1)
{
for(local.i=1;local.i <= $player.size;local.i++)
{
if ($player[local.i].isdead == NIL && $player[local.i].dmteam == "allies" && $player[local.i].health < 1)
{
$gdi_speaker playsound lost_snd
$player[local.i].isdead = 1
}
else
{
if ($player[local.i].isdead == 1 && $player[local.i].health >= 1)
$player[local.i].isdead = NIL
}
}
waitframe
}
end
I don't think that works I mean you have an undefined local variable local.playtm . This may work
Code: Select all
eva:
while(1)
{
for(local.i=1;local.i <= $player.size;local.i++)
{
if ($player[local.i].isdead == NIL && $player[local.i].dmteam == "allies" && $player[local.i].health < 1)
{
$gdi_speaker playsound lost_snd
$player[local.i].isdead = 1
}
else
{
if ($player[local.i].isdead == 1 && $player[local.i].health >= 1)
$player[local.i].isdead = NIL
}
}
waitframe
}
end
It did work, although it was flooding the console with error reports every 0.1 seconds.I don't think that works I mean you have an undefined local variable local.playtm .
If the If statement failed then your old code would reapeat every .5 seconds if it succeded then there was a 6.5 second wait . If your playing alone then $player is you . If another player joins it forms an array so you have $player[1] and $player[2] so I assume you where playing alone . If you play from the maplist or by typing map mymap where mymap is the name of your map then your playing in single player not MP . Just some things to think about .Wierdo wrote:It did work, although it was flooding the console with error reports every 0.1 seconds.I don't think that works I mean you have an undefined local variable local.playtm .And the sound effect would repeat every 7 seconds unless I decided to respawn. I tried your method, and it is waaaay better. No errors. No repeats.

