Home   Help Search Login Register  

Author Topic: Camera scripting problem  (Read 1486 times)

0 Members and 1 Guest are viewing this topic.

Offline swtx

  • Members
  • *
Camera scripting problem
« on: 15 May 2007, 05:10:47 »
I'm trying to mount a fixed camera to an A10, but I'm having trouble.

I'm using this code:

Code: [Select]

;--Vehicle-cam----------------------------------------------------------

vehiclecamstop = false
#loop

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

_cam cameraeffect ["internal", "front"]

_cam camsettarget A10

_cam camsetrelpos [0, 5, 10]

#commit
_cam camcommit 0


_cam camsettarget A10
_cam camcommit 0

~0.01

? NOT(vehiclecamstop) : goto "loop" 


_cam cameraeffect ["terminate", "back"]
camdestroy _cam


Everytime I execute the script I get a pretty shot of the ocean.

Is there anyway I can fix this ?

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
Re: Camera scripting problem
« Reply #1 on: 15 May 2007, 07:53:34 »
Code: [Select]
_cam camsettarget A10
i believe you see the pretty ocean because Arma is looking for an object called A10 and can't find it...try renaming the jet. (or chaning the script to reflect the aircrafts NAME/not what kind it is.)

Also this is a must read for cutscene makers:
http://www.ofpec.com/forum/index.php?topic=28923.0
« Last Edit: 15 May 2007, 07:57:15 by D_P_ »
just setpos & forgetpos!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera scripting problem
« Reply #2 on: 15 May 2007, 10:09:05 »
Create the camera before your loop starts, not inside your loop.

Offline IGWedge

  • Members
  • *
  • Internal Coordinator @ www.ic-arma.com
    • International Conflict Armed Assault
Re: Camera scripting problem
« Reply #3 on: 24 May 2007, 20:16:06 »
Hi

How can i camera follow vehicle script to SQF format??

I am still not grasping the transition from goto "loop" ..... into SQF

can someone explain or point me in the right direction.

PS i have read through Cheetas Basic SQS tut

thanks
« Last Edit: 24 May 2007, 20:19:05 by IGWedge »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Camera scripting problem
« Reply #4 on: 24 May 2007, 20:35:05 »
Something quite basic to start with:

Code: [Select]
//followplane.sqf
_plane = _this select 0;
keepfollowing = true;
_cam = "camera" camcreate [0, 0, 0];
_cam cameraeffect ["internal", "back"];
_relpos = [-25, 10, 5];
_cam camSetRelPos _relpos;
_cam camSetTarget _plane;
_cam camSetFov 1;
_cam camCommit 0;
while {keepfollowing} do
{
   _cam camSetRelPos relpos;
   _cam camCommit 0.2;
   Sleep 0.01;
};
_cam cameraeffect ["terminate", "back"];
camDestroy _cam;

To execute:
Code: [Select]
res=[myplane]execVM"followplane.sqf"
Note that you may set global variable keepfollowing to true in case you want to stop the script.

Offline IGWedge

  • Members
  • *
  • Internal Coordinator @ www.ic-arma.com
    • International Conflict Armed Assault
Re: Camera scripting problem
« Reply #5 on: 24 May 2007, 20:42:58 »
Thats excellent mate thanks

I can learn from what you have showed me

Cheers

wedge :D

Offline swtx

  • Members
  • *
Re: Camera scripting problem
« Reply #6 on: 26 May 2007, 10:03:50 »
Thanks for your help gents, problem solved  :good: