OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Skanderborgvej on 11 May 2004, 19:35:17

Title: Follow it
Post by: Skanderborgvej on 11 May 2004, 19:35:17
Does anyone know a script that allows you to follow a bullet/missile (to be used in a cutscene ofcourse)?

Thanks...  ;)

GRTZ
Title: Re:Follow it
Post by: Blanco on 11 May 2004, 22:17:03
Try this

Put this in the init of your unit
Code: [Select]
this addeventhandler ["fired",{_this exec "Follow.sqs"}]
then the followscript
Code: [Select]
;follow.sqs
_shooter = _this select 0
_ammo = _this select 4

_projectile = nearestObject [_shooter, _ammo]


?!alive _shooter : exit


?_ammo != " What ammotype should I follow?" : exit


_shooter removeeventhandler ["fired",0]

#start
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]
_camera camsettarget _projectile
_camera camsetfov 1
_camera camsetrelpos [0,-3,0]
_camera camcommit 0

#projectileloop
?isnull _projectile : goto "destroycam";
_camera camsettarget _projectile
_camera camsetrelpos [0,-3,0]
_camera camcommit 0
goto "projectileloop"

#destroycam
_camera camsetfov 1.8
_camera camcommit 0
@camcommitted _camera
~2
_camera cameraeffect ["terminate","back"]
Camdestroy _camera

_shooter addeventhandler ["fired",{_this exec "follow.sqs"}]
exit



btw : Vlaamse, ik ben ook Vlaams... Ze zullen hem ni te-emmen...
Title: Re:Follow it
Post by: Skanderborgvej on 12 May 2004, 12:59:08
Hey thanks a lot!!!  :-*

Jaja ze zullen hem idd nooit temmen....  ;D

GRTZ