Multi OBJ's

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
{WSS|P}Velociraptor
Private
Posts: 7
Joined: Sat May 15, 2004 6:24 pm

Multi OBJ's

Post by {WSS|P}Velociraptor »

Hello, I would like to have two bombs in my map and I can oly get one to work at a time.


I HAVE READ THE MULTI OBJ TUTUORIAL


Could some one give a sample script file of what it looks like?



Thankz.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

obj_team2

Post by tltrude »

Here is the script from obj_team2 "V2 Facility". It may be different from the tutorial, as there are different ways of doing it. I have color coded the two bombs.

========================================

// V2 FACILITY
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER

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" "objdm2"

level waittill prespawn

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

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

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

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

level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
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


$v2_explode thread global/obj_dm.scr::bomb_thinker
$ctrlroom_explode thread global/obj_dm.scr::bomb_thinker

thread allies_win_bomb $v2_explode $ctrlroom_explode // sends bomb names to new thread.
$v2_explode thread axis_win_timer

end


allies_win_bomb local.bomb1 local.bomb2:

while (local.bomb1.exploded != 1) // ( != ) means "does not equal".
wait .1
while (local.bomb2.exploded != 1)
wait .1

teamwin allies
end

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

axis_win_timer:

level waittill axiswin

end

========================================

The global/obj_dm.scr bomb thinkers are what set "self.exploded = 1" when a bomb goes off. That makes the "while" loops untrue and stop looping, allowing the script to continue to the team win.

Hope that helps!
Tom Trude,

Image
Post Reply