Jump to content

Photo
- - - - -

Missile Cam From any Air vehicle?


  • Please log in to reply
3 replies to this topic
Thread Starter
wika_woo
wika_woo

    Master Gunnery Sergeant

  • Members
  • 1076 posts

  • Joined: 26-February 2007

Posted 11 May 2007 - 21:43 #1

Hi, When any type of missile is launched from a hind or any other aircraft, what camera script would i use ?..

I want the Camera to follow the missile  all the way to it's target.

I tried searching.

please help.



Thanks.




Posted Image

Mandoble
Mandoble

    Warrant Officer

  • Members
  • 2021 posts

  • Joined: 10-November 2005

Posted 11 May 2007 - 22:45 #2

Use a fired eventhandler to get the missile object and then execute this, for example:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
;mando_predicam.sqs
;Parameters:
; Object to follow
; Horizontal camera distance to object
; Angle from where the camera tracks the object (0 = same dir as object, 90 right, 180 back, 270 left)
; Vertical camera distance to object
; Maximum time to keep the camera ON in seconds
; Return to previous camera true/false
;
;Example:
;Follow plane1, and try to keep the camera 10 meters back to the object and 2 meters higher:
;[plane1, 10, 180, 2]exec"mando_predicam.sqs"

_unit = _this select 0
_rangex = _this select 1
_ang = _this select 2
_rangey = _this select 3
_maxtime = _this select 4
_return = _this select 5


_ground = "logic" createVehicle [0,0,0]
_delay = 0.05
_posu = getPos _unit
showCinemaBorder false
_angf = (getDir _unit)+_ang
_pos = [(_posu select 0)+sin(_angf)*_rangex, (_posu select 1)+cos(_angf)*_rangex, (_posu select 2)+_rangey]


_cam = "camera" camcreate [0, 0, 0]
_cam cameraeffect ["internal", "back"]

_cam camSetPos _pos
_cam camSetTarget _unit
_cam camSetFov 1.0
_cam camCommit 0


mando_predicam = true
_timecur = 0.0
#follow
_posu = getPos _unit
_asl1 = getPosASL _unit select 2
_vel = velocity _unit
_asl2 = _asl1+(_vel select 2)*_delay + _rangey
_angf = (getDir _unit)+_ang
_posc = [(_posu select 0)+(_vel select 0)*_delay+sin(_angf)*_rangex, (_posu select 1)+(_vel select 1)*_delay+cos(_angf)*_rangex,_asl2]
_ground setPos [_posc select 0, _posc select 1, 0]
_asl3 = getPosASL _ground select 2
_alt = _asl2 - _asl3
_posc = [_posc select 0, _posc select 1, _alt]
_cam camSetPos _posc
_cam camCommit (_delay+0.5)
~_delay
_timecur = _timecur + _delay
?(_timecur < _maxtime) && mando_predicam && (!isNull _unit):goto "follow"
~2
#endcamera
?_return:_cam cameraeffect ["terminate", "back"]
camDestroy _cam
deleteVehicle _ground
~2
mando_predicam = false
exit
[/QUOTE]

Thread Starter
wika_woo
wika_woo

    Master Gunnery Sergeant

  • Members
  • 1076 posts

  • Joined: 26-February 2007

Posted 11 May 2007 - 22:56 #3

woah.. Sorry for being noobish.

I've never edited a mission in that kind of style. Only using the in-game editor.

You'll have to tell how to do it, by embedding it into the mission file using notepad?..

Posted Image




Posted Image

Mandoble
Mandoble

    Warrant Officer

  • Members
  • 2021 posts

  • Joined: 10-November 2005

Posted 11 May 2007 - 23:47 #4

Then you may start looking for scripting in the BIS WIKI.