lago 0 Posted March 24, 2004 Hi guys, I'm trying to make an intro scene. I have done a search and thought I did it right. Still no luck. So here is what I do, I start the editor in advance setting. I place a player on the map and name him LAGO and in his INIT I put [] exec "intro.sqs". Then I open the intro part and make my intro scene with some units using names like actor1 actor2 to point the cam at. Then I write the "intro.sqs" in the notebook and save it to the mission. I then go back to the mission part and save it as a SP mission. When I try to play it sometimes I only get a scene that has the lone player (LAGO) in the scene or it plays the scene and ends but then has me in the water somewhere for the mission. Do you make a cutscene the same way? How is that done? I quess I need a step by step way of doing this because I'm pulling my hair out over this. Many thanks to anyone who can help Share this post Link to post Share on other sites
MrZig 0 Posted March 25, 2004 What I do, is where I want to get my cam at is click on the unit, and put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this exec "camera.sqs" do NOT make a camera.sqs, and exec it that exact way, and now when you have a good angle, press CTRL or whatever your shoot button is. Now in intro.sqs it should look something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera = "camera" camcreate [0,0,0] _camera cameraeffect ["internal", "back"] ;=== 21:24:05 _camera camSetTarget [-59959.63,69319.07,-10328.35] _camera camSetPos [12400.62,1085.44,4.37] _camera camSetFOV 0.700 _camera camCommit 0 @camCommitted _camera Now you can create more angles ect, and if you change camcommit 0 to say 4/5, it'll take longer to get to that spot, basicly a "moving" camera. Then at the end of your intro.sqs, put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera cameraeffect ["terminate", "back"] camdestroy _camera exit If you have msn/icq I can give you some examples and teach you through the basics if you want Share this post Link to post Share on other sites
Balschoiw 0 Posted March 25, 2004 Quote[/b] ]put [] exec "intro.sqs". Then I open the intro part and make my intro You mix something up here. When you use intro button in editor you create intro on the map with camers from triggers or waypoints. When you change back to mission and save to singleplayer Intro will be executed autmatically. You don´t need to call it with a script. You only have to place cameras via triggers or waypoints in INTRO section of editor. If you call a Intro script from ini you don´t have to make intro in editor as it is executed by script. So if you activate both, one from editor, one via script that cill most likely cause problems. Do one method only. Share this post Link to post Share on other sites
MrZig 0 Posted March 25, 2004 Shit I musta missed that when reading his post. Share this post Link to post Share on other sites
lago 0 Posted March 26, 2004 Thanks guys Got it working now. The intro.sqs was for how the cam was to work it's like the one MrZig had written. I wasn't saving to the SP missions then looking at it. How dumb is that. Just one more thing, is a cut scene made in the intro also and just save it as cutscene.sqs and then trigger it in the mission? Thanks again Share this post Link to post Share on other sites
bmgarcangel 0 Posted March 26, 2004 do NOT make a camera.sqs, and exec it that exact way, and now when you have a good angle, press CTRL or whatever your shoot button is. wats the shoot button? Share this post Link to post Share on other sites
MrZig 0 Posted March 26, 2004 The intro part is just for when you load up the mission, so your intro doesn't hog up resources for your actual play time. Share this post Link to post Share on other sites
MrZig 0 Posted March 26, 2004 do NOT make a camera.sqs, and exec it that exact way, and now when you have a good angle, press CTRL or whatever your shoot button is. wats the shoot button? Ummm, left mouse button? Ctrl? Share this post Link to post Share on other sites
lago 0 Posted March 26, 2004 MrZig where would you make a cutscene to put in the middle of a mission? Share this post Link to post Share on other sites
MrZig 0 Posted March 26, 2004 Please re-phrase that as I have no idea what you mean. Share this post Link to post Share on other sites
lago 0 Posted March 26, 2004 OK I have the intro working before the mission starts. Now I want to have a scene while I'm in the mission. Like when you finish the first objective the scene starts and tells you about the second objective. Is this done by using the units in the mission and writing a camera.sqs to be triggered at the first objective? Basicly a cutscene somewhere in the mission. Share this post Link to post Share on other sites
joltan 0 Posted March 26, 2004 Just start the cutscene script from your objective's trigger. As I'm too lazy now, here's a short cut 'n paste from a cutscene tutorial I wrote ages ago: Quote[/b] ]How to do nice cutscenes/intros?There's differents ways of doing camera movements, but the best and most flexible is scripting. Looking at camera scripts can be a bit of a shock to someone new to this, but as with the images this is quite easy: First there's a big difference between MP and SP intros/outros. While Singleplayer missions have the intros/outros as seperate mission files, they can only be realized as cutscenes in MP missions. I'll concentrate on cutscenes in this tutorial. Now how to do cutscenes by scripting, how to start them, what to consider? First - do not start the cutscene from the init.sqs (a script that, if in the mission folder, gets executed automatically at mission start), but start the script from the initline of a unit that is NOT controlled by a player. The reason: init.sqs may contain a lot of stuff not related to the cutscene and should therefore be executed in parallel, so that the cutscene starts right away. As I always include a gamelogic called 'server' in my missions to seperate server-only instructions from client-side instructions, I usually start the intro script from the gamelogics init line. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "mpintro.sqs"; I'll use the intro script ffrom one of my missions (Winter Night) as an example for a simple intro script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">enableradio false showcinemaborder true _camera = "camera" camcreate [10483.03,10058.88,72.89] _camera cameraeffect ["internal","back"] ;=== 17:22:43 _camera camSetTarget [101380.20,-28120.18,16889.95] _camera camSetPos [10483.03,10058.88,72.89] _camera camSetFOV 0.355 _camera camCommit 0 @camCommitted _camera cutText [" ","Black in",1] playmusic "track14" TitleRsc ["MissionTitle","plain",1] ~1 ;=== 17:23:02 _camera camSetTarget [23636.47,104990.69,-28392.60] _camera camSetPos [10483.03,10058.88,72.89] _camera camSetFOV 0.655 _camera camCommit 7 @camCommitted _camera cutText [" ","Black out",0.5] ~0.5 ;=== 17:24:04 _camera camSetTarget [-82755.14,-24836.77,-8364.44] _camera camSetPos [10535.15,10169.02,1.15] _camera camSetFOV 0.578 _camera camCommit 0 @camCommitted _camera TitleRsc ["MissionTitle2","plain",1] cutText [" ","Black in",1] ~1 ;=== 17:24:20 _camera camSetTarget [-80024.23,52190.37,5830.19] _camera camSetPos [10536.78,10167.95,1.41] _camera camSetFOV 0.578 _camera camCommit 4 @camCommitted _camera ~2 cutText [" ","Black out",2] ~2 showcinemaborder false player cameraeffect ["terminate","back"]; camdestroy _camera cutText [" ","Black in",1] enableradio true exit Now let's do this step by step: first: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">enableradio false showcinemaborder true This turns off the radio messages, and adds the cinematic borders (the black stripes on the top and bottom of the screen) to make it look more movie-like. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera = "camera" camcreate [10483.03,10058.88,72.89] _camera cameraeffect ["internal","back"] This creates the camera called '_camera' at position [10483.03,10058.88,72.89] and sets the viewpoint for the camera - ["internal","back"] is the standard and apart from some very special applications should be fine for all cutscenes. How I got the position's coordinates I'll explain later, but as we are just creating the camera and move it later to the desired position you could also enter something like [1,1,1] and it would be fine. I prefer to create the camera right on the spot where I will use it later, but that's more style than nescesity. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camSetTarget [101380.20,-28120.18,16889.95] _camera camSetPos [10483.03,10058.88,72.89] _camera camSetFOV 0.355 _camera camCommit 0 @camCommitted _camera Ok, now this is where it starts to get interesting! The above block is one camera move. First I define the target of the camera (an object or, as in this case, the direction the camera will be facing - don't worry if you dont get the numbers - I'll explain later how to easily set this), and set the target position of the camera (where to move it to). The I set the FOV (field of vision) for the camera. Then I define how long the camera will take to change to the new settings. '0' is instantly, '8' would be 8 seconds. That way camera movements can be realized (see below). Finally '@camCommited _camera' halts the script until the camera has finished. To make it more interesting we start with a black screen, fade in, start some music and show a picture (see the image tutorial), then the script waits for one second (the time we defined in the 'cutText [" ","Black in",1]' line as last parameter) until the 'black in' (=fade) is finished: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cutText [" ","Black in",1] playmusic "track14" TitleRsc ["MissionTitle","plain",1] ~1 Now lets move the camera: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camSetTarget [23636.47,104990.69,-28392.60] _camera camSetPos [10483.03,10058.88,72.89] _camera camSetFOV 0.655 _camera camCommit 7 @camCommitted _camera cutText [" ","Black out",0.5] ~0.5Again a camera block, this time with a new target and new coordinates (where to move and what to face at the end of the camera move). Also FOV changes during camera move - we'll get a wider field of vision. With the '_camera camCommit 7' line we define the camera to translate to the new position over the time of 7 seconds - all intermediary steps will then be calculated by OFP, and we do not have to worry about them. Finally we wait until the camera move has finished, then fade out over the time of 0.5 seconds (just to smooth the transition a bit) and wait until the fade out has finished. Next scene: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camSetTarget [-82755.14,-24836.77,-8364.44] _camera camSetPos [10535.15,10169.02,1.15] _camera camSetFOV 0.578 _camera camCommit 0 @camCommitted _camera TitleRsc ["MissionTitle2","plain",1] cutText [" ","Black in",1] ~1 We set the camera to a new position (this time instantly - so no transition), then show a new title image and fade in over 1 second. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camSetTarget [-80024.23,52190.37,5830.19] _camera camSetPos [10536.78,10167.95,1.41] _camera camSetFOV 0.578 _camera camCommit 4 @camCommitted _camera ~2 cutText [" ","Black out",2] ~2 Ok, another camera move - this time only 4 seconds, but after we reached the target we wait 2 seconds, then fade out slowly. Having a short wait at the end makes it easier for people to watch it, as it seems less hectic. Hard breaks are good for action scenes (like the switching between the dead russians in my PatrolDuty mission), but at the end even in that kind o cutscenes a slow fade out will make the switch back to player control more comfortable. Ok, now the cut scene is finished, but we still have to 'tidy up': <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player cameraeffect ["terminate","back"]; camdestroy _camera cutText [" ","Black in",1] showcinemaborder false enableradio true exitFirst we destroy the camera, causing the vision to switch back to the default camera - the player. Then I fade in - as I just did a 'black out' the screen is black, and without fading in again it would stay black. So don't forget to do this. At the end the cinematic border gets removed and the radio messages enabled again. Now how did I get all these coordinates and cameraviews without working myself to death? Easy - OFP offers a simple mechanism to facilitate the creation of camera scripts. When you are setting up a cutscene, first place all nescessary units, then insert in the init line of one unit the following command 'this exec "camera.sqs"'. When you start the mission you will have a camera that you can move around, zoom in/out and point wherever you want - and you can save the settings to a text file. How to use this? - "A", "W","E","S","D" move the camera around horizontally - "PageUp" and "PageDown" move it vertically - Arrow keys turn the camera and point it up/down - "+" and "-" zoom in/out - Space bar locks the camera to a target (not the position, but it will always point at the target) - Control saves the camera settings The settings are saved in a file called clipboard.txt in the main OFP directory. There you can copy the ready to use camera blocks out and paste them in your scripts! Additional hints: How to have a camera follow an object? Here's a part of the intro to 'Find The Chopper', where the camera follows the helicopter on it's flight to desaster: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_campos=[-10,-5,10] _camera camSetTarget introchopper _camera camSetRelPos _campos _camera camSetFOV 0.200 _camera camCommit 0 @camCommitted _camera cutText [" ","black in",2] ~2 cutText ["0330 Nogova - Russian occupied territory\nRecon flight Delta Blue returning back to base","plain down"] _n=0 #camloop _camera camSetTarget introchopper _camera camSetRelPos _campos _camera camSetFOV 0.200 _camera camCommit 2 @camCommitted _camera _n=_n+1 ;continue cam move? ?(_n<=10):goto "camloop" First I define the relative position and write that to a variable. It's in relative coordinates to the center and direction of the target object (distances in meters). Then I set the chopper as target and the position to my relative coordinates. After showing the cutText a loop starts that gets executed 10 times (=20 secoonds as the camera move inside always takes 2 seconds). Of course I also could loop until a trigger is toggled or any other condition is fulfilled. In the loop the camera gets always set to a new target position and starts to move there over the next two seconds. As the chopper is moving quite fast the camera will trail behind the chopper even if the coordinates aren't that far from the chopper. If I wanted to follow it more closely with sharper movements, I'd need to reduce the time for the camera moves - resulting in sharper and faster camera movements. cutText/titleText and cutRSC/titleRSC.: Both ...Text commands do exactly the same, as do the two RSC commands. By having two different commands some nice effects are possible - like showing text while the screen fades in/out or having two image resources on the screen (title over binocs view for example). cut Text terminates any previous cutText/cutRSC command immediately and vice versa - same as for the title... commands. Share this post Link to post Share on other sites
lago 0 Posted March 27, 2004 Thanks alot guys I can now make intros and cut scenes Share this post Link to post Share on other sites
MrZig 0 Posted March 27, 2004 Awesome. I don't like following cars ect though, I only like static stuff lol.. Share this post Link to post Share on other sites
Hamza 0 Posted August 7, 2004 I am also having troubles with them cameras in movies. I dont have any clue about how to use scripts so im trying with those triggers. As I set the camera to zoom in on a unit it zooms to close on their legs and not on their face. Is there any way to adjust the hight on the trigger or camera to make it look right? I suck at scripting. On joltans post I dont understand what those number are eg: camera = "camera" camcreate [10483.03,10058.88,72.89] _camera cameraeffect ["internal","back"] And where do i type all this? Share this post Link to post Share on other sites
macguba 0 Posted August 7, 2004 Forget triggers for camera work, they just make it harder in the long run. Â Read snYpir's Intro to Camera Scripting and then messiah's camera.sqs tutorial. If you are completely new to scripts - which are very easy to create and use - read snYpir's A Friendly Intro to Code Snippets and Johan Gustafsson's Scripting Tutorial Share this post Link to post Share on other sites