Page 1 of 1

Bad Script

Posted: Sun Sep 16, 2007 4:10 pm
by ThePunisher06112
I got this map BA_Stalingrad but after the bombs explode its suppose to
restart the game and it doesn't can you please help .

Here is the script.

// BA_stalingradobj
// ARCHITECTURE: Additions by seere
// SCRIPTING: seere

main:

setcvar "g_obj_alliedtext1" "- Destroy the Control"
setcvar "g_obj_alliedtext2" "Room"
setcvar "g_obj_alliedtext3" "- Destroy V2 Rocket"

setcvar "g_obj_axistext1" "- Defend the Control"
setcvar "g_obj_axistext2" " Room and the V2"
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "textures/mohmenu/objloading/BA_stalingradobj.jpg"

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

//***Flyby Planes
exec global/bomber.scr
//thread flyby

//***Ambient sounds
level.script = maps/obj/BA_stalingradobj.scr
exec global/ambient.scr obj_team1

exec global/door_locked.scr::lock
thread global/exploder.scr::main
//thread global/barrel.scr::explosive_barrel

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

// set the parameters for round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

level waittill roundstart

thread flyby
$panel_bomb thread global/obj_dm.scr::bomb_thinker
$panel1_bomb thread global/obj_dm.scr::bomb_thinker

thread allies_win_bomb
$v2_explode thread axis_win_timer

// thread objectives_setup
end


allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

flyby:

//***random flyby of plane
wait 1.0
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(180) + 60)

goto flyby

//Display objectives
//objectives_setup:
//
// waitthread global/objectives.scr::blank_objectives
// waitthread global/objectives.scr::add_objectives 1 2 "Destroy the V2 rocket and the Launch Control Room" //$v2_bomb.origin
// wait 2
// waitthread global/objectives.scr::current_objectives 1

//end

Posted: Mon Sep 17, 2007 2:08 am
by bdbodger
It maybe that after a restart the scirpt starts executing after level waittill spawn so every thread started before that does not get rerun .

level.targets_destroyed

Posted: Mon Sep 17, 2007 3:19 am
by tltrude
Maybe you need to add "level.targets_destroyed = 0" to the preset variable list.

Posted: Mon Sep 17, 2007 6:38 am
by wacko
Seere's ( :wink: ) script is a perfect copy of the stock V2 script (obj_team2), so this is fine and working.
Check, whether V2 is working for you!
If V2 doesn't work either, there once again might be custom pk3s in your main which spoil the fun.
If V2 does work, open up its map file in radiant and compare it to yours.