OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: foolscap on 18 May 2004, 20:38:00

Title: Parabombs! Help!
Post by: foolscap on 18 May 2004, 20:38:00
Can anyone think of a better way to create this script because the position between the bomb and the parachute changes depending on the terrain. If the launch-vehicle is over the sea then the bomb will be above the parachute but if the launch-vehicle is over high terrain the bomb is way below the parachute!

Quote
_unit = _this select 0

#start

_unitX = (getPos _unit) select 0
_unitY = (getPos _unit) select 1
_unitZ = (getPos _unit) select 2
_unitDir = getDir _unit

_para = "Parachute" createVehicle [_unitX, _unitY, _unitZ]
_para setDir _unitDir
_bomb = "LaserGuidedBomb" camCreate [_unitX, _unitY, _unitZ -1]
_bomb setDir _unitDir

#paramove

_bombX = (getPos _bomb) select 0
_bombY = (getPos _bomb) select 1
_bombZ = (getPos _bomb) select 2

_para setPos [_bombX, _bombY, _bombZ]

#bombmove

_paraX = (getPos _para) select 0
_paraY = (getPos _para) select 1
_paraZ = (getPos _para) select 2

_bomb setPos [_paraX, _paraY, _paraZ + 30]

_bomb moveinCargo _para

#loop

?(not (alive _bomb)) : goto "exit"

goto "loop"

#exit

deleteVehicle _para
exit

cheers
Title: Re:Parabombs! Help!
Post by: Zombie on 19 May 2004, 12:27:31
Still haven't had enough coffee this morning, but this script from the editors depot should be a lot of help:  OK, I haven't figured out how to link to it, but it is the Transporting and Paradropping objects topic in the editors depot.


You don't need to move the bomb in to the chute, just keep updating the posistions of the bomb and chute
Title: Re:Parabombs! Help!
Post by: foolscap on 19 May 2004, 14:08:14
yeah i know i pasted an old version of the script the latest one does exactly whaty you suggested by the problem still occurs ???
Title: Re:Parabombs! Help!
Post by: Unnamed on 19 May 2004, 19:48:26
Quote
If the launch-vehicle is over the sea then the bomb will be above the parachute but if the launch-vehicle is over high terrain the bomb is way below the parachute!

Sounds like the parachute is being positioned relative to the terrain, but not the bomb. You could try camcreating the parachute instead of createvehicle?

Or use Vektorboson's terrain height above sea level function to adjust the parachute:

Code: [Select]
Private ["_currunit","_result","_sensor"];

_CurrUnit = _This Select 0;

_Result=0;

_sensor = "EmptyDetector" createVehicle [0,0,0];
_Sensor SetPos [(GetPos _CurrUnit) Select 0,(GetPos _CurrUnit) Select 1,0];
_Result=(GetPos _Sensor) select 2;

DeleteVehicle _Sensor;

_Result
Title: Re:Parabombs! Help!
Post by: foolscap on 23 May 2004, 17:38:12
I eventually got around it by making a new addon with the LGB model attacting that to the para until below 1 metre then camcreating a real LGB and deleting the para and fakeLGB

thanks for your help