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

Basic camera workings?

Recommended Posts

Would someone be kind enough to give a brief run thru of the recording aspect of camera.sqs? I get how to start the camera, I just don't get how to actually record and then watch it or better yet add it as my intro. I've been looking at old tutorials all morning and I used to 'get it' though I thought I remember it being much easier than it seems now.

Old age :(

Edit- I can move the camera around and learned to press fire to get camera position coordinates then paste those coords. into camerscript.sqs but after that I'm lost.

Edited by froggyluv

Share this post


Link to post
Share on other sites

I can explain the (advanced) base:

//replace positionA with a position.
_camera = "camera" CamCreate positionA;
//set a camera effect.
_camera cameraEffect ["internal","back"];

//replace positionTargetStart with a position.
_camera camPrepareTarget positionTargetStart;
//we prepare a position, replace positionStart with a location.
_camera camPreparePos positionStart;
//we set a FOV of 0.7.
_camera camPrepareFOV 0.700;
//we instantly commit the actions.
_camera camCommitPrepared 0;

//We wait until camera has commited the given actions.
WaitUntil {camCommitted _camera};

//replace positionTargetEnd with a position.
_camera camPrepareTarget positionTargetEnd;
//replace positionEnd with a position.
_camera camPreparePos positionEnd;
_camera camPrepareFOV 0.700;
//we prepare the camera for a commit of 6 seconds.
_camera camCommitPrepared 6;
//we wait untill the camera has commited
waitUntil {camCommitted _camera};

...

Share this post


Link to post
Share on other sites

Thanks but that seems a little above my pay grade:D

I took your code and named it "cam3.sqs", then put 'player exec "cam3.sqs" 'in my player's init field but nothing happened. When I put 'player exec "camera.sqs" ', I get the camera crosshairs but what actually records? Is it a button or a script or both? Blah, I'm confused!

Share this post


Link to post
Share on other sites

Put it in a file called init.sqf at the root of your mission (YourDocs\ArmA2\Missions\myMissioName\init.sqf). i can provide a demo on cherna if you want:

Just don't take in count _preload.

 
_camera = "camera" CamCreate [6941.13,2527.27,5];
_camera cameraEffect ["internal","back"];
_preload = [] spawn {waitUntil{preloadCamera [6941.13,2527.27,5]}};

_camera camPrepareTarget [-58707.62,-91363.78,-747.77];
_camera camPreparePos [6941.13,2527.27,1];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
WaitUntil {camCommitted _camera};
titleCut["", "BLACK in",2];
_camera camPrepareTarget[58465.95,-31641.83,-747.47];
_camera camPreparePos [6941.13,2527.27,5];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 6;
waitUntil {camCommitted _camera};

Share this post


Link to post
Share on other sites

What I can't figure out is cut scenes. The tutorials don't seem to cover cutscene activation, of course I could've missed it.

For example, I'd like a quick scene to play part way through the mission when I approach a police officer standing in a building. I tried to do it via a trigger when I get with in 10m of him but nothing happens.

Any suggestions? I know how to work the camera.sqs I and set up an intro scene but I can't figure out how to get cutscenes to play.

Share this post


Link to post
Share on other sites

@Benny- ok, I did that and I'm getting the blackbox cinema effect and the camera crosshair but is the camera recording? And how do I transfer this to become an intro? I'm used to just hitting f9 or whatever in fraps so I know it's recording -lol

Share this post


Link to post
Share on other sites

@froggyluv What do you mean by recording, viewing a scene ingame with the camera tool or recording a video sequence from the game with some tools like fraps? Otherwise i never knew that you could record scene with the camera scripts ^^.

@Manzilla put a trigger with a condition like:

player in thislist

and an activation on:

myCameraScriptName.sqf

Share this post


Link to post
Share on other sites
@froggyluv What do you mean by recording, viewing a scene ingame with the camera tool or recording a video sequence from the game with some tools like fraps? Otherwise i never knew that you could record scene with the camera scripts ^^.

QUOTE]

No I meant i'm just not used to scripts for recording a scene to then watch ingame. I can get the camera setup, I see camera crosshairs, but from there how do I capture footage and convert that into an Intro is really the question I'm asking.

Basically I already have a mission finished. I now want to create a scene that explains the plot of the mission, so I have all the characters loaded on a 'fresh map' and the camera is there as well as waypoints etc... Do I just load the scene with the camera there and then save it as intro.sqs?

Edited by froggyluv

Share this post


Link to post
Share on other sites

Not sure if i understand it at all, what do you clearly want to do with the camera?, you need to light me up a bit (heh it's late here ^^). Capture random stuffs (battles, AI/CAR following,...)? You want the camera to be used at the begining of the mission ?

Share this post


Link to post
Share on other sites

^^^ Thats probably because what I'm asking is so simple that your like 4 steps ahead of me :D

Actually, I think it was the init file that is doing what I was wondering, that being: Start the mission in a cutscene, because before I was using the init., the mission would start normal, rather than cutscene. So your init is working, just not in the camera position I needed of course, but i think I'll be able to figure that out. Sorry to confuse you mate :rolleyes:

Share this post


Link to post
Share on other sites

@Manzilla put a trigger with a condition like:

player in thislist

and an activation on:

myCameraScriptName.sqf

Thanks for the help Benny.. The activation part doesn't seem to work though. I get an error when creating the trigger that says "missing ;".

Share this post


Link to post
Share on other sites

@froggyluv: no problems ^^, bind the camera to an action in your menu.

Copy the init.sqf into a camera.sqf, then make init.sqf clear, and then:

player addAction ["Enable Camera Script 1","camera.sqf"];

This will give you an action in your menu, whenever you'll use it, you'll be able to enabled the camera part ;)

@Manzilla: Ah nvm, i forgot to add the full execution steps, it's more like:

Activation(for an SQF Camera script):
[]ExecVM "cameraScript.sqf";

or

Activation(for an SQS Camera script):
[]Exec "cameraScript.sqs"

Share this post


Link to post
Share on other sites
@froggyluv: no problems ^^, bind the camera to an action in your menu.

Copy the init.sqf into a camera.sqf, then make init.sqf clear, and then:

player addAction ["Enable Camera Script 1","camera.sqf"];

This will give you an action in your menu, whenever you'll use it, you'll be able to enabled the camera part ;)

@Manzilla: Ah nvm, i forgot to add the full execution steps, it's more like:

Activation(for an SQF Camera script):
[]ExecVM "cameraScript.sqf";

or

Activation(for an SQS Camera script):
[]Exec "cameraScript.sqs"

Beautiful, it works! Thanks again.

Share this post


Link to post
Share on other sites

Thanks Benny. I think the misunderstanding came from my forgetting that your actually not 'recording -replaying' when creating a cutscene but rather encapsulating a set scene with cinematic effects to give the impression that it is actually a recording.

Everything you gave me works except I guess the code you gave for the init. takes the camera far away from the player. The 'enable camera' feature is cool but it still just takes me away. I'm going to read up more now that I understand the init., and learn more about the camera positioning and what not.

Cheers!

Share this post


Link to post
Share on other sites

I need the camera to hold longer on my first scene so I entered this:

 ;=== 12:15:56
_camera = "camera" camCreate [-80028.77,52415.49,-432.81]
_camera camPrepareTarget [-80028.77,52415.49,-432.81]
_camera camPreparePos [6575.53,2410.71,6.68]
_camera camPrepareFOV 0.700
_camera camCommitPrepared [b]5[/b]
_camera cameraEffect ["internal", "back"]
@camCommitted _camera
~5

;=== 12:41:17
_camera = "camera" camCreate [-19613.37,-93075.78,13887.36] 
_camera camPrepareTarget [-19613.37,-93075.78,13887.36]
_camera camPreparePos [6578.15,2430.05,2.00]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
_camera cameraEffect ["internal", "back"]
@camCommitted _camera

...but when I change the _camCommitPrepared to 5 the scene starts off with a camera spinning out of control in some obscure area. If I reset the value to 0 it works but again it doesn't stay on the desired scene long enough.

Share this post


Link to post
Share on other sites

I am going to make a quick inquiry in this thread instead of starting a new one. When you are entering all of the positions for the camera (such as in this code excerpt: "_camera camPrepareTarget [-19613.37,-93075.78,13887.36]"), where are you getting the values? Also, is it possible to replace those numeric values with variables (such as a marker name or a unit name)?

Thanks,

~Greg

Share this post


Link to post
Share on other sites
I am going to make a quick inquiry in this thread instead of starting a new one. When you are entering all of the positions for the camera (such as in this code excerpt: "_camera camPrepareTarget [-19613.37,-93075.78,13887.36]"), where are you getting the values? Also, is it possible to replace those numeric values with variables (such as a marker name or a unit name)?

Thanks,

~Greg

You get those values as soon as you hit the left mouse button while in camera.sqs -alt/tab out and you can paste them accordingly.

Share this post


Link to post
Share on other sites

Anyone know how to switch camera scripts by trigger?

For example, I have cam1.sqs running until bob activates a trigger and sets off cam.2 sqs.

Just placing:this exec "cam2.sqs' in the trigger's activation box doesn't end cam1.sqs

---------- Post added at 12:19 AM ---------- Previous post was Yesterday at 10:58 PM ----------

I tried the Terminate script with:

script = []Execvm "cam1.sqs"; Terminate script; this exec "cam2.sqs"

in the trigger activation box but it CTD's everytime.

Share this post


Link to post
Share on other sites

You don't have a semicolon after

this exec "cam2.sqs"

I have a question of my own. My camera script works beautifully and does everything I need it to. The only problem I have is that I can not end it.

Right now my script ends with this:

_camera CameraEffect ["TERMINATE","BACK"];
CamDestroy _camera;

But it is not doing anything. I have my camera script embedded into my init.sqf file, if that makes any difference.

Thanks.

Share this post


Link to post
Share on other sites

No it wasn't the semicolon, but I was doing everything wrong anyway. I was putting a 'camcreate' at the start of every position I wanted and that was screwing up everything. Alls good now.

I put your code at the end of my 'cam.sqs' script and it ended the camera fine. Not sure whats going on there...

Just noticed you put it in an sqf. file, that's probably part of the problem.

Share this post


Link to post
Share on other sites
Old age :( .

yep same here been 8 years since OFP :P

can remember faintly all the things i could do,

but how to do em again beats me

allot i do remember cause generally allot stayed the same

but reading this forum is slowly filling in the blanks :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×