How do I add explosions like in the ones in Omaha Beach
Moderator: Moderators
How do I add explosions like in the ones in Omaha Beach
Last edited by D-Day on Tue Sep 16, 2003 9:04 pm, edited 16 times in total.
----------------- Omaha Beach --------------------
----------------- June 6, 1944 ------------------
------------------- D-Day -------------------
----------------- June 6, 1944 ------------------
------------------- D-Day -------------------
A smaller font will do
Here you go:
Here you go:
global/exploder.scr wrote: // Exploding chunk system created by Mackey McCandlish.
//
// Before level waittill prespawn "exec global/exploder.scr".
//
// Used in levels where stuff blows up.
//
// Create a script_object that is a "undestroyed" version of the thing that is supposed to blow up and targetname it "exploder"
//
// Create a script_object that is a "destroyed" version of the thing that is supposed to blow up and targetname it
// "explodersmashed". They occupy the same physical space.
//
// Create script_object chunks of geometry that are going to fly out of the destroyable object/building and place them in the
// places they're supposed to fly from. Make them near but not touching the geometry of the explodersmashed. Targetname them
// "exploderchunk".
//
// Create one script_origin for each exploderchunk and make the chunk target the origin the same way a jump pad would target
// the jump pad destination in Quake3.
//
// Create script_models with targetname "exploderfire" and the "model" value of the tiki you want to use. These will be tiki
// explosions that will go off.
//
// Give all the chunks, smasheds, fires, and exploders the same #set value. Note you can have any number of smasheds, chunks,
// fires, or exploders, but typically you only have one smashed and one exploder. The reason you would want multiple of any
// of these is that you can give any of them a #pause value, and that will make it delay that long before occuring, so you
// could create a multistage explosion.
//
// You can create an explodertrigger (with the same #set), or just do "thread global/exploder.scr::explode #" (# being the
// #set value of the exploder in question).
Sorry for posting aagin on this topic, but the script i have writed run also on multiplayer map.
just change the main: method by
main :
// set scoreboard messages
setcvar "g_scoreboardpic" "none"
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
Thread random_explode
level.script = maps/dm/test_explo_multi.scr
level waittill spawn
end
In the map i have a script_origin (it works with script_object too) element called "refer" (this is the base for the calcul for the randomisation. )
exec global/ai.scr
exec global/loadout.scr maps/test_explo.scr
main:
level waittill prespawn
exec global/ambient.scr test_explo
exec global/exploder.scr
level waittill spawn
$player item weapons/colt45.tik
$player ammo pistol 1000
thread random_explode
level.script="map/test_explo.scr"
end
//////////////////////////////
random_explode:
local.target=$refer
local.a=local.target.origin
local.b=randomint (100)
if (local.b < 25)
{
local.a[0]=local.a[0] - randomint (200)
local.a[1]=local.a[1] - randomint (200)
}
else if (local.b < 50 && local.b >=25)
{
local.a[0]=local.a[0] + randomint (200)
local.a[1]=local.a[1] + randomint (200)
}
else if (local.b > 50 && local.b <= 75)
{
local.a[0]=local.a[0] - randomint (200)
local.a[1]=local.a[1] + randomint (200)
}
else if (local.b > 75)
{
local.a[0]=local.a[0] + randomint (200)
local.a[1]=local.a[1] - randomint (200)
}
local.exp1=spawn "fx/scriptbazookaexplosion.tik"
local.exp2=spawn "animate/fx_mortar_dirt.tik"
local.exp3=spawn "animate/fx_mortar_higgins.tik"
local.exp1.origin=local.a
local.exp1 anim start
local.exp2.origin=local.a
local.exp2 anim start
local.exp3.origin=local.a
local.exp3 anim start
wait(1 + ((randomint(5))*.2))
local.exp1 remove
local.exp2 remove
local.exp3 remove
goto random_explode
end
In fact, in this script you have a square (400 X 400) wherethe explosions will spawn.
it's defined by the randomint (200) the max distance from the "refer".
Tropheus
NB You can "spawn" olny one explosion, bur with the 3 it look like more violent.
just change the main: method by
main :
// set scoreboard messages
setcvar "g_scoreboardpic" "none"
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
Thread random_explode
level.script = maps/dm/test_explo_multi.scr
level waittill spawn
end
In the map i have a script_origin (it works with script_object too) element called "refer" (this is the base for the calcul for the randomisation. )
exec global/ai.scr
exec global/loadout.scr maps/test_explo.scr
main:
level waittill prespawn
exec global/ambient.scr test_explo
exec global/exploder.scr
level waittill spawn
$player item weapons/colt45.tik
$player ammo pistol 1000
thread random_explode
level.script="map/test_explo.scr"
end
//////////////////////////////
random_explode:
local.target=$refer
local.a=local.target.origin
local.b=randomint (100)
if (local.b < 25)
{
local.a[0]=local.a[0] - randomint (200)
local.a[1]=local.a[1] - randomint (200)
}
else if (local.b < 50 && local.b >=25)
{
local.a[0]=local.a[0] + randomint (200)
local.a[1]=local.a[1] + randomint (200)
}
else if (local.b > 50 && local.b <= 75)
{
local.a[0]=local.a[0] - randomint (200)
local.a[1]=local.a[1] + randomint (200)
}
else if (local.b > 75)
{
local.a[0]=local.a[0] + randomint (200)
local.a[1]=local.a[1] - randomint (200)
}
local.exp1=spawn "fx/scriptbazookaexplosion.tik"
local.exp2=spawn "animate/fx_mortar_dirt.tik"
local.exp3=spawn "animate/fx_mortar_higgins.tik"
local.exp1.origin=local.a
local.exp1 anim start
local.exp2.origin=local.a
local.exp2 anim start
local.exp3.origin=local.a
local.exp3 anim start
wait(1 + ((randomint(5))*.2))
local.exp1 remove
local.exp2 remove
local.exp3 remove
goto random_explode
end
In fact, in this script you have a square (400 X 400) wherethe explosions will spawn.
it's defined by the randomint (200) the max distance from the "refer".
Tropheus
NB You can "spawn" olny one explosion, bur with the 3 it look like more violent.
