Jump to content
Sign in to follow this  
BLSmith2112

Camera.sqs target missle/bomb?

Recommended Posts

How can I have a camera.sqs target a missile or bomb launched from a vehicle? The camera could follow ordinances in OFP.. but I don't know how I would go about doing this.

Share this post


Link to post
Share on other sites

This works for me, camera is attached to any object a unit can fire, drop like bullets, bombs, rockets, grenades,...

1- This in the players init :

Quote[/b] ]this addEventHandler ["fired",{_this exec "projectilecam.sqs"}]

2- Projectilecam.sqs

Quote[/b] ]_proj = nearestObject [vehicle(player), _this select 4]

? isNull _proj : exit

_Type= typeOf _proj

_offsetX = 0

_offsetY = -4

_offsetZ = .2

_cam = "camera" camcreate [0,0,0]

_cam cameraeffect ["internal", "back"]

#loop

_cam camsettarget _proj

_cam camsetrelpos [_offsetX,_offsetY,_offsetZ]

_cam camsetfov 0.4

_cam camcommit 0

? isnull _proj : _cam cameraeffect ["terminate", "back"];goto "end"

goto "loop"

#end

camdestroy _cam;

exit

I'm working on a target practice mission with bullettime, here are a few movies from the script in action :

http://www.mediafire.com/?8jtmyrmyhrg

http://www.mediafire.com/?azmmmlzj43n

http://www.mediafire.com/?edddamadzgu

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×