OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Mandoble on 03 Mar 2007, 22:18:52

Title: Mid air explosions
Post by: Mandoble on 03 Mar 2007, 22:18:52
What works in OFP doesnt in ArmA:

Code: [Select]
_dir = getDir player
_pos = [(getPos player select 0)+sin(_dir)*100,(getPos player select 1)+cos(_dir)*100, 100]
_b1 = "Bo_GBU12_LGB" createVehicle _pos
_b2 = "Bo_GBU12_LGB" createVehicle _pos
exit

So how to create a big explosion in the middle of the air?
Title: Re: Mid air explosions
Post by: FreeBird on 03 Mar 2007, 22:33:33
Try this:

Code: [Select]
_relPos = [0,0,100]
_pos = player modelToWorld _relPos
_b1 = "Bo_GBU12_LGB" createVehicle (_pos)
 

Edit:this creates a bomb,not an explosion.
It explodes when the bomb hits the ground.
Title: Re: Mid air explosions
Post by: Mandoble on 03 Mar 2007, 22:44:37
May be I didnt explain the problem too clearly. The target is to create a mid air explosion, a mid air boom.
Title: Re: Mid air explosions
Post by: h- on 04 Mar 2007, 10:05:19
Weird..
It seems that somehow the bombs just won't collide with each other.. :dunno:

Tested a whole lotta more different ordnance and none of them work in this scenario..
Title: Re: Mid air explosions
Post by: Mandoble on 04 Mar 2007, 10:20:58
SetDammage 1 doesnt affect ordenance either  :dunno:
Title: Re: Mid air explosions
Post by: Mandoble on 05 Mar 2007, 09:10:57
Found a workaround that works based on an static object named "Bomb" as detonator, it seems to work well with any ordenance:

Code: [Select]
_dir = getDir player
_pos = [(getPos player select 0)+sin(_dir)*200,(getPos player select 1)+cos(_dir)*200, 50]

_b2 = "Bomb" createVehicle _pos
_b2 setPos _pos
_b1 = "M_Ch29_AT" createVehicle _pos
~0.05
deleteVehicle _b2
exit

Still 0.05 secs wait is needed before deleting the "detonator" object.
Title: Re: Mid air explosions
Post by: satexas69 on 06 Mar 2007, 19:39:19
Mandoble,

Can you give an example of how to use that script?

Thanks
Title: Re: Mid air explosions
Post by: Mandoble on 06 Mar 2007, 20:08:32
Init field of player unit:
Code: [Select]
this addAction ["Test explosion", "test_explosion.sqs"]
test_explosion.sqs
Code: [Select]
_dir = getDir player
_pos = [(getPos player select 0)+sin(_dir)*200,(getPos player select 1)+cos(_dir)*200, 50]

_b2 = "Bomb" createVehicle _pos
_b2 setPos _pos
_b1 = "M_Ch29_AT" createVehicle _pos
~0.05
deleteVehicle _b2
exit