heres where im at ,,, im trying to add objective to a singleplayer map(training)
bomb works 90% - the bomb blows up, ticks, stopwatch appears,level ends
only the tank disapear
is it possible to have tank spawn destroyed after exsplosion
but heres the kicker the tank is apart of the map
it can be removed thou during singleplayer mode it gets detryed and spawns detroyed
heres console error
----------------z----------------
self = bomb_explode
self.target (flak 88 or other0 = tank
self.target.destroyed_model = NIL
self.target.target (collision entity) =
self.trigger_name = tanktrig
self.exploder_set = NIL
self.explosion_fx = emitters/mortar_higgins.tik
self.explosion_sound = explode_tank
self.killarea = 1024
----------------z----------------
self.target.collisionent = self.target.target (global/obj_dm2.scr, 40)
self.target^
^~^~^ script error: there are 0 entities with targetname ", you are using a
command that requires exactly one
waittill trigger tanktrig
heres scripts
//-----------------------------
$bomb_explode thread global/obj_dm2.scr::bomb_thinker
thread allied_win_bomb $bomb_explode
thread axis_win_timer $bomb_explode
end
//------------------------------
allied_win_bomb local.bomb:
while(local.bomb.exploded != 1)
waitframe
teamwin allies
end
axis_win_timer:
level waittill axiswin
end
//-----------------------------
setupobj1:
spawn trigger_use "targetname" "tanktrig"
$tanktrig.origin = ( 789 -2548 -325 )
$tanktrig setsize ( -10 -10 -10) ( 10 10 10 )
spawn script_model "model" animate/pulse_explosive.tik "targetname" "bomb_explode"
$bomb_explode.origin = ( 789 -2548 -325 ) // same as trigger
$bomb_explode.angles = ( 0 0 0 )
$bomb_explode.destroyed_model = "vehicles/tigertank_d.tik"
$bomb_explode.trigger_name = tanktrig
$bomb_explode.target = $tank
$bomb_explode.explosion_fx = emitters/mortar_higgins.tik
$bomb_explode.explosion_sound = explode_tank
$bomb_explode.killarea = 1024
end
Plz Help : (
help with bomb
Moderator: Moderators
here is ,,, scriipt
//
//
// LOGIC FOR OBJECTIVE BASED DEATHMATCH ENTITIES
//
//
//***********************************************
// initialization thread...
//***********************************************
bomb_thinker:
// Steve says planting time = 6 seconds
// defusing time = 12 second
// tick time = 36 seconds
level.bomb_defuse_time = 60 //tenths of a second
level.bomb_set_time = 100 //tenths of a second
level.bomb_tick_time = 60 //seconds (was 60 seconds, then 30 seconds)
// level.wait_after_explode = 2 //seconds time after target is destroyed before the level ends (no longer used, done in code now)
level.bomb_explosion_radius = 1054 //quake units
level.bomb_use_distance = 128 //quake units
level.bomb_damage = 200
level.bombusefov = 30
level.subtitleX = 100
level.subtitleY = 50
println "----------------------Z-----------------------"
println "self = " self
println "self.target (flak 88 or other) = " self.target
println "self.target.destroyed_model = " self.target.destroyed_model
println "self.target.target (collision entity) = " self.target.target
println "self.trigger_name = " self.trigger_name
println "self.exploder_set = " self.exploder_set
println "self.explosion_fx = " self.explosion_fx
println "self.explosion_sound = " self.explosion_sound
println "self.killarea = " self.killarea
println "----------------------Z-----------------------"
self.target.collisionent = self.target.target
self.target notsolid
thread bomb_waittill_set
end
//***********************************************
// first thread... controls allies using the trigger
//***********************************************
bomb_waittill_set:
self model items/pulse_explosive.tik
while ( $(self.trigger_name) )
{
println "waittill trigger " self.trigger_name
self.trigger_name waittill trigger
local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.planting_team)
{
goto bomb_waittill_set
println "failed dmteam check" local.player.dmteam
}
local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_set_time * .1)
local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY("set "+ local.counter)
wait .1
if (local.counter >= level.bomb_set_time)
{
iprintlnbold "A Bomb has been planted!"
if (level.planting_team == "allies")
self playsound dfr_objective_o
else
self playsound den_objective_o
thread bomb_waittill_defuse
thread bomb_waittill_explode
self.live = 1
level.bombs_planted ++
$player stopwatch 60
wait 60
end
}
}
if (local.counter > 0)
local.player stopwatch 0
println "usetrigger but failed check"
if ! (self cansee local.player level.bombusefov level.bomb_use_distance)
println "failed cansee check"
if ! (local.player.useheld == 1)
println "failed useheld check" local.player.useheld
}
end
//***********************************************
// second thread... controls axis using the trigger
//***********************************************
bomb_waittill_defuse:
while ( $(self.trigger_name) )
{
self.trigger_name waittill trigger
local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.defusing_team)
{
println "failed dmteam check" local.player.dmteam
goto bomb_waittill_defuse
}
local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_defuse_time * .1)
local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY ("defuse "+local.counter)
wait .1
if (local.counter >= level.bomb_defuse_time)
{
iprintlnbold "A Bomb has been defused!"
if (level.defusing_team == "allies")
self playsound dfr_diffused_d
else
self playsound den_diffused_d
thread bomb_waittill_set //start first thread again
self.live = 0
level.bombs_planted --
end
}
}
if (local.counter > 0)
local.player stopwatch 0
}
end
//***********************************************
// third thread... times the bomb and makes it explode at the right time
//***********************************************
bomb_waittill_explode:
self model items/explosive.tik
self playsound plantbomb
self loopsound bombtick
local.start_time = level.time
while (level.time < (local.start_time + level.bomb_tick_time) )
{
wait .1
if (self.live != 1)
{
self stoploopsound
end
}
if (level.time == (local.start_time + level.bomb_tick_time - 10) )
{
self stoploopsound
self loopsound final_countdown
}
}
self stoploopsound
thread bomb_explode
end
//***********************************************
// fourth thread... controls the explosion
//***********************************************
bomb_explode:
self.trigger_name remove
thread jitter_large 0
if (self.exploder_set != NIL)
exec global/exploder.scr::explode self.exploder_set
if (self.explosion_fx != NIL)
{
self thread spawn_fx self.explosion_fx
}
if (self.explosion_sound != NIL)
self playsound self.explosion_sound
if (self.target != NIL)
{
if (self.target.destroyed_model != NIL)
{
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
}
self.target remove
waitframe
}
radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
if (self.killarea != NIL)
{
self.killarea volumedamage 1000
}
self hide
self.live = 0
self.exploded = 1
level.targets_destroyed = level.targets_destroyed + 1
// we delay the decrementing of level.bombs_planted so that the script has
// time to determin the winner before the timelimit gets checked and hit
wait 0.5
level.bombs_planted --
end
//----------------------------------
spawn_fx local.fx:
local.temp = spawn script_model model local.fx
local.temp.origin = self.origin
local.temp anim start
wait 5
local.temp remove
end
spawn_damaged local.model:
local.damaged = spawn script_model model local.model
local.damaged.origin = self.origin
local.damaged.angles = self.angles
end local.damaged
//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
if (local.time)
wait local.time
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
//
// LOGIC FOR OBJECTIVE BASED DEATHMATCH ENTITIES
//
//
//***********************************************
// initialization thread...
//***********************************************
bomb_thinker:
// Steve says planting time = 6 seconds
// defusing time = 12 second
// tick time = 36 seconds
level.bomb_defuse_time = 60 //tenths of a second
level.bomb_set_time = 100 //tenths of a second
level.bomb_tick_time = 60 //seconds (was 60 seconds, then 30 seconds)
// level.wait_after_explode = 2 //seconds time after target is destroyed before the level ends (no longer used, done in code now)
level.bomb_explosion_radius = 1054 //quake units
level.bomb_use_distance = 128 //quake units
level.bomb_damage = 200
level.bombusefov = 30
level.subtitleX = 100
level.subtitleY = 50
println "----------------------Z-----------------------"
println "self = " self
println "self.target (flak 88 or other) = " self.target
println "self.target.destroyed_model = " self.target.destroyed_model
println "self.target.target (collision entity) = " self.target.target
println "self.trigger_name = " self.trigger_name
println "self.exploder_set = " self.exploder_set
println "self.explosion_fx = " self.explosion_fx
println "self.explosion_sound = " self.explosion_sound
println "self.killarea = " self.killarea
println "----------------------Z-----------------------"
self.target.collisionent = self.target.target
self.target notsolid
thread bomb_waittill_set
end
//***********************************************
// first thread... controls allies using the trigger
//***********************************************
bomb_waittill_set:
self model items/pulse_explosive.tik
while ( $(self.trigger_name) )
{
println "waittill trigger " self.trigger_name
self.trigger_name waittill trigger
local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.planting_team)
{
goto bomb_waittill_set
println "failed dmteam check" local.player.dmteam
}
local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_set_time * .1)
local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY("set "+ local.counter)
wait .1
if (local.counter >= level.bomb_set_time)
{
iprintlnbold "A Bomb has been planted!"
if (level.planting_team == "allies")
self playsound dfr_objective_o
else
self playsound den_objective_o
thread bomb_waittill_defuse
thread bomb_waittill_explode
self.live = 1
level.bombs_planted ++
$player stopwatch 60
wait 60
end
}
}
if (local.counter > 0)
local.player stopwatch 0
println "usetrigger but failed check"
if ! (self cansee local.player level.bombusefov level.bomb_use_distance)
println "failed cansee check"
if ! (local.player.useheld == 1)
println "failed useheld check" local.player.useheld
}
end
//***********************************************
// second thread... controls axis using the trigger
//***********************************************
bomb_waittill_defuse:
while ( $(self.trigger_name) )
{
self.trigger_name waittill trigger
local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.defusing_team)
{
println "failed dmteam check" local.player.dmteam
goto bomb_waittill_defuse
}
local.counter = 0
while ( (Isalive local.player) && (local.player cansee self level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
{
if (local.counter == 0)
local.player stopwatch (level.bomb_defuse_time * .1)
local.counter++
// if ((local.counter % 5) == 0)
// locprint level.subtitleX level.subtitleY ("defuse "+local.counter)
wait .1
if (local.counter >= level.bomb_defuse_time)
{
iprintlnbold "A Bomb has been defused!"
if (level.defusing_team == "allies")
self playsound dfr_diffused_d
else
self playsound den_diffused_d
thread bomb_waittill_set //start first thread again
self.live = 0
level.bombs_planted --
end
}
}
if (local.counter > 0)
local.player stopwatch 0
}
end
//***********************************************
// third thread... times the bomb and makes it explode at the right time
//***********************************************
bomb_waittill_explode:
self model items/explosive.tik
self playsound plantbomb
self loopsound bombtick
local.start_time = level.time
while (level.time < (local.start_time + level.bomb_tick_time) )
{
wait .1
if (self.live != 1)
{
self stoploopsound
end
}
if (level.time == (local.start_time + level.bomb_tick_time - 10) )
{
self stoploopsound
self loopsound final_countdown
}
}
self stoploopsound
thread bomb_explode
end
//***********************************************
// fourth thread... controls the explosion
//***********************************************
bomb_explode:
self.trigger_name remove
thread jitter_large 0
if (self.exploder_set != NIL)
exec global/exploder.scr::explode self.exploder_set
if (self.explosion_fx != NIL)
{
self thread spawn_fx self.explosion_fx
}
if (self.explosion_sound != NIL)
self playsound self.explosion_sound
if (self.target != NIL)
{
if (self.target.destroyed_model != NIL)
{
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
}
self.target remove
waitframe
}
radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
if (self.killarea != NIL)
{
self.killarea volumedamage 1000
}
self hide
self.live = 0
self.exploded = 1
level.targets_destroyed = level.targets_destroyed + 1
// we delay the decrementing of level.bombs_planted so that the script has
// time to determin the winner before the timelimit gets checked and hit
wait 0.5
level.bombs_planted --
end
//----------------------------------
spawn_fx local.fx:
local.temp = spawn script_model model local.fx
local.temp.origin = self.origin
local.temp anim start
wait 5
local.temp remove
end
spawn_damaged local.model:
local.damaged = spawn script_model model local.model
local.damaged.origin = self.origin
local.damaged.angles = self.angles
end local.damaged
//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
if (local.time)
wait local.time
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
println "self.target.destroyed_model = " self.target.destroyed_model
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
self is the bomb
self.target is the flak or tank whatever
So set the self.target.destroyed_model key to the model you want to see when objective is destroyed
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
self is the bomb
self.target is the flak or tank whatever
So set the self.target.destroyed_model key to the model you want to see when objective is destroyed
Im confused do i alter obj_dm.scr ?bdbodger wrote:println "self.target.destroyed_model = " self.target.destroyed_model
local.damaged = self.target thread spawn_damaged self.target.destroyed_model
self is the bomb
self.target is the flak or tank whatever
So set the self.target.destroyed_model key to the model you want to see when objective is destroyed
*edit* I see in your original script you set the destoyed_model key on the bomb and not on the bombs target which is the tank I belive you used . You see it says self.target.destroyed_model not self.destroyed_model .
The bomb targets the thing you are destroying right ? Some of the models have destoyed versions like the flak88_turret.tik has the flak88_d.tik that is the destroyed version of the flak88 . Look in the pak and see if the model you are useing has a destroyed version ususlly one with _d.tik in the name . If it does have then give the undestroyed model the key destroyed_model and the value you set to the name of the tik of the destroyed version of that model .
The bomb targets the thing you are destroying right ? Some of the models have destoyed versions like the flak88_turret.tik has the flak88_d.tik that is the destroyed version of the flak88 . Look in the pak and see if the model you are useing has a destroyed version ususlly one with _d.tik in the name . If it does have then give the undestroyed model the key destroyed_model and the value you set to the name of the tik of the destroyed version of that model .
heres tank script from default scr
Code: Select all
//CALLED BY BSP WHEN BOMB IS PLANTED
if (level.bomb_appeared == 1)
{
if (level.bomb_set == 1)
end
level.bomb_set = 1
$explosive_off hide
$explosive_on show
$explosive_on playsound plantbomb
$explosive_on loopsound bombtick
waitthread global/items.scr::remove_item "explosives"
$player stopwatch 15
wait 15
$explosive_on stoploopsound bombtick
$explosive_on hide
level.tank_idle_entity stoploopsound
// $tank stoploopsound
$tank playsound explode_tank
exec global/model.scr $explosive_on.origin "models/emitters/explosion_mine.tik"
wait 0.3
exec global/model.scr $tank.origin "models/emitters/mortar_higgins.tik"
$tank.gun = $tank QueryTurretSlotEntity 0
$tank.gun2 = $tank QueryTurretSlotEntity 1
if ($tank.gun)
{
$tank DetachTurretSlot 0
$tank.gun remove
}
if ($tank.gun2)
{
$tank DetachTurretSlot 1
$tank.gun2 remove
}
local.ent = spawn script_model
local.ent model "vehicles/tigertank_d.tik"
local.ent.origin = $tank.origin
local.ent.angles = $tank.angles
$tank remove
level.flags[tank] = 1
//radiusdamage self.origin level.bomb_damage level.bomb_explosion_radius
radiusdamage $explosive_on.origin 1000 600
}
endi dont seem to get this ,,,, been at this over a week
and Im not progressing much : (
It should be a lot like this........right? Except for the objective part.
http://users.1st.net/kimberly/Tutorial/blowdamage.htm

http://users.1st.net/kimberly/Tutorial/blowdamage.htm
"all the governments in the world are corrupt and in the hands of the Illuminati"

