Dual Team - Objectives

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Gener_AL
Corporal
Posts: 41
Joined: Wed Jun 12, 2002 1:32 pm

Dual Team - Objectives

Post by Gener_AL »

:?:
okay i thought this would be easy .. but ive got a bit stuck ....
Is it possible to give the allied team and axis team a bomb to plant ....?
i am using wombats obj tutorial as reference ..... The problem i have is where the lines ....
level.defusing_team = "axis"
level.planting_team = "allies"
come into play .... i was thinkin about making custom bombs e.g but then i hit another problem bomb thinkers ....
so i looked again at the script and came up with this......

main:
exec global/exploder.scr
////////////////////scoreboard messages//////////////////////
setcvar "g_obj_alliedtext1" "------------------------"
setcvar "g_obj_alliedtext2" "Dual obj test"
setcvar "g_obj_alliedtext3" "------------------------"
setcvar "g_obj_axistext1" "------------------------"
setcvar "g_obj_axistext2" "By Gener_al"
setcvar "g_obj_axistext3" "------------------------"
setcvar "g_scoreboardpic" "Obj_Dual"
//////////////////////////////////////////////////////////////
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/obj/obj_dual.scr
exec global/ambient.scr m5l1b
exec global/bomber.scr
level.flyplane = 1
exec global/door_locked.scr
/////////////////////////////////////////
level waittill spawn
thread credits
level.targets_to_destroy = 2
level.dmrespawning = 1
level.dmroundlimit = 5
//level waittill roundstart
////////////////bomb1//////////////////////////

$bomb1.trigger_name = $trigger1
$bomb1.target.target = $trigger1
$bomb1.target.destroyed_model = "models/statweapons/flak88_d.tik"
$bomb1.explosion_fx = "models/emitters/explosion_mine.tik"
$bomb1.explosion_sound = "sound/weapons/explo/explo_metalmed1.wav"
$bomb1.defusing_team = "axis"
$bomb1.planting_team = "allies"
$bomb1.clockside = "axis"
//////////////bomb2/////////////////////////////

$bomb2.trigger_name = $trigger2
$bomb2.target.target = $trigger2
$bomb2.target.destroyed_model = "models/statweapons/flak88_d.tik"
$bomb2.explosion_fx = "models/emitters/explosion_mine.tik"
$bomb2.explosion_sound = "sound/weapons/explo/explo_metalmed1.wav"
$bomb2.defusing_team = "allies"
$bomb2.planting_team = "axis"
///////////////// bomb thinkers/////////////////////

$bomb1 thread global/obj_dm.scr::bomb_thinker
$bomb2 thread global/obj_dm.scr::bomb_thinker
$bomb1 thread allies_win_timer
$bomb2 thread axis_win_timer
thread allies_win_bomb
thread axis_win_bomb
thread bomb1_exploded $bomb1
thread bomb2_exploded $bomb2
end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------
axis_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin axis
end
axis_win_timer:
level waittill axiswin
end
//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------
allies_win_bomb:
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin allies
end
allies_win_timer:
level waittill allieswin
end

//*** --------------------------------------------
//*** "Bomb 1 Exploded"
//*** --------------------------------------------
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "axis target done......."
//$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
end
//*** --------------------------------------------
//*** "Bomb 2 Exploded"
//*** --------------------------------------------
bomb2_exploded local.bomb2:
while (local.bomb2.exploded != 1)
wait .1
iprintlnbold_noloc "allies target done....."
//$spawn_allies2 disablespawn
//$spawn_alliies3 enablespawn
end

credits:
wait 5
iprintlnbold_noloc "Dual Obj Tutorial"
wait 5
iprintlnbold_noloc "Designed By Gener_AL"
wait 5
iprintlnbold_noloc "For More Maps and updates visit"
wait 2
iprintlnbold_noloc "www.maptiks.pwp.blueyonder.co.uk/index.htm"
wait 2
iprintlnbold_noloc "For More Tutorials And everythin Moh visit"
wait 2
iprintlnbold_noloc "http://www.planetmedalofhonor.com/map/"
wait 2
end

phew ....... ive not actually tested this yet ... ill make a quick map to test this as soon as i have posted ... but you can see my problems ... i did see a old post ref to duncan.weir.co.uk ... but its a 404 web error ...

im not sure if the lines.... are valid

////$bomb1.defusing_team = "axis"
////$bomb1.planting_team = "allies"

just a cowboy job really as my scripting skills are very rusty ...
and i cant possibly going through the g_class definitions ...(141 a4 pages..!) ...lol....
so if you can help with planting .. whole bomb thing that`d be cool.....
thx

oh yah ... ill do a tut as well if i can get it sussed ... :idea:


//////////mmm....!!

looking again ... would i have to create a seperate level round time for each bomb ...? or can it work off the level.dmroundlimit = 5 for both ...
...????
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The regular obj_dm.scr script doesn't allow for multiple planting teams. You can use my jv_obj_dm.scr though, it ships with the bots beta map.

http://home.student.utwente.nl/a.b.vrij ... tsbeta.zip

If you use that script, you can set a $plantteam per bomb in the editor. A defusing team isn't needed, it's automatically set to the opposing team.

You can also set different models and tick times per bomb. Just see the top of the aforementioned script file :wink: .
Image
User avatar
Gener_AL
Corporal
Posts: 41
Joined: Wed Jun 12, 2002 1:32 pm

Post by Gener_AL »

:D

thx dude will try this out later today ......
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

use a basic explosion script that doesn't call obj?

-this may work if you make a trigger with a setthread

Code: Select all

explode_alliesbomb:

	iprintlnbold_noloc "Bomb has been set, allies win in 5..."
	wait 1
	iprintlnbold_noloc "4"
	wait 1
	iprintlnbold_noloc "3"
	wait 1
	iprintlnbold_noloc "2"
	wait 1
	iprintlnbold_noloc "1"
	wait 1

	exec global/exploder.scr::explode 1
	
	iprintlnbold_noloc "BOOM!"
	
	$bombmodel remove

teamwin allies	

end

[code]
explode_axisbomb:

	iprintlnbold_noloc "Bomb has been set, axis win in 5..."
	wait 1
	iprintlnbold_noloc "4"
	wait 1
	iprintlnbold_noloc "3"
	wait 1
	iprintlnbold_noloc "2"
	wait 1
	iprintlnbold_noloc "1"
	wait 1

	exec global/exploder.scr::explode 2
	
	iprintlnbold_noloc "BOOM!"
	
	$bombmodel2 remove
	
teamwin axis

end
Post Reply