multiple objectives problem (Bjarne)
Posted: Thu Apr 17, 2003 2:01 am
I'm trying to set up 3 objectives, two are exploders and one is a "steal document" obj. So far my first expoder works great and now I'm trying to set up the docs obj but it ain't working. I've looked at Bjarne's tut, but it throws me because he puts in two doc objs. (not your fault I'm a total putz when it comes to scripting, Bjarne). Specifically, the docs aren't even visible so could someone please look at my script and tell me what I've done wrong. Thx.
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1"Blow the fuel farm ""
setcvar "g_obj_alliedtext2"Steal the plans ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1"Protect the fuel farm ""
setcvar "g_obj_axistext2"Secure the plans ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none
level waittill prespawn
//hangar door timing
$hangardoor1 time 4 // travel time in seconds
$hangardoor2 time 4
$hangardoor3 time 4
$hangardoor4 time 4
thread hanger_doors
//stop timing
//***Precache Dm Stuff
exec global/DMprecache.scr
level.script=maps/obj/cust_obj_test.scr
exec global/ambient.scr cust_obj_test
thread global/exploder.scr::main
level waittill spawn
//obj setup
level.defusing_team = "axis" // Axis like the bombs unplanted
level.planting_team = "allies" // Allies will try to plant the bombs
level.targets_to_destroy = 2 // Number of targets in this map
level.bomb_damage = 200 // Default damage of the bomb
level.bomb_explosion_radius = 2048 // Default radius of bomb blast
// Set the parameters for round based match
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
// level waittill roundstart // Comment out this line using '//' before it to be able to set the bomb when alone on the map (
just for testing )
$panel_bomb thread global/obj_dm.scr::bomb_thinker // "panel_bomb" is the targetname set on the bomb in MOHRadiant
thread allies_win_bomb // Start the win check thread for allies
$panel_bomb thread axis_win_timer // Start the win check thread for axis
thread desk_document_check // Start the win check thread for allies
level waittill axiswin // If the end of the match is reached, the Axis win
end // end of main
// Allied victory test
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy) // While undestroyed objectives left
waitframe // chill out
teamwin allies // No objectives left allies win
end
// Axis victory test
axis_win_timer:
level waittill axiswin // At the end Axis win
end // end axis victory test
// Document checks
desk_document_check:
while(1)
{ // As long as 1 equals 1 ( that would be forever ) $documents_trigger waittill trigger // Dont execute past this line until
someone triggers the object
if (parm.other.dmteam == allies)
{ // parm.other is the triggerer ( testing here to ensure only allies can complete the ojective )
$documents hide // Make the document graphix disappear
level.targets_destroyed ++
break // break out of the while loop
}
waitframe // protection against making this thread use too much CPU
}
end // end allied victory test
//------------------------------
// Hanger doors thread
//------------------------------
hanger_doors:
$hangardoor_trigger waittill trigger
$hangardoor_trigger remove
$hangardoor_switch anim turn
$hangardoor_switch playsound alarm_switch
$hangardoor1 loopsound lighthouse_run
$hangardoor4 loopsound lighthouse_run
$hangardoor2 moveWest 336
$hangardoor2 move
$hangardoor3 moveEast 336
$hangardoor3 move
wait 4
$hangardoor2 moveWest 336
$hangardoor2 move
$hangardoor3 moveEast 336
$hangardoor3 move
$hangardoor1 moveWEst 336
$hangardoor1 move
$hangardoor4 moveEast 336
$hangardoor4 waitmove
$hangardoor1 loopsound lighthouse_run wait
$hangardoor4 loopsound lighthouse_run wait
end