Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
CrAzY-CrAsH

Cam qustion

Recommended Posts

hey peeps

just 1 quistion dose any1 know the script codes for on bord vehicle cams and stuff like that???

sorry about spelling

CrAzY-CrAsH

Share this post


Link to post
Share on other sites

Okay well l smuggled this out of that other site (which seems to be re-decorating at the moment.  So, haven't tried it but perhaps it will help you.

_

; concept by Turok_GMT, modified by snYpir

; syntax:

; [<name of vehicle>, <name of unit to target>,

;  <[xoffset,yoffset,zoffset]><relative to vehicle?>] exec "vehiclecam.sqs"

; example:

; [heli, dilbert,[0,0,-10],false] exec "vehiclecam.sqs"

; get camera vehicle and target

_unit = _this select 0

_target = _this select 1

; u can change the positional offsets for the camera (these are relative to the vehicle)

; x offset

_camoffsetX = (_this select 2) select 0

; y offset

_camoffsetY = (_this select 2) select 1

; z offset

_camoffsetZ = (_this select 2) select 2

; do u want your offsets to be relative to the vehicle?

_camrelative = _this select 3

; clear the variable that will stop this script

vehiclecamstop = false

; create a camera

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

_cam cameraeffect ["internal", "back"]

; now create a loop to continuously update the cam's pos

; so it appears to be attached to the vehicle

#loop

_newpos = getpos _unit

; set posn not relative to vehicle?

? NOT(_camrelative) : _cam camsetpos [(_newpos select 0) + _camoffsetX, (_newpos select 1) + _camoffsetY, (_newpos select 2) + _camoffsetZ]; goto "commit"

; set posn relative to vehicle

_cam camsettarget _unit

_cam camsetrelpos [_camoffsetX,_camoffsetY,_camoffsetZ]

#commit

_cam camcommit 0

; aim camera at target

_cam camsettarget _target

_cam camcommit 0

; insert a small update time to avoid anychance of any nasty

; infinity loop errors

~0.01

; perform an if test to see if _stop has been set to true

; of not, do another lap of the loop

? NOT(vehiclecamstop) : goto "loop"

; the loop ends here when vehiclecamstop gets set to true by either

; a trigger or a waypoint's "on activation" field

; once loop had ended, kill the camera and return control to

; player

_cam cameraeffect ["terminate", "back"]

camdestroy _cam

exit

_

Well l tried it, and it does work.....cept, error comes up ;

_target = _this select 1 this line error, but it continues to work. Play with this line; [heli, dilbert,[0,0,-10],false] exec "vehiclecam.sqs" to get your camera view. If your not in heli. -10 with show you the undercarrage of vehicle

smile.gif ps; vehiclecamstop = true in a trigger to stop it. (but l guess you can read)....

Share this post


Link to post
Share on other sites

Depending on the effect you're looking for, you'll achieve smoother rendering if you let the position update camCommit's float a bit - say by 0.1 or 0.2 seconds.

This is a good trick where you are viewing from cameras which you are manually camSetPos'ing via a fast loop.

Prospero

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  

×