Can Anyone HELP!?!?!?

Post your scripting questions / solutions here

Moderator: Moderators

Locked
User avatar
D-Day
Private
Posts: 3
Joined: Sat Sep 13, 2003 8:45 pm

Can Anyone HELP!?!?!?

Post by D-Day »

:?: How do I add explosions like in the ones in Omaha Beach :?:
----------------- Omaha Beach --------------------

----------------- June 6, 1944 ------------------

------------------- D-Day -------------------
carlpenn
Lance Corporal
Posts: 23
Joined: Wed Nov 13, 2002 12:16 pm

Post by carlpenn »

Tropheus
Corporal
Posts: 49
Joined: Sun Sep 14, 2003 11:19 pm
Location: france
Contact:

Post by Tropheus »

Hie everybody !

First sorry for my poor english i post from France.

I not agree with carlpenn because in his script only time is randomised. If you want to have some explosion but in randomised place use this script (Becarefull it's only for singleplayer)

In the map i have a script_origin 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 < 50)
{
local.a[0]=local.a[0] - randomint (200)
local.a[1]=local.a[1] - randomint (200)
}
else
{
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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Nice stuff Tropheus, and welcome to .map :D
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

D-Day please don't start more than one thread per topic.

/forum/viewtopic.php?t=5188
Image
Locked