OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Mandoble on 03 Mar 2007, 22:18:52
-
What works in OFP doesnt in ArmA:
_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?
-
Try this:
_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.
-
May be I didnt explain the problem too clearly. The target is to create a mid air explosion, a mid air boom.
-
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..
-
SetDammage 1 doesnt affect ordenance either :dunno:
-
Found a workaround that works based on an static object named "Bomb" as detonator, it seems to work well with any ordenance:
_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.
-
Mandoble,
Can you give an example of how to use that script?
Thanks
-
Init field of player unit:
this addAction ["Test explosion", "test_explosion.sqs"]
test_explosion.sqs
_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