Home   Help Search Login Register  

Author Topic: need help with camera.sqs basics  (Read 3394 times)

0 Members and 1 Guest are viewing this topic.

Offline gator

  • Members
  • *
need help with camera.sqs basics
« on: 19 Jan 2009, 06:50:11 »
I really need help for ARMA cutscene making here I have read these three tutorials on making cutscenes for arma.

http://community.bistudio.com/wiki/Camera.sqs
http://www.suicidesquad.co.uk/forums/index.php?showtopic=559
http://www.ofpec.com/ed_depot/index.php?action=details&id=562&game=ArmA

All three of them somewhat say the same thing, but none of them really tell me from start to finish what I need to do. I understand that you make the unit with the  this exec "camera.sqs" to act as a camera, and that you move the camera around where you want it in preview, then hit the fire button to capture the image. after that you open note pad and paste the information  of the different shots. I have tried to save it as a .txt document as well as an .sqs document and then place that in my users missions folder of the mission I was working on. I have tried to make the trigger with radio alpha repetedly on act box then type  player exec "camera.sqs" and then erase the this exec "camera.sqs in the int field of the unit I used to capture the footage. as explained in this video http://www.ofpec.com/ed_depot/index.php?action=details&id=562&game=ArmA
I have also tried to delete the unit made to capture the footage and add
 _camera cameraEffect ["terminate","back"] camdestroy _camera at the end of the footage info in the .txt document as described in this tutorial http://www.suicidesquad.co.uk/forums/index.php?showtopic=559
Last but not least I have followed the http://community.bistudio.com/wiki/Camera.sqs tutorial step by step but all I ever get when I preview the mission using all the information in all three tutorials was the same thing which is, when I call radio alpha or activate the trigger, I am able to move the camera around as if I am taking more footage instead of watching the footage I have already captured. I want to make multiple short camera scenes through out the missions I make somehow using triggers as I used to be able to in OFP.
Example: I want to make a mission where you land at an LZ and have a cutscene there, then you link up with resistance in the hills, with a cutscene showing that happen when blufor is present. then another cutscene with the opfor killing a few civillians when blufor is detected by opfor, and then finally an outro scene of an extraction after all opfor have been eliminated. 
I have worked on this for two weeks now about 4 hours a night and cannot find out how to activate the footage I am shoting with the camera script, and even if I could figure that out I need to know how to make several different pieces of footage work on the triggers at different times in the game as stated above.
PLEASE help me, and once I figure it out I vow to make a DETAILED tutorial from START TO FINISH on how to do this and post it so its not so hard for others to figure out. I will give credits everyone who helped when I get that far.
Thank you for your time,
Gator [XDF] clan

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: need help with camera.sqs basics
« Reply #1 on: 19 Jan 2009, 15:57:20 »
Welcome to OFPEC!
When you use the camera.sqs trick this is for setting up the shot. The camera coordinates are saved in the clipboard.txt file or in your paste buffer. You take those coordinates and stuff them into another camera script. This can be called anything... like  CamScene1.sqf. Then you can use a trigger to call that script player execvm "Camscene1.sq1" when its appropriate. Feel free to check to out some missions in the beta boards, Situation Critical in the MP beta board has an excellent cut scene. In short the camera.sqs  trick is used just to capture cam positions.
Your camera positions must go into  a sqf or sqs file.

Here is a small sample of one of mine.

Code: [Select]
//create camera
_cam = "camera" camcreate [0,0,0];
_cam cameraeffect ["internal", "back"];
b2arrive = false;

// Follow chopper overhead
_cam camPrepareTarget getpos aa1;
_cam camPreparePos [(getPos aa1 select 0), (getPos aa1 select 1), (getPos aa1 select 2) + 10];
_cam camPrepareFOV 1.000;
_cam camCommitPrepared 0;
waituntil {camCommitted _cam};

...more camera commands...

... eventually you have to kill the camera...

// end cutscene;
_cam cameraeffect ["terminate", "back"];
camdestroy _cam;
// fade back in over 2 seconds
titlecut [" ","BLACK IN",2];

« Last Edit: 19 Jan 2009, 16:01:59 by hoz »
Xbox Rocks

Offline gator

  • Members
  • *
Re: need help with camera.sqs basics
« Reply #2 on: 20 Jan 2009, 08:14:21 »
Thank you for the information. I have worked on it again tonight for a few hours and think I am pretty close to solving my problems. However it still does not work. I have gathered that the camera.sqs is a tool used to take the footage, and that once you have the info you mae a script out of it by pasting it in notebook and making it an sqs file. After that its like any other script and you put it in your users mision folder. You then have to activate it using a trigger, which I have tried to do.
Example: the SQS file I created I named death. after I put it in the users missions folder I go back to the editor and create a trigger. I make the trigger radio alpha, repetedly, and on the activation box I put this exec "death.sqs"  This should execute the script called death which is the footage I have made, whenever i call radio alpha.  However it does nothing at all. I then tried to rename the script from death.sqs to death (without the.sqs) I preview and now get an error that says script death.sqs not found. I thought well I might need to add a description.ext file to get it to work, that did nothing to help. I thought maybe i need to save and export to single player mission for it to work either. I then restarted arma and tried all of the above restarting the game each time and still nothing. I would think it would be as simple as activating a script with a trigger, wich as you can see out of all the methods I described above should have done just that. There has to be one little thing that I am overlooking or doing wrong here.
Here is what my script looks like...
;=== 1:29:10
_camera camPrepareTarget [-18387.17,-33764.62,-90777.59]
_camera camPreparePos [2546.25,2529.52,10.53]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera
_camera cameraEffect ["terminate","back"]
camdestroy _camera
« Last Edit: 20 Jan 2009, 08:16:54 by gator »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: need help with camera.sqs basics
« Reply #3 on: 20 Jan 2009, 08:28:02 »
If that's the entire script, you're missing the creation of the camera before it.

Code: [Select]
//create camera
_camera = "camera" camcreate [0,0,0];
_camera cameraeffect ["internal", "back"];

;=== 1:29:10
_camera camPrepareTarget [-18387.17,-33764.62,-90777.59]
_camera camPreparePos [2546.25,2529.52,10.53]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

_camera cameraEffect ["terminate","back"]
camdestroy _camera

Save it as 'whatever_filename.sqs' and run it from the trigger using

Code: [Select]
[] exec "whatever_filename.sqs"
Welcome to the sometimes frustrating, always rewarding world of editing  ;)
« Last Edit: 20 Jan 2009, 08:38:22 by bedges »

Offline gator

  • Members
  • *
Re: need help with camera.sqs basics
« Reply #4 on: 21 Jan 2009, 06:54:13 »
ok I added the create cam to my script and tried it. It is still saying that the sqs is not found. I even copied and pasted what you had put in here as the scipt but still nothing. I placed a trigger after deleting the old one and put [] exec "intro.sqs" in the act. box on the trigger, still nothing. I then made another mission on another map  but the same thing. when you say [] exec "whatever_filename.sqs" what you mean by that is if the .sqs file name is intro then I would put [] exec "intro.sqs" right? or is there something I am not doing there?

I noticed you had whatever underscore file name.sqs, and not just filename.sqs which makes me think maybe I am leaving the whatever out....if that makes any sence. in anycase I am getting the same thing over and over again. I put the .sqs file in the users name/ missions folder /mission name folder, and double check that its there but still get the same message.

When I save the .sqs file in notepad I name it intro.sqs but when it saves it the name comes out as intro (without the .sqs on the end) Does it have to say .sqs on the end of the name if my activation is [] exec "intro.sqs"???? I have tried it both ways and one way dosent do anything where as the other way I get the script "intro.sqs"not found error. Do I need to reboot arma when testing after I insert the .sqs file into the mission? Thanks for your continued help.
« Last Edit: 21 Jan 2009, 08:43:20 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: need help with camera.sqs basics
« Reply #5 on: 21 Jan 2009, 08:42:56 »
It could be that Notepad is saving your file as 'intro.sqs.txt'. I can't recall precisely how to switch this off - it may be as simple as selecting "All files" from the "Save as type" dropdown when saving the camera script.

As for your other questions, it doesn't matter what you call the file: it can be filename.sqs, camera_script.sqs, my_great_movie_for_my_mission.sqs - so long as the filename uses standard characters (and no spaces) it'll be fine.

Don't lose heart - we'll get to the bottom of the problem eventually, and the feeling you'll have when you see that cutscene running... priceless ;)

EDIT - it also occurs to me that if you're not seeing a file extension after 'about', you may need to change a folder setting. When viewing the folder contents, select Tools > Folder options... > View > Hide extensions for known file types - make sure that box is not ticked.
« Last Edit: 21 Jan 2009, 09:00:22 by bedges »

Offline gator

  • Members
  • *
Re: need help with camera.sqs basics
« Reply #6 on: 21 Jan 2009, 15:23:48 »
I messed with it again all night last night and have narrowed it down to  not being able to create a cmera, and then not having the script flow from command to command. I looked here http://www.multiplayer.it/forum/the-player/60177-scritping-etcetera.html undercamera scripting in english to better understand what all the mumbo jumbo in the script means. I do not know why when I create the footage using this exec "camera.sqs" does not put the camCreate on there but as you saw on the post I had earlier when you noticed I didnt have a camera created.....it didnt. I copied and pasted your corrections but still nothing. However if I go into the file and add
titlecut ["test ", "black in", 2]
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
and then the footage I have recorded using the camera.sqs I finally get a cutscene that starts with the word test as I have places inbetween the quotations. The only thing is that it creates a cam over the ocean and it never goes on to the actual footage I have recorded or the mission. after deleting and adding different stuff this is what I come up with
;=== 3:03:15
_cam = "camera" camcreate [101549.56,14280.00,5.39]
_cam cameraeffect ["internal", "TOP"]
_camera camPrepareTarget [101549.56,14280.00,5.39]
_camera camPreparePos [2240.34,2546.25,0.35]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera
camdestroy _cam
titlecut [" ","BLACK OUT",2]
I can replace the [101549.56,14280.00,5.39] in camcreate with [0,0,0] and it is still over the ocean ad does nothing. however if I replace it with [2240.34,2546.25,0.35] instead I actually get a picture near my target, though its in the grass and the camera does nothing and the mission is still not able to be played. So as I stated before It has to be that I am not creating my cam right and that I am not bleding iit in so that it reads from cam create to footage and then cam destroy. do you see in my scrip where I am messing up? thank you  for your help

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: need help with camera.sqs basics
« Reply #7 on: 21 Jan 2009, 15:32:52 »
Aha, it's the old issue - you create the camera using the variable _cam, but you give the instructions to the variable _camera. They both need to be the same variable.

Code: [Select]
;=== 3:03:15
_camera = "camera" camcreate [101549.56,14280.00,5.39]
_camera cameraeffect ["internal", "TOP"]

_camera camPrepareTarget [101549.56,14280.00,5.39]
_camera camPreparePos [2240.34,2546.25,0.35]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

camdestroy _camera
titlecut [" ","BLACK OUT",2]
« Last Edit: 21 Jan 2009, 15:34:24 by bedges »

Offline gator

  • Members
  • *
Re: need help with camera.sqs basics
« Reply #8 on: 22 Jan 2009, 05:24:26 »
once again I spent hours tonight. This is so frustrating because it is a have to thing and I know I am just over looking something so silly. I copied and pasted what you postted and did a ton of other thigs taking away and adding things to try to make it work. I get the cam going now and its not over the sea anymore, it is somewhat in the area I want it to start, but it just sits there. there is no movement and no ending to it. I know the problem is that in the script it is creating the camera but not reading the rest of the script that tells it what to do and then terminate. I dont know how to tell it to go to the next command. I tried putting this ; after every line thinking that might be the problem but its not. When I shoot my footage shouldnt the camera.sqs tool put in the create cam and the destrroy cam for me? or at least the create cam? If it is supposed to then it sure isnt. Anyway I have made another very simple shot and mission. all the cam should do is spin around from its starting position 180 degres (sometimes it starts filming behind the civilian for some reason) and then zoom in to the soldier. I will post exactly what the camera.sqs script captured and if I can get you to put a create cam and destroy cam on here, exactly the way it needs to be so I can copy, paste get it to work, then study it then I would be very greatful.   Here goes nothing...

;=== 23:11:23
_camera camPrepareTarget [5717.24,-97443.56,15.07]
_camera camPreparePos [2545.09,2462.89,2.00]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

That is what was recorded by the camera.sqs, thank you so much for your dedication you have been wonderful.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: need help with camera.sqs basics
« Reply #9 on: 22 Jan 2009, 05:43:38 »
Paste or attach your camera script. This will let us see what is exactly up.
Xbox Rocks

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: need help with camera.sqs basics
« Reply #10 on: 22 Jan 2009, 09:03:33 »
To have the camera actually do something you need to give it at least two commands. You create the camera, put it in its starting position (first command) and then give it a new position/target (second command). The key is the time it takes to complete the second command.

So a complete script could be:

Code: [Select]
; create the camera - it doesn't matter where you create it
   _camera = "camera" camcreate [0,0,0]
   _camera cameraeffect ["internal", "TOP"]

; move the camera to its first position
   _camera camPrepareTarget [101549.56,14280.00,5.39]
   _camera camPreparePos [2240.34,2546.25,0.35]
   _camera camPrepareFOV 0.700
   _camera camCommitPrepared 0
; since the first command is prepared in zero seconds, it needs no @camCommitted

; the second command - changing position and/or target and/or FOV
   _camera camPrepareTarget [5717.24,-97443.56,15.07]
   _camera camPreparePos [2545.09,2462.89,2.00]
   _camera camPrepareFOV 0.700
   _camera camCommitPrepared 10
; notice that the camCommitPrepared value is 10 - that means the camera will take 10 seconds to move from the first position to the second position

; now you need the @camCommitted command because you want to wait until the camera has finished moving before issuing a new command
   @camCommitted _camera

; destroy the camera
   camdestroy _camera
   titlecut [" ","BLACK OUT",2]

Perhaps someone with ArmA could post a demo missionette so gator can see a working script in action?

Offline gator

  • Members
  • *
Re: need help with camera.sqs basics
« Reply #11 on: 24 Jan 2009, 09:28:42 »
 :clap: OK guys THANKS for helping me and staying ontop of this subject for so long. With your continued support I have been able to figure out what I need to know. I still have a bug somewhere because I get an error at the top left part of the screen when cutscene is playing about the camera destroy, but I can tinker with that without bugging you. SPECIAL THANKS TO HOZ AND BEDGES!!! Without them I would have never figured this out. once I get the eror figured out I am going to write a complete tutorial from shooting the footage to using it and playing the cutscenes, and Your names are going to take the credit for making it possible.
Thank you once again,
Gator