Home   Help Search Login Register  

Author Topic: Camera: Following a jet? Can this be done with camera sqs?  (Read 2390 times)

0 Members and 1 Guest are viewing this topic.

Offline Brandon

  • Members
  • *
Other than setting 2 destinations for 2 cameras and just speeding up the time one camera moves to another.. is there a way to make a camera slowly start to zoom into an aircraft while following it at 1000kmh? Holding shift in camera.sqs is not fast enough  :blink:

Sorry if I'm not as knowledgeable as I should be. I've owned OFP for 5+ years and still face problems with even the basics.

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #1 on: 14 Mar 2007, 22:28:59 »
Dunno if you checked this old ofp script out (vehicle cam) - may give you a push in the right direction :)
just setpos & forgetpos!

Offline Cheetah

  • Former Staff
  • ****
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #2 on: 14 Mar 2007, 23:23:19 »
That script would work fine, if you don't like reading it (with all the text and stuff that isn't really needed) you can use the following.

Code: [Select]
_i = 0;
#loop
_camera camPrepareTarget blabla;
_camera camPrepareRelPos [0,-7,2];
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
~0.01
?(_i == 300): goto "exit";
_i = _i + 1;
goto "loop"

You can copy and paste this into your fileName.sqs script with all the camera positions. Important things are that "blabla" is the name of the jet you want to follow. The RelPos might not fit your needs, you might want to play a bit with the numbers between the brackets (x,y,z).

Also note that there are many ways to stop the loop, I incorporated a counter might as well have checked for a variable to turn true (activated outside the script).
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Blanco

  • Former Staff
  • ****
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #3 on: 15 Mar 2007, 19:49:50 »
Quote
is there a way to make a camera slowly start to zoom into an aircraft while following it at 1000kmh?

Thats a hard one...
Vehiclecam follows the center of the object from a relative distance but you can't zoom in or out.
I have made a logiccam for OFP, it's similar to vehiclecam, but with logiccam you can film any part of the vehicle while it's moving. For example a closeup scene from a headlight while the vehicle is moving, but you can't zoom in or out.

It's still in the editor depot but it only works with OFP
http://www.ofpec.com/ed_depot/the_files/OFPResources/scripts/logiccam.zip

I tried to convert it for Arma but I failed.   :(

There is a new camera command for the fov
http://community.bistudio.com/wiki/camPrepareFovRange

Also the switchcamera command can be usefull
http://community.bistudio.com/wiki/switchCamera
 



Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #4 on: 15 Mar 2007, 20:21:22 »
And again, the commands are also available in our COMREF  :shhh:

camPrepareFovRange
switchCamera
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Blanco

  • Former Staff
  • ****
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #5 on: 15 Mar 2007, 20:28:58 »
ok, ok I will direct them to our comref next time.
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #6 on: 15 Mar 2007, 21:27:41 »
 :yes:

I just see no point in directing people out from here when the same stuff is here already... 
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Cheetah

  • Former Staff
  • ****
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #7 on: 15 Mar 2007, 23:17:09 »
Code: [Select]
_i = 0;
_zoom = 0.700;
#loop
_camera camPrepareTarget blabla;
_camera camPrepareRelPos [0,-7,2];
_camera camPrepareFOV _zoom;
_camera camCommitPrepared 0
~0.01
?(_i == 300): goto "exit";
_i = _i + 1;
_zoom = _zoom - 0.01;
goto "loop"

Something like this? You might have to play with the number, don't know if it works.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Blanco

  • Former Staff
  • ****
Re: Camera: Following a jet? Can this be done with camera sqs?
« Reply #8 on: 16 Mar 2007, 04:03:12 »
Yes thats works.  :) I tried similar stuff in OFP and it never worked.

I tried to create a script from your code:

Params
1-- camera ID
2-- Camrelpos array
3-- Target to film
4-- Zoomfactor when the scene starts
5-- Zoomfactor when the scene ends

Full example (run it in your camerascript)
[_camera,[10,0,2],myjeep,0.7,0.2] exec "script.sqs"

Quote
_cam = _this select 0
_target = _this select 1
_camrelpos = _this select 2
_startzoom = _this select 3
_endzoom = _this select 4
@!(VEHZOOM_ON)
VEHZOOM_ON = true

_xpos = _Camrelpos select 0
_ypos = _Camrelpos select 1
_zpos = _Camrelpos select 2

Cuttext ["","BLACK IN",1]

#scene
_cam camPrepareTarget _target;
_cam camPrepareRelPos [_xpos,_ypos,_zpos];
_cam camPrepareFOV _startzoom;
_cam camCommitPrepared 0
~0.001
_startzoom = _startzoom - 0.001;
?_startzoom < _endzoom : VEHZOOM_ON = false;goto "done"
goto "scene"

#done

~0.2
exit


It works but it's hard to control the duration of the scene.
It's far from perfect but it's a start  ;) It would be better in sqf, but I'm not there yet.

Check the example in the attachment









« Last Edit: 16 Mar 2007, 06:08:54 by Blanco »
Search or search or search before you ask.