Home   Help Search Login Register  

Author Topic: Follow it  (Read 465 times)

0 Members and 1 Guest are viewing this topic.

Skanderborgvej

  • Guest
Follow it
« 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

Offline Blanco

  • Former Staff
  • ****
Re:Follow it
« Reply #1 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...
« Last Edit: 11 May 2004, 22:20:19 by Blanco »
Search or search or search before you ask.

Skanderborgvej

  • Guest
Re:Follow it
« Reply #2 on: 12 May 2004, 12:59:08 »
Hey thanks a lot!!!  :-*

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

GRTZ