Jump to content
Sign in to follow this  
*zeewolf*

Drop effects for large explosions

Recommended Posts

Does anyone have any drop effect scripts that create a realistic dust cloud for large caliber artillery fire (155mm+) and large airstrikes (2000 lb bombs)?

I'm thinking on the lines of large instantaneous vertical dust clouds that linger for about a minute.

Share this post


Link to post
Share on other sites

Ok, well I tried making something myself to demonstrate the kind of effect I'm after:

;Object for centre of cloud
_obj = _this select 0

;density of vertical column (denser means more clouds), e.g. 20
_Zoffset = _this select 1

;height of vertical column e.g. 100
_max = _this select 2

;speed of base smoke ring e.g. 5
_vel = _this select 3

;density of base smoke ring (denser means more clouds) e.g. 30
_thetaMax = _this select 4

;setup the variables for the particle array
_ShapeName = "cl_basic"
_AnimationName = ""
_Type = "Billboard"
_TimerPeriod = 1
_LifeTime = 60
_pos = getpos _obj
_MoveVelocity = [0,0,0]
_RotationVelocity = 0
_Weight = 1.279
_Volume = 1
_Rubbing = 0.01
_Size = [50,50]
_Colour0 = [0.5,0.5,0.5,1]
_Colour1 = [0.5,0.5,0.5,1]
_AnimationPhase = [0,1]
_RandomDirectionPeriod = 0
_RandomDirectionIntensity = 0
_OnTimer = ""
_BeforeDestroy = ""
_Object = ""
; High speed detonation cloud
_Size = [0,150]
_LifeTime = 0.1
_pos set [2, 20]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
; persistant cloud from detonation
_Size = [150,50]
_LifeTime = 60
~0.1
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
; vertical column
_Size = [50,50]
_pos = getpos _obj
#lp
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_z = (_pos select 2) + _Zoffset
_Size = [50 - _z/8, 50 - _z/4]
_pos set [2, _z]
~0.01
?(_z < _max) : goto "lp"
; base expanding dust ring
_pos set [2, 2]
_Size = [40, 1]
_theta = 360/_thetaMax
_i = 0
_Weight = 1.285
_Rubbing = 0
_LifeTime = 15
#lp2
_MoveVelocity = [_vel * cos _i,_vel * sin _i,0]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_i = _i + _theta
?(_i < 360) : goto "lp2"

; vertical trails from high speed debris ejection
_MoveVelocity = [0,0,0]
_max = _max * 1.25
; azimuth
_phi = random 360
; inclination
_theta = (random 30) - 15
; number of trails
_n = 1 + random 5
_i = 0
_Weight = 1.279
_Rubbing = 0.01
_LifeTime = 20
#lp3
_j = 1
_x = (getpos _obj) select 0
_y = (getpos _obj) select 1
_z = (getpos _obj) select 2
_Size = [10,10]
#lp4
_pos = [_x + (_j * sin _theta * cos _phi),_y + (_j * sin _theta * sin _phi),_z + (_j * cos _theta)]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_j = _j + (-5*(_j/_max)) + 5
_Size = [10 - (10*(_j/_max)),10 - (10*(_j/_max))]
?(_j < (_max/1.1)) : goto "lp4"
_theta = _theta - (random 20) + 10
_phi = _phi - (random 20) + 10
_i = _i + 1
?(_i < _n) : goto "lp3"

This looks suitable for a laserguidedbomb detonation, I'm thinking about doing artillery fire as much smaller vertical clouds but with much more of the vertical debris trails. Any thoughts?

I'm just surprised there aren't any effects addons that contain scripts for this kind of thing.

Share this post


Link to post
Share on other sites

Seems pretty good. Maybe try adding some little variance to the smoke buff colors. At the moment all the particles are of the same color so it doesn't look really natural.

The single mission Down by Sarge Studio had some custom explosion effects which you might be interested in. You can find the mission along with the effects addOn here: http://ofp.gamepark.cz/index.php?showthis=7907&newlang=eng

Share this post


Link to post
Share on other sites

Thanks for that, I've seen the fuel explosion script before but not the other effects.

I've put some random colours and alpha control into the script which improves things slightly although it depends on whether you're using the original cl_basic or a modified version as to how far you can go with the colours.

So the bomb script is now:

;Object for centre of cloud
_obj = _this select 0

;density of vertical column (bigger = less dense), e.g. 20
_Zoffset = _this select 1

;height of vertical column e.g. 100
_max = _this select 2

;speed of base smoke ring e.g. 5
_vel = _this select 3

;density of base smoke ring (denser means more clouds) e.g. 30
_thetaMax = _this select 4

_ShapeName = "cl_basic"
_AnimationName = ""
_Type = "Billboard"
_TimerPeriod = 1
_LifeTime = 60
_pos = getpos _obj
_MoveVelocity = [0,0,0]
_RotationVelocity = 0
_Weight = 1.279
_Volume = 1
_Rubbing = 0.01
_Size = [50,50,50,50]
_Colour0 = [0.5,0.5,0.5,1]
_Colour1 = [0.5,0.5,0.5,0.9]
_Colour2 = [0.5,0.5,0.5,0.8]
_Colour3 = [0.5,0.5,0.5,0.7]
_Colour4 = [0.5,0.5,0.5,0.5]
_AnimationPhase = [0,1,0]
_RandomDirectionPeriod = 5
_RandomDirectionIntensity = 0.05
_OnTimer = ""
_BeforeDestroy = ""
_Object = ""
_Size = [0,75,100,150]
_LifeTime = 0.1
_pos set [2, 20]
_ret = "det1"
_alpha0 = 1
_alpha1 = 0.95
_alpha2 = 0.9
_alpha3 = 0.85
_alpha4 = 0
goto "recolour"
#det1
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_Size = [150,125,75,50]
_LifeTime = 60
_ret = "det2"
goto "recolour"
#det2
~0.1
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_Size = [50,50]
_pos = getpos _obj
_ret = "lp"
goto "recolour"
#lp
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_z = (_pos select 2) + _Zoffset
_Size = [50 - _z/8, 50 - _z/4, 50 - _z/4, 50 - _z/4]
_pos set [2, _z]
~0.01
?(_z < _max) : goto "recolour"
_pos set [2, 2]
_Size = [40, 1]
_theta = 360/_thetaMax
_i = 0
_Weight = 1.285
_Rubbing = 0
_LifeTime = 15
_ret = "lp2"
#lp2
_MoveVelocity = [_vel * cos _i,_vel * sin _i,0]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_i = _i + _theta
?(_i < 360) : goto "lp2"
_MoveVelocity = [0,0,0]
_max = _max * 1.25
; azimuth
_phi = random 360
; inclination
_theta = random 20
; number of 
_n = 1 + random 5
_i = 0
_Weight = 1.279
_Rubbing = 0.01
_LifeTime = 20
_ret = "lp4"
_alpha0 = 1
_alpha1 = 0.7
_alpha2 = 0.5
_alpha3 = 0.3
_alpha4 = 0
#lp3
_j = 1
_x = (getpos _obj) select 0
_y = (getpos _obj) select 1
_z = (getpos _obj) select 2
_Size = [10,10,10,10]
#lp4
_pos = [_x + (_j * sin _theta * cos _phi),_y + (_j * sin _theta * sin _phi),_z + (_j * cos _theta)]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_j = _j + (-5*(_j/_max)) + 5
_sizeoffset = 10 - (10*(_j/_max))
_Size = [_sizeoffset,_sizeoffset,_sizeoffset,_sizeoffset]
_Rubbing = random 0.05
?(_j < (_max/1.1)) : goto "recolour"
_theta = random 20
_phi = random 360
_i = _i + 1
?(_i < _n) : goto "lp3"
exit
#recolour
_gscale = 0.45 + (random 0.1)
_Colour0 = [_gscale,_gscale,_gscale,_alpha0]
_gscale = 0.45 + (random 0.1)
_Colour1 = [_gscale,_gscale,_gscale,_alpha1]
_gscale = 0.45 + (random 0.1)
_Colour2 = [_gscale,_gscale,_gscale,_alpha2]
_gscale = 0.45 + (random 0.1)
_Colour3 = [_gscale,_gscale,_gscale,_alpha3]
_gscale = 0.45 + (random 0.1)
_Colour4 = [_gscale,_gscale,_gscale,_alpha4]
goto _ret

And the artillery shell script is:

;Object for centre of cloud
_obj = _this select 0

;density of vertical column e.g. 5
_Zoffset = _this select 1

;height of vertical column e.g. 50
_max = _this select 2

; setup particle array
_ShapeName = "cl_basic"
_AnimationName = ""
_Type = "Billboard"
_TimerPeriod = 1
_LifeTime = 30
_pos = getpos _obj
_MoveVelocity = [0,0,0]
_RotationVelocity = 0
_Weight = 1.277
_Volume = 1
_Rubbing = 0
_Size = [50,50,50,50]
_Colour0 = [0.5,0.5,0.5,1]
_Colour1 = [0.5,0.5,0.5,0.9]
_Colour2 = [0.5,0.5,0.5,0.85]
_Colour3 = [0.5,0.5,0.5,0.8]
_Colour4 = [0.5,0.5,0.5,0.75]
_AnimationPhase = [0,1,0]
_RandomDirectionPeriod = 0
_RandomDirectionIntensity = 0
_OnTimer = ""
_BeforeDestroy = ""
_Object = ""
; Detonation cloud
_Size = [0,20,50,70]
_LifeTime = 0.1
_pos set [2, 10]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
; persistant detonation cloud
_Size = [70,40,30,20]
_LifeTime = 60
~0.1
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
; vertical column
_Size = [20,20,20,20]
_pos = getpos _obj
_Weight = 1.285
_LifeTime = 30
#lp
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_z = (_pos select 2) + _Zoffset
_sizeoffset = 20 - (_z/8)
_Size = [_sizeoffset, _sizeoffset, _sizeoffset, _sizeoffset]
_pos set [2, _z]
~0.01
?(_z < _max) : goto "lp"

; vertical debris trails

_Colour0 = [0.5,0.5,0.5,1]
_Colour1 = [0.5,0.5,0.5,0.7]
_Colour2 = [0.5,0.5,0.5,0.5]
_Colour3 = [0.5,0.5,0.5,0.3]
_Colour4 = [0.5,0.5,0.5,0]
_MoveVelocity = [0,0,0]
_max = _max * 1.25
; azimuth
_phi = random 360
; inclination
_theta = random 30
; number of trails
_n = 5 + random 5
_i = 0
_Weight = 1.279
_Rubbing = 0.01
_LifeTime = 20
#lp3
_j = 1
_x = (getpos _obj) select 0
_y = (getpos _obj) select 1
_z = (getpos _obj) select 2
_Size = [10,10]
#lp4
_pos = [_x + (_j * sin _theta * cos _phi),_y + (_j * sin _theta * sin _phi),_z + (_j * cos _theta)]
drop [_ShapeName,_AnimationName,_Type,_TimerPeriod,_LifeTime,_pos,_MoveVelocity,_RotationVelocity,_Weight,_Volume,_Rubbing,_Size,[_Colour0,_Colour1,_Colour2,_Colour3,_Colour4],_AnimationPhase,_RandomDirectionPeriod,_RandomDirectionIntensity,_OnTimer,_BeforeDestroy,_Object]
_j = _j + (-3*(_j/_max)) + 3
_sizeoffset = 5 - (5*(_j/_max))
_Size = [_sizeoffset,_sizeoffset,_sizeoffset,_sizeoffset/2]
_Rubbing = random 0.01
?(_j < (_max/1.1)) : goto "lp4"
_theta = random 30
_phi = random 360
_i = _i + 1
?(_i < _n) : goto "lp3"

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×