Home   Help Search Login Register  

Author Topic: pointing camera  (Read 720 times)

0 Members and 1 Guest are viewing this topic.

dan ick

  • Guest
pointing camera
« on: 05 May 2005, 22:26:17 »
Hey people,

So im a little confused,with the cam.sqs,is it possible to place a camera on say an invisible h 3m above ground,now i can do that,but the bit i cant do is make it face a building or a man(instead of facing down or up or whatever).I have spent most of tonite reading page after page of tuts and faqs and that is the honest truth,but im just not gettin.
There was somethin i seen that had a fair few numbers in it,but it was a bit confusing.
Please help i am a noob in desperate need.

Thanks Dan ;D
« Last Edit: 05 May 2005, 22:37:36 by dan ick »

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:pointing camera
« Reply #1 on: 05 May 2005, 22:41:02 »
Code: [Select]
_cam camsettarget A_Game_Locic_Or_Units_Name
That will make it look at whatever units name you put in.
I like your approach, lets see your departure.
Download the New Flashlight Script!

dan ick

  • Guest
Re:pointing camera
« Reply #2 on: 05 May 2005, 23:14:43 »
k,Thanks

But how would i have it set at a game logic,but looking at a another soldier or vehicle or building.Please help

_cam camsettarget dan
_cam camsetrelpos [0,0,1.9]
_cam camcommit 0

If dan was my gamelogic,how would i get the cam to stay at dan but watch a unit walk past or a car.


Once again thanks ;D

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:pointing camera
« Reply #3 on: 06 May 2005, 12:50:18 »
not sure what you are asking...is this the answer:

_cam camSetTarget unit you watching
_cam camSetPos getpos dan
_cam camSetFOV 0.700
_cam camCommit 0
@camCommitted _cam

if the unit you are watching is dan, and dan is moving, then try this script:
Code: [Select]
; 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"
cutText ["","BLACK OUT",.01]

; 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"]
_cam camsettarget _unit
cutText["","BLACK IN",2]
; 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

one other note.....you shouldn't name your script camera.sqs.  That is the name of an embedded script in the game, I like to name my scripts something like movie.sqs instead.  Using the embedded camera.sqs is a powerful and easy way to make your movie.sqs once you get the hang of it though

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:pointing camera
« Reply #4 on: 06 May 2005, 13:06:43 »
Try Blanco's loggicam script, that might be what you are after.
Plenty of reviewed ArmA missions for you to play

Offline 999chris

  • Members
  • *
  • I'm a llama!
Re:pointing camera
« Reply #5 on: 06 May 2005, 15:37:04 »
Thiswill work...

Code: [Select]
_cam camsettarget THE GAME LOGIC
_cam camsetrelpos [POS,IT,ION] << RELATIVE TO LOGIC
_cam camsettarget WHAT YOU WANT TO LOOK AT
_cam camcommit 0
@camcommitted _cam
« Last Edit: 06 May 2005, 15:38:33 by 999chris »

dan ick

  • Guest
Re:pointing camera
« Reply #6 on: 07 May 2005, 02:45:13 »
 ;D ;D 8)

Thanks Guys,

All 3 replys are very useful,Thanks.
I did have another read through the FAQ's and forums this morning and i understood a bit more,I think yesterday my brain as good as overheated.Theres just so much to learn i love it :-*.
BTW,dont know whether this is the right place to post this,but is it possible to get married to a computer game,nothing big i was thinking the registery office or something. :P
Anyways i shut up now.

Once again THANKS for the replys.

Dan
« Last Edit: 07 May 2005, 02:45:55 by dan ick »