OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ponq on 01 Jul 2004, 14:44:41

Title: Slow down a bullet
Post by: ponq on 01 Jul 2004, 14:44:41
Hi,

I'm trying to add some fx to a bullet.
Therefor I add an eventhandler "fired" which triggers a script.

the script catches the bullet, but I want the bullet to slow down.

I seem to be able to "grab" the bullet, but once I set the velocity it abrubtly changes direction.

here's the code I have:
Code: [Select]
_Missile = nearestObject [vehicle(player), _this select 4]
? isNull  _Missile : exit
_Type= typeOf _Missile

; adjust velocity of missile
_velx = velocity _missile select 0
_vely = velocity _missile select 1
_velz = velocity _missile select 2
_velz = 2

_missile setvelocity [_velx, _vely, _velz]

anyone have a clue on how to make the bullet travel slow, while keeping it's line (not falling down cos of the low speed)?
Title: Re:Slow down a bullet
Post by: ponq on 01 Jul 2004, 16:22:58
stupid me just changed the z-speed....ofcourse I have to change all speeds in all directions.
Code: [Select]
_velx = _velx / 10
_vely = _vely / 10
_velz = _velz / 10