Strange OBJ problem, works once in server then not at all
Posted: Mon Mar 08, 2004 2:00 am
I'm posting this here because I believe this is a script problem and I had to do some unusual scripting for the objectives, but here's the relevant pieces of my script:
The level.docind variable in there is because of some unusual scripting I had to do to make the v2 explode correctly and be non-solid at the same time. Regardless, for the first round all the objectives work smoothly. The v2 explodes correctly, whether the documents are found first or not (that's what the docind is for). But starting with the second round, the objectives simply do not work. I can trigger neither the documents nor the v2 bomb. Keep in mind that this only happens on servers with waittill roundstart not commented out. When I test it alone with that line commented out, it works fine. I'm at a loss, if you guys need any more info just let me know. Thanks in advance.
Code: Select all
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "- Destroy the V2"
setcvar "g_obj_alliedtext2" "Rocket, Steal"
setcvar "g_obj_alliedtext3" "the Manuscript"
setcvar "g_obj_axistext1" "- Defend the"
setcvar "g_obj_axistext2" "Complex"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"
local.master = spawn ScriptMaster
local.master aliascache doc_pickup_snd sound/items/Item_PaperPU_02.wav soundparms 1.0 0.0 1.0 0.0 100 2000 item loaded maps "m dm moh obj "
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/obj/CrimsonTwilight.scr
exec global/ambient.scr CrimsonTwilight
$world farplane_color "0.752941 0.752941 0.752941"
level.fogplane = 10000
$world farplane level.fogplane
exec global/door_locked.scr::lock
thread global/exploder.scr::main
$lab_elevator notsolid
$lab_elevator moveDown 64
$lab_elevator moveNorth 272
$lab_elevator waitmove
$lab_elevator solid
thread g_elevator_prep
thread lab_elevator_prep
thread lab_tableflip_standby
thread gdoor_prep
thread roof_door_prep
thread trapdoor_mover
thread trapdoor2_mover
thread lightswitch_prep
thread window_door_prep
thread chalkboard1
thread chalkboard2
thread boiler
thread warehouse_elevator_prep
thread safe_standby
thread safe_table
level waittill spawn
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 2
level.bomb_damage = 200
level.bomb_explosion_radius = 2048
level.dmrespawning = 0
level.dmroundlimit = 4
level.clockside = axis
level waittill roundstart
thread document_check
thread explosion_checker
$v2_bomb thread global/obj_dm.scr::bomb_thinker
thread allies_win_bomb $v2_bomb
$v2_bomb thread axis_win_timer
end
//----------------------
// Document Check
//----------------------
document_check:
level.docind = 0
while(1)
{
$documents_trigger waittill trigger
if(parm.other.dmteam == allies)
{
$documents playsound doc_pickup_snd
$documents hide
iprintln "The Manuscript has been stolen"
level.docind = 1
level.targets_destroyed++
break
}
waitframe
}
end
//-------------------------------
// Explosion Checker
//-------------------------------
explosion_checker:
while(1)
{
if (level.targets_destroyed == 1 && level.docind != 1)
{
$v2 hide
break
}
if (level.targets_destroyed == 2)
{
$v2 hide
break
}
waitframe
}
end
//-----------------------
// Allies Victory Test
//-----------------------
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
{
// chill out
waitframe
}
// No objectives left allies win
teamwin allies
end
//-----------------------
// Axis Victory Test
//-----------------------
axis_win_timer:
level waittill axiswin
end