Page 1 of 2
spawn bomb in stock map
Posted: Sun Mar 07, 2004 10:05 pm
by .FuSe.
i am trying to spawn a bomb it be planted in stock maps
i already know how to spawn a say tiger tank in a map but how to attach a triggerable(i belive) bomb to it is stumpin me
any help would be great
Posted: Sun Mar 07, 2004 10:44 pm
by M&M
there is a tut on making obj like that in the tuts section here on this site,i dont know about spawning it in a stock map ,but u could check it out.i fu already did then u'll have 2 wait 4 one of the pros 2 reply 2 u.btw is the tank drivable or just the object u want 2 blow?
trigger
Posted: Sun Mar 07, 2004 10:54 pm
by tltrude
Spawn a "pulsating bomb" and a "non-pulsating bomb" (script_objects) in the same spot on the side of the two tanks--an unexploded tank and an exploded tank). Also, spawn a trigger_use in the same spot, and an explosion entity. Then, in the script, use "hide" for the non-pulsating bomb to hide it. The script should look something like this.
Code: Select all
main:
level waittill spawn
//spawn all the suff
$tank1 hide // Hide the exploded tank
$bomb1 hide // Hide the non-pulse bomb script_object
end
//******************************
// Bomb trigger1 setthread
//******************************
bomb_tank1:
$trigger1 remove
$bomb1 show
$bomb1_pulse remove
local.player = parm.other
local.player stopwatch 10
$bomb1 playsound plantbomb
wait .5
$bomb1 loopsound final_countdown
wait 10
$bomb1 stoploopsound
$tank_explode anim start // explosion entity
radiusdamage $bomb1.origin 120 256 // numbers are damage and radius
$bomb1 remove
$tank1 remove // tank entity
$tank1_destroyed show // destroyed tank entity
thread jitter_large
end
//******************************
// earthquake effect
//******************************
jitter_large:
waitexec global/earthquake.scr .35 10 0 0
waitexec global/earthquake.scr .23 6 0 0
waitexec global/earthquake.scr 1 1 0 0
waitexec global/earthquake.scr 1.25 .3 0 1
end
The trigger should have "setthread tank_bomb1".
Posted: Sun Mar 07, 2004 11:18 pm
by Bjarne BZR
.FuSe., I did exactly this in the Dogville OBJ map, check the script of the map:
http://www.planetmedalofhonor.com/rjuka ... gville_obj
Posted: Mon Mar 08, 2004 3:37 am
by .FuSe.
ok i downloaded your map and stole some of your script
here is what i got thus far
Code: Select all
// REMAGEN
// ARCHITECTURE: STAGGER
// SCRIPTING: POWZER
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm3"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
level.dmrespawning = 0
level.dmroundlimit = 5
level.clockside = allies
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3
thread global/door_locked.scr::lock
level waittill spawn
level.defusing_team = "allies
level.planting_team = "axis"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 1000
local.stuka = spawn script_model
local.stuka model "vehicles/stuka_d.tik"
local.stuka.origin = ( 3730.68 -2800.60 440.72 )
local.stuka.angles = ( 25 360 0 )
local.fockwulf = spawn script_model
local.fockwulf model "vehicles/fockwulf_d.tik"
local.fockwulf.origin = ( 1280.56 -2617.86 868.88 )
local.fockwulf.angles = ( 25 270 180 )
local.opel = spawn script_model
local.opel model "vehicles/opeltruckgreen_d.tik"
local.opel.origin = ( 5875.20 -2871.74 2.43 )
local.opel.angles = ( 0 90 0 )
local.panzer = spawn script_model "targetname" "exploder"
local.panzer model "vehicles/panzer_iv.tik"
local.panzer.origin = ( 1082.15 -1036.92 -71.88 )
local.panzer.angles = ( 0 50 0 )
local.panzer = solid
level waittill roundstart
$bomb thread global/obj_dm.scr::bomb_thinker
thread axis_win_bomb
$bomb thread allies_win_timer
$bomb thread exploder_wait
local.bomb = spawn script_model "targetname" "bomb"
local.bomb model "items/pulse_explosive.tik"
local.bomb.origin = ( 957.49 -1184.19 -25.75 )
local.bomb.angles = ( 10.0 0.0 0.0 )
local.bomb.exploder_set = 1
local.bomb.explosion_fx = "models/fx/fx_explosion.tik"
local.bomb.trigger_name = "bomb_trigger"
local.bomb.target = "exploder"
local.trigger = spawn trigger_use "targetname" "bomb_trigger"
local.trigger setsize ( 957.49 -1184.19 -45.75 ) //( 957.49 -1184.19 -45.75 )
end
end
axis_win_bomb:
println "[threadStart] axis_win_bomb"
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin axis
end
allies_win_timer:
println "[threadStart] allies_win_timer"
level waittill allieswin
end
still cant set the bomb though

Posted: Mon Mar 08, 2004 8:13 am
by Bjarne BZR
Well, what errors do you get in console?
Posted: Mon Mar 08, 2004 10:39 pm
by .FuSe.
mm dont seem to get any
Posted: Mon Mar 08, 2004 11:52 pm
by Bjarne BZR
Yes you were:
And by reading these errors, I made this:
Code: Select all
// REMAGEN
// ARCHITECTURE: STAGGER
// SCRIPTING: POWZER
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm3"
level waittill prespawn
level.dmrespawning = 0
level.dmroundlimit = 5
level.clockside = allies
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/obj/mohdm3.scr
exec global/ambient.scr mohdm3
thread global/door_locked.scr::lock
level waittill spawn
level.defusing_team = "allies
level.planting_team = "axis"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 1000
local.stuka = spawn script_model
local.stuka model "vehicles/stuka_d.tik"
local.stuka.origin = ( 3730.68 -2800.60 440.72 )
local.stuka.angles = ( 25 360 0 )
local.fockwulf = spawn script_model
local.fockwulf model "vehicles/fockwulf_d.tik"
local.fockwulf.origin = ( 1280.56 -2617.86 868.88 )
local.fockwulf.angles = ( 25 270 180 )
local.opel = spawn script_model
local.opel model "vehicles/opeltruckgreen_d.tik"
local.opel.origin = ( 5875.20 -2871.74 2.43 )
local.opel.angles = ( 0 90 0 )
local.panzer = spawn script_model "targetname" "exploder"
local.panzer model "vehicles/panzer_iv.tik"
local.panzer.origin = ( 1082.15 -1036.92 -71.88 )
local.panzer.angles = ( 0 50 0 )
local.panzer = solid
local.bomb = spawn script_model "targetname" "bomb"
local.bomb model "items/pulse_explosive.tik"
local.bomb.origin = ( 957.49 -1184.19 -25.75 )
local.bomb.angles = ( 10.0 0.0 0.0 )
local.bomb.exploder_set = 1
local.bomb.explosion_fx = "models/fx/fx_explosion.tik"
local.bomb.trigger_name = "bomb_trigger"
local.bomb.target = "exploder"
local.trigger = spawn trigger_use "targetname" "bomb_trigger"
local.trigger setsize ( 957.49 -1184.19 -45.75 ) ( 1000 -1100 0 )
// level waittill roundstart
$bomb thread global/obj_dm.scr::bomb_thinker
thread axis_win_bomb
thread allies_win_timer
end
axis_win_bomb:
println "[threadStart] axis_win_bomb"
while(level.targets_destroyed < level.targets_to_destroy)
waitframe
teamwin axis
end
allies_win_timer:
println "[threadStart] allies_win_timer"
level waittill allieswin
end
...and it works nicely. You just need to fix a destroyed model after the explosion.
Posted: Mon Mar 08, 2004 11:59 pm
by .FuSe.
ok kool thz man
i actually copyed over your entire script and changed the coords
(from your map you made)
only thing i noticed is that the allies cant defuse the bomb
any ideas ?
Posted: Tue Mar 09, 2004 2:13 am
by omniscient
do uhave more than 1 person in game?
Posted: Tue Mar 09, 2004 2:17 am
by nuggets
level.defusing_team = "allies
should be
level.defusing_team = "allies"
Posted: Tue Mar 09, 2004 5:18 am
by .FuSe.
yup
got it all fixed though
forgot one set of quotes .... d0h
thx for the help guys
Posted: Tue Mar 09, 2004 7:57 am
by Bjarne BZR
Code: Select all
level.defusing_team = "allies
level.planting_team = "axis"
Take a REALLY close look at these two lines
( Hint: How many " characters do you see? )
Posted: Tue Mar 09, 2004 6:25 pm
by .FuSe.
ok thats all fixed
i saw the typo
now one last question
on the trigger setsize .. how do you determin the coord. to enter for the value
cause if i move around the explosive then i once again cant set it
Posted: Tue Mar 09, 2004 7:55 pm
by Bjarne BZR
I set it some units + in evey direction in reference to the bomb, and the other coordinate some units - in evey diection in reference to the bomb.`Is that a good answer?