OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Homefry31464 on 22 Jan 2005, 02:57:39

Title: Set a bomb's speed
Post by: Homefry31464 on 22 Jan 2005, 02:57:39
Alright, here is my problem.  I've got a bomb that I have camcreated under a plane, and I need it to have the same speed as the plane, and moving in the same direction.  How would I go about doing this?  ???
Title: Re:Set a bomb's speed
Post by: Blanco on 22 Jan 2005, 03:39:24
Quote
_strikeplane = _this select 0
_strikeplane sideChat "Target aquired"

_numberofbombs = 4
_i = 0

#loop
_bomb = "laserGuidedBomb" camCreate [(getPos _strikeplane select 0)+((random 10)-5),(getPos _strikeplane select 1)+((random 10)-5),(getPos _strikeplane select 2)-3]
_bomb setDir (getDir _strikeplane)
_bomb setVelocity [(velocity _strikeplane select 0)*0.2,(velocity _strikeplane select 1)*0.2,(velocity _strikeplane select 2)*0.2]
_i = _i + 1
~0.2
? _i < _numberofbombs : goto "loop"

_strikeplane sideChat "Bombs dropped"

exit