In my tank battles I want the dead tank to go away or fade away after 10 seconds or so. Esspecially cos blitzschnee_2 is a bit tighter (like a tiger) than the old one, if the models go away that will help framerates and conjestion. Not sure of the best idea to change it or leave it. Its a challenge for the player iether way.
This is the enormus code and also willing to take sugestions on what to do, remove dead tanks or keep em piled up.
Then there is a third option and that is to keep the dead tank model and just remove the smoke after 10 seconds, the smoke is the big fps killer.
Ok bye.
tankdamage local.smoke:
thread debugtext ("THREAD: tankdamage: self = " + self + ", local.smoke = " + local.smoke)
self thread spawn_fx "fx/fx_tank_explosion.tik"
self playsound explode_tank
thread jitter_large 0 // make the screen shake
if (local.smoke == 3) // turret
{
self.smoke3o = spawn script_origin
self.smoke3o.origin = self.origin
self.smoke3 = spawn "models/emitters/linger_smoke.tik"
self.smoke3 notsolid
self.smoke3 anim start
self.smoke3.origin = (self.origin + ( -40 0 130) )
self.smoke3 bind self.smoke3o
self.smoke3o glue self
}
else if (local.smoke == 2) // front
{
self.smoke2o = spawn script_origin
self.smoke2o.origin = self.origin
self.smoke2 = spawn "models/emitters/linger_smoke.tik"
self.smoke2 notsolid
self.smoke2 anim start
self.smoke2.origin = (self.origin + ( 100 50 60) )
self.smoke2 bind self.smoke2o
self.smoke2o glue self
}
else // back
{
self.smoke1o = spawn script_origin
self.smoke1o.origin = self.origin
self.smoke1 = spawn "models/emitters/linger_smoke.tik"
self.smoke1 notsolid
self.smoke1 anim start
self.smoke1.origin = (self.origin + ( -200 -50 60) )
self.smoke1 bind self.smoke1o
self.smoke1o glue self
}
thread debugtext ("END THREAD: tankdamage: self = " + self + ", local.smoke = " + local.smoke)
end
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
tankexplode:
thread debugtext ("THREAD: tankexplode: self = " + self)
self stop
self.destroyed = 1
local.origin = self.origin
local.angles = self.angles
thread debugtext (" Vehicle location @ " + local.origin)
thread debugtext (" Vehicle angles = " + local.angles)
self.gun2 = self QueryTurretSlotEntity 1
if (self.gun2)
{
local.po = self.gun2.origin
local.po[2] = local.po[2] + 50
local.t2exp = spawn script_origin
local.t2exp.origin = local.po
local.t2exp.angles = local.angles
thread debugtext (" Add a turret2 explosion @ " + local.t2exp.origin)
local.t2exp thread spawn_fx "fx/fx_tank_explosion.tik" 3
local.t2exp playsound explode_tank
radiusdamage local.t2exp.origin 200 200
self.gun2 unlock
self DetachTurretSlot 1 self.gun2.origin
local.po = self.gun2.origin
local.po[2] = local.po[2] + 0
thread debugtext " Add some fire to turret 2"
local.fire2 = spawn script_origin
local.fire2.origin = local.po
local.fire2.angles = local.angles
thread debugtext (" Add some fire @ " + local.fire2.origin)
local.fire2 thread spawn_fx "models/emitters/fire.tik"
wait 1
thread debugtext (" remove turret 2 @ " + self.gun2.origin)
self.gun2 remove
wait 0.5
}
self.gun = self QueryTurretSlotEntity 0
if (self.gun)
{
local.po = self.gun.origin
local.po[2] = local.po[2] + 100
local.exp = spawn script_origin
local.exp.origin = local.po
local.exp.angles = local.angles
thread debugtext (" Add a turret explosion @ " + local.exp.origin)
local.exp thread spawn_fx "fx/fx_tank_explosion.tik" 5
local.exp playsound explode_tank
radiusdamage local.exp.origin 500 200
self.gun unlock
self DetachTurretSlot 0 self.gun.origin
local.po = self.gun.origin
local.po[2] = local.po[2] + 0
thread debugtext " Add some fire to turret 1"
local.fire = spawn script_origin
local.fire.origin = local.po
local.fire.angles = local.angles
thread debugtext (" Add some fire @ " + local.fire.origin)
local.fire thread spawn_fx "models/emitters/fire.tik"
wait 1
thread debugtext ("remove turret 1 @ " + self.gun.origin)
self.gun remove
}
local.po = local.origin
local.po[2] = local.po[2] + 250
local.exp2 = spawn script_origin
local.exp2.origin = local.origin
local.exp2.angles = local.angles
thread debugtext ("Add a main model explosion @ " + local.exp2.origin)
local.exp2 thread spawn_fx "fx/wall_exploder.tik" 5
local.exp2 playsound explode_tank
radiusdamage local.exp2.origin 1000 200
if (self.driver)
{
local.player = self.driver
waitthread getoutoftank local.player
local.player exec global/bullethit.scr (0 -1 0) 1000 50 1
}
iprintlnbold (self + " has been destroyed.")
thread debugtext ("remove the model @ " + self.origin)
// self remove
self.health = 0
self hide
self.tankinuse = 1
thread debugtext ("do a large screen jitter")
thread jitter_large 0
local.dam = spawn script_origin
local.dam.origin = local.origin
local.dam.angles = local.angles
thread debugtext ("Spawn damaged model @ " + local.dam.origin)
//////////////////////////dead tank tik here////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
local.dam thread spawn_damaged "vehicles/panzer_iv_eud.tik"
/*
//if (self.tankinuse == 1)
//{
thread debugtext ("exit the tank turret")
wait 1
thread debugtext (" OPEN")
local.dam.damaged anim open
thread debugtext (" OPEN_IDLE")
local.dam.damaged anim open_idle
thread debugtext "Spawn AI and do exit tank routine"
local.temp = randomint 3
local.temp = 0
if (local.temp == 0)
local.model_type = human/german_panzer_grenadier
if (local.temp == 1)
local.model_type = human/german_panzer_obershutze
if (local.temp == 2)
local.model_type = human/german_panzer_tankcommander
thread debugtext ("spawn = " + local.temp + " which is = " + local.model_type)
local.ent = spawn local.model_type
local.ent.origin = local.dam.damaged gettagposition "tag_start"
local.ent.angles = local.dam.damaged gettagangles "tag_start"
local.ent noticescale 1
local.ent sight 4500
local.ent mindist 2024
local.ent maxdist 2448
local.ent leash 10000
//if (level.dontdropweapons == 1)
local.ent dontdropweapons
local.ent exec global/disable_ai.scr
local.ent notsolid
local.ent anim_noclip tank_exit_1
local.ent waittill animdone
local.ent anim_noclip tank_exit_2
local.ent waittill animdone
local.ent anim_noclip tank_exit_3
local.ent waittill animdone
local.ent anim_noclip tank_exit_4
local.ent waittill animdone
wait .7
thread debugtext "MAke solid enable AI"
local.ent solid
local.ent exec global/enable_ai.scr
//wait 3
//thread debugtext "Kill the Ai"
//local.ent bedead
//}
*/
wait 5
local.po = local.origin
local.po[2] = local.po[2] + 200
local.col = spawn script_origin
local.col.origin = local.po
local.col.angles = local.angles
thread debugtext ("Add a mushroom column and big bang @ " + local.col.origin)
local.col thread spawn_fx "fx/gas_mushroom_column.tik" 10
local.col playsound explode_tank
radiusdamage local.col.origin 500 200
wait 5
thread debugtext "Add a mushroom cloud"
local.po = local.origin
local.po[2] = local.po[2] + 750
local.mush = spawn script_origin
local.mush.origin = local.po
local.mush.angles = local.angles
thread debugtext ("Add a mushroom cloud @ " + local.mush.origin)
local.mush thread spawn_fx "fx/gas_mushroom_cloud.tik" 5 //change
thread debugtext ("ENDTHREAD: tankexplode: local.parent = " + local.dam)
end
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
spawn_fx local.fx:
thread debugtext ("THREAD: spawn_fx: self = " + self + ",local.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:
thread debugtext ("THREAD: jitter_large: self = " + self + ",local.model = " + local.model)
local.damaged = spawn script_model model local.model
local.damaged.origin = self.origin
local.damaged.angles = self.angles
self.smoke = spawn "models/emitters/linger_smoke.tik"
self.smoke notsolid
self.smoke anim start
self.smoke.origin = (self.origin + (0 0 80))
self.smoke glue self
end local.damaged
//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:
thread debugtext ("THREAD: jitter_large: self = " + self + ",local.time = " + 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
// text only output if debug mode is turned on
debugtext local.text:
if (level.debug == 1)
println ("DEBUG blitzschnee_2: " + local.text)
end
remove dead tank??
Moderator: Moderators
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
-
TheShiznaeSpe
- Major
- Posts: 304
- Joined: Wed Feb 05, 2003 11:45 pm
- Location: US
- Contact:
Re: remove dead tank??
sorry for all the quoting, but i needed to use some context:
that should work...small_sumo wrote:////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
tankexplode:
thread debugtext ("THREAD: tankexplode: self = " + self)
self stop
self.destroyed = 1
local.origin = self.origin
local.angles = self.angles
thread debugtext (" Vehicle location @ " + local.origin)
thread debugtext (" Vehicle angles = " + local.angles)
self.gun2 = self QueryTurretSlotEntity 1
if (self.gun2)
{
local.po = self.gun2.origin
local.po[2] = local.po[2] + 50
local.t2exp = spawn script_origin
local.t2exp.origin = local.po
local.t2exp.angles = local.angles
thread debugtext (" Add a turret2 explosion @ " + local.t2exp.origin)
local.t2exp thread spawn_fx "fx/fx_tank_explosion.tik" 3
local.t2exp playsound explode_tank
radiusdamage local.t2exp.origin 200 200
self.gun2 unlock
self DetachTurretSlot 1 self.gun2.origin
local.po = self.gun2.origin
local.po[2] = local.po[2] + 0
thread debugtext " Add some fire to turret 2"
local.fire2 = spawn script_origin
local.fire2.origin = local.po
local.fire2.angles = local.angles
thread debugtext (" Add some fire @ " + local.fire2.origin)
local.fire2 thread spawn_fx "models/emitters/fire.tik"
wait 1
thread debugtext (" remove turret 2 @ " + self.gun2.origin)
self.gun2 remove
wait 0.5
}
self.gun = self QueryTurretSlotEntity 0
if (self.gun)
{
local.po = self.gun.origin
local.po[2] = local.po[2] + 100
local.exp = spawn script_origin
local.exp.origin = local.po
local.exp.angles = local.angles
thread debugtext (" Add a turret explosion @ " + local.exp.origin)
local.exp thread spawn_fx "fx/fx_tank_explosion.tik" 5
local.exp playsound explode_tank
radiusdamage local.exp.origin 500 200
self.gun unlock
self DetachTurretSlot 0 self.gun.origin
local.po = self.gun.origin
local.po[2] = local.po[2] + 0
thread debugtext " Add some fire to turret 1"
local.fire = spawn script_origin
local.fire.origin = local.po
local.fire.angles = local.angles
thread debugtext (" Add some fire @ " + local.fire.origin)
local.fire thread spawn_fx "models/emitters/fire.tik"
wait 1
thread debugtext ("remove turret 1 @ " + self.gun.origin)
self.gun remove
}
local.po = local.origin
local.po[2] = local.po[2] + 250
local.exp2 = spawn script_origin
local.exp2.origin = local.origin
local.exp2.angles = local.angles
thread debugtext ("Add a main model explosion @ " + local.exp2.origin)
local.exp2 thread spawn_fx "fx/wall_exploder.tik" 5
local.exp2 playsound explode_tank
radiusdamage local.exp2.origin 1000 200
if (self.driver)
{
local.player = self.driver
waitthread getoutoftank local.player
local.player exec global/bullethit.scr (0 -1 0) 1000 50 1
}
iprintlnbold (self + " has been destroyed.")
thread debugtext ("remove the model @ " + self.origin)
wait 10 //10 sec
self remove //un-commmented
self.health = 0
self hide
self.tankinuse = 1
thread debugtext ("do a large screen jitter")
thread jitter_large 0
local.dam = spawn script_origin
local.dam.origin = local.origin
local.dam.angles = local.angles
thread debugtext ("Spawn damaged model @ " + local.dam.origin)
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact: