Bad Script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
ThePunisher06112
Private
Posts: 3
Joined: Tue Dec 27, 2005 7:52 am
Location: CT.
Contact:

Bad Script

Post 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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

level.targets_destroyed

Post by tltrude »

Maybe you need to add "level.targets_destroyed = 0" to the preset variable list.
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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.
Post Reply