Can a trigger_multiple's health be checked/printed
Posted: Sun Jan 25, 2004 3:43 am
I am trying to make the health of a trigger_multiple an objective, and print it's health on the screen as it goes down. But, it is not going so good because I don't know how to check the trigger's health. The trigger in the map is targetnamed "missle_ex_trigger" and has a health of 4000 (for now) and projectiles set. Any help would be great!
Code: Select all
level waittill prespawn
level.controlling_team = "neutral" //do not change
level.allies_points = 0
level.axis_points = 0
level.missle_health = 4000
level.win_points = 60 // team that gets to this number first wins.
//--------------------------------------
// objective threads
//--------------------------------------
silodoor_waittill_capture:
while ( $silodoor_trigger )
{
$silodoor_trigger waittill trigger
local.player = parm.other
if (local.player.dmteam == level.controlling_team) //prevents pressing the trigger again
{
goto silodoor_waittill_capture
}
else
if (local.player.dmteam == "allies")
{
if (level.silodoors == 0) // if silo doors are closed
{
waitthread silodoors_open
thread check_points
}
println "Missile launch is on hold!"
level.controlling_team = local.player.dmteam
}
else
if (local.player.dmteam == "axis")
{
if (level.silodoors == 1) // if silo doors are open
{
waitthread silodoors_close
thread check_points
}
println "Missle Launch countdown is running!"
level.controlling_team = local.player.dmteam
}
waitframe // protection
}
end
//***********************************************
// active scoreboard
//***********************************************
announce_points:
wait .9
locprint level.subtitleX level.subtitleY ("Countdown: "+ level.axis_points + "\n" + "Missile health: "+ level.missle_health)
goto announce_points
end
//----------------------------------------------------------->
//Award points
//----------------------------------------------------------->
check_points:
wait 1
if ((level.missle.dead != 1) && ( level.missle_health <= level.win_points))
{
level.missle_health = ($missle_ex_trigger.health)
thread check_win
goto check_points
}
else
if ((level.silodoors == 0)) && (level.axis_points <= level.win_points))
{
level.axis_points = level.axis_points + 1
thread check_win
goto check_points
}
end
//***********************************************
// winning team
//***********************************************
check_win:
if (level.axis_points == level.win_points)
{
teamwin axis
}
else
if (level.missle_health == 0)
{
teamwin allies
}
wait 10
end