Jump to content
Sign in to follow this  
Steaksauce1337

Scene.sqs help please

Recommended Posts

So I am trying my hand at camera for the first time and I can place cameras and get the angles I want, but when I run scene.sqs the camera never changes from the first point. Help would be appreciated.

this is what I have so far:

showcinenaborder false;

titlecut [" ","BLACK IN",1]

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

_camera cameraeffect ["internal", "back"]

showcinemaborder false;

;comment "0:19:57";

_camera camPrepareTarget helo;

_camera camPreparePos [627.89,1254.37,31.39];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 0

@camCommitted_camera

;comment "0:16:27";

_camera camPrepareTarget helo;

_camera camPreparePos [746.12,1187.28,5.58];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 5

@camCommitted_camera

_camera cameraeffect ["terminate","back"]

camdestroy _camera

end1=true;

exit;

So again any help would be nice. I've read all the tutorials I can find and wasted hours on this already.

Share this post


Link to post
Share on other sites

I see quite a few errors there man.

showcinenaborder false (spelling error)

@camCommitted_camera should be @ camCommited _camera

Here is a little snippet in sqf format.... hope it helps you.

1. In the mission editor place a helicopter....call it helo1

2. Then place a UAV..... call it uav1

3. In your mission folder create init.sqf and put this code in it....

sleep 5;

showcinemaborder false;

titlecut [" ","BLACK IN",1];
_camera = "camera" camcreate [0,0,0];
_camera cameraeffect ["internal", "back"];

//comment "0:19:57"
_camera camSetTarget helo1;
_camera camSetRelPos [5,5,2];
_camera camSetFOV 0.700;
_camera camCommit 0;
waituntil {camCommitted _camera};

sleep 5;

//comment "0:16:27";
_camera camSetTarget uav1;
_camera camSetRelPos [5,5,2];
_camera camSetFOV 0.700;
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

_camera cameraeffect ["terminate","back"];
camdestroy _camera;

Run the mission.

Edited by twirly
Fixed an error in my code

Share this post


Link to post
Share on other sites

that isn't what i'm after... The setrel will attach it to a vehicle and I do not want that. I want the camera to pan from 1 location to the next while still keeping the vehicle in the center.

I have made the corrections to spelling and the cameracreate syntax but for some reason it will not change to the next camera position. It should change 5 seconds after the first camera is set.

Share this post


Link to post
Share on other sites

It was an example for you to learn from! If you can't get the spelling and syntax right you can forget about trying to center the camera. That's the least of your problems!

EDIT: Added this.... all I did was move the camera without changing the target. The target now stays centered.

showcinemaborder false;

titlecut [" ","BLACK IN",1];
_camera = "camera" camcreate [0,0,0];
_camera cameraeffect ["internal", "back"];

//comment "0:19:57"
_camera camSetTarget whelo1;
_camera camSetRelPos [5,5,2];
_camera camSetFOV 0.700;
_camera camCommit 0;
waituntil {camCommitted _camera};

sleep 5;

_camera camSetRelPos [-5,-5,2];
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

_camera cameraeffect ["terminate","back"];
camdestroy _camera;

Edited by twirly

Share this post


Link to post
Share on other sites

Did not work, would not even execute. Did exactly as you said and pasted the syntax. Tried mine ... again.. and was able to get it running.. again, but I STILL cannot go from 1 cam to the other, that's all I want to do.. is that so difficult? Ready to give up on this one, seeing that a stupid cutscene doesn't really affect the mission.

titlecut [" ","BLACK IN",1]

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

_camera cameraeffect ["internal", "back"]

showcinemaborder false;

;comment "20:41:59"

_camera camPrepareTarget [man1];

_camera camPreparePos [636.40,1282.40,1.22];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 0;

@cameraCommitted _camera;

;comment "20:43:19"

_camera camPrepareTarget [man1];

_camera camPreparePos [644.36,1265.76,1.24];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 8;

@cameraCommitted _camera;

_camera cameraeffect ["terminate","back"]

camdestroy _camera

end1=true;

exit;

that is what I have and it will create and follow man1, but wont go to the next location or end..

Share this post


Link to post
Share on other sites

First off, you have a mix of SQS and SQF syntax. The two do not mix.

http://community.bistudio.com/wiki/SQF_syntax

http://community.bistudio.com/wiki/sqs

It is best to do everything in SQF, since SQS is deprecated, and also because since 1.59 the camera.sqs script outputs SQF instead of SQS.

Twirly's examples are in SQF.

The main things you need to change:

Every line must end in ;

Replace "@cameraCommitted _camera;" with "waituntil {camCommitted _camera};"

You must call SQF with 'execVM' and not 'exec' which is only for SQS. I don't know which way you're doing it, just putting it out there as a possible cause of problems. Hope this helps.

Share this post


Link to post
Share on other sites

Solved.. after help here and searching through the comref I was able to get this fixed and working sort of.... the rest I might be able to figure out on my own.

showcinemaborder false;

titlecut [" ","BLACK IN",1];

_camera = "camera" camcreate [0,0,0];

_camera cameraeffect ["internal", "back"];

comment "14:18:57";

_camera camSetTarget man1;

_camera camSetPos [636.87,1281.61,3.87];

_camera camSetFOV 0.700;

_camera camCommit 0;

waituntil {camCommitted _camera};

sleep 5;

;comment "14:36:52";

_camera camSetTarget man1;

_camera camSetPos [692.04,1241.83,0.79];

_camera camSetFOV 0.700;

_camera camCommit 5

waituntil {camCommitted _camera};

_camera cameraeffect ["terminate","back"];

camdestroy _camera;

For some reason when pasting location from camera.sqs it pastes the syntax as campreparepos instead of camsetpos, obviously wait until was needed also.. Sleep was also needed, oh and let me not forget the [ ] around coordnates need to be removed if you intend to set an object as the target.

Share this post


Link to post
Share on other sites

I'm having an issue with mine as well! The intro starts after the briefing screen but its looking into a mountain! I made the intro in single-player and then copied it over into my mission in the INTRO part using ctrl+shift+v to make sure its perfect...

Here is my script:

intro.sqf

showcinemaborder false;

titlecut [" ","BLACK IN",1];
_camera = "camera" camcreate [0,0,0];
_camera cameraeffect ["internal", "back"];


//comment "17:16:13";
_camera camPrepareTarget [1262.32,-45572.21,84844.93];
_camera camPreparePos [10432.49,6502.13,1.71];
_camera camPrepareFOV 0.700;
_camera camCommit 7.5;
waituntil {camCommitted _camera};

sleep 7.5;

//comment "17:19:57";
_camera camPrepareTarget [-40184.48,-60109.12,54740.09];
_camera camPreparePos [10433.90,6444.66,2.84];
_camera camPrepareFOV 0.700;
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

//comment "17:21:46";
_camera camPrepareTarget [10439.62,104336.99,20401.86];
_camera camPreparePos [10420.71,6411.94,0.78];
_camera camPrepareFOV 0.700;
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

_camera cameraeffect ["terminate","back"];
camdestroy _camera;

EDIT: Its seems that there must be something wrong with it..... I notice that when I run it, I see the black bars on top and bottom still so its executing, but not running correctly!

Edited by bigshotking

Share this post


Link to post
Share on other sites

Hi...

titlecut [" ","BLACK IN",1];
_camera = "camera" camcreate [[color="Red"]10432.49,6502.13,1.71[/color]];
_camera cameraeffect ["internal", "back"];

[color="SeaGreen"]showcinemaborder false;[/color]


//comment "17:16:13";
_camera camPrepareTarget [1262.32,-45572.21,84844.93];
_camera camPreparePos [[color="Red"]10432.49,6502.13,1.71[/color]];
_camera camPrepareFOV 0.700;
_camera camCommit 7.5;
waituntil {camCommitted _camera};

sleep 7.5;

//comment "17:19:57";
_camera camPrepareTarget [-40184.48,-60109.12,54740.09];
_camera camPreparePos [10433.90,6444.66,2.84];
_camera camPrepareFOV 0.700;
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

//comment "17:21:46";
_camera camPrepareTarget [10439.62,104336.99,20401.86];
_camera camPreparePos [10420.71,6411.94,0.78];
_camera camPrepareFOV 0.700;
_camera camCommit 5;
waituntil {camCommitted _camera};

sleep 5;

_camera cameraeffect ["terminate","back"];
camdestroy _camera;

You have to create the cam at the first pos not at 0,0,0...Otherwise it will take 7 seconds to go to the first pos. See red marking.

And (i think) showcinemaborder must be defined after creating the cam.

Share this post


Link to post
Share on other sites

Thanks for the reply will do! I will post back if it works or not!

EDIT: Ok, the camera spawns in the correct place now but.... the intro is not playing! Its spawning a camera in the actual mission no the intro! Any idea whats going on?

Edited by bigshotking

Share this post


Link to post
Share on other sites

What do you mean by mission, not intro? It just depends on where you start the sqf. :confused:

Share this post


Link to post
Share on other sites

Ok while making a mission you have a choice near the top right of the screen to put units down in; Intro, mission, Outro-Win, Outro-Lose.

The camera is spawning in the MISSION one, NOT the Intro one. That is my issue.

I tried to methods to call the intro.sqf

I put it in my init.sqf before the briefing like this:

if (!isDedicated) then {
 // Loadingtext
if (time < 20) then {
	[] spawn {
		waitUntil {!isNil "BIS_fnc_init"};
		// Info text
		["Mission Name", "May 13th, 2011", "Map"] spawn BIS_fnc_infoText;
	};
};
};

execVM "intro.sqf";
execVM "briefing.sqf";

//Init UPSMON scritp (must be run on all clients)
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";	

//Process statements stored using setVehicleInit
processInitCommands;
//Finish world initialization before mission is launched. 
finishMissionInit;

The other way I called it was through a trigger once you spawned. I placed the trigger on the spawn, detected by BLUFOR.

Con: this

On ACT: null = execVM "intro.sqf";

I also have a unit in the INTRO part of the mission, in his init I put this:

this exec "intro.sqf";

I also tried this

null = execVM "intro.sqf";

The third way doesnt even do anything, but the first 2 ways ended with the same result. Camera spawning in the MISSION part of the mission, not the INTRO part

-Bigshot

Edited by bigshotking

Share this post


Link to post
Share on other sites

Oh, alright. Im afraid i cant help you on that since i never used these intro/outro parts...

But i noticed the if (!isDedicated) then {in your code.

As far as i know the intro part of the mission in not working in multiplayer. :( Thats why im not using it...

Edit:

I found this:

http://community.bistudio.com/wiki/Initintro.sqs

Maybe you can try a Initintro.sqf ?

Edited by sxp2high

Share this post


Link to post
Share on other sites

well I know that you can make a camera spawn in game but i guess not in the intro part. Domination by Xeno is a good example, when you spawn in that camera moves to your player. I'll keep trying and hope I strike gold and see what happens!

Share this post


Link to post
Share on other sites

Tested; works:

Just create a Initintro.sqf file and exec the intro from there:

execVM "intro.sqf";

:thumb_down:

Share this post


Link to post
Share on other sites

I will Try thanks!

---------- Post added at 04:14 AM ---------- Previous post was at 03:30 AM ----------

ok I want to make surei got this right....

I call on the initintro.sqf in my init.sqf correct?

execVM "initintro.sqf";

Ok so I got it to spawn the camera, but for some reason it is not facing the correct direction! here is my new intro.sqf:

titlecut [" ","BLACK IN",1];
_camera = "camera" camcreate [6163.28,11406.91,4.46];
_camera cameraeffect ["internal", "back"];

showcinemaborder false;

//comment "20:53:58";
_camera camPrepareTarget [-92979.66,14121.81,-13231.84];
_camera camPreparePos [6163.28,11406.91,4.46];
_camera camPrepareFOV 0.700;
_camera camCommit 25
waituntil {camCommitted _camera};

sleep 25;

_camera cameraeffect ["terminate","back"];
camdestroy _camera;

I couldn't tell you if its spawning the camera in the correct place... since its facing the wrong direction!

-bigshot

Share this post


Link to post
Share on other sites

No... look:

You dont have to start the Initintro.sqf from anywhere.

The Initintro.sqf just needs to be created. It's like the init.sqf - it will be executed automatically, but during the intro, not the mission.

So just create the Initintro.sqf and add this line to it:

execVM "intro.sqf";

Then switch to Intro on the top right in the editor and do preview...

Share this post


Link to post
Share on other sites

@bigshotking

You have to use camCommitPrepared instead of camCommit. That should make it work.

Share this post


Link to post
Share on other sites

@sxp2high Ok well, I tried what you said and it did not run automatically..... I followed what you said to do and nothing just spawns me at my character.

@king nothing that worked Thanks!

Ok now that the camera is fixed it seems that the camera is spawning in the MISSION part of the mission not the INTRO part. I'm talking about at the top right corner of the editor where you change the mission type, INTRO, MISSION, OUTRO-WIN, OUTRO-LOSE.

Share this post


Link to post
Share on other sites

Ok I see what you did and I followed it exactly... But no dice! I guess I can just throw all the stuff in the mission part since it wants to spawn the camera there!

Share this post


Link to post
Share on other sites

If you are building a mission under "mission" and a separate opening movie under "intro" then you want to keep your init.sqf and initintro.sqf totally separate. The reason is that each is an event script:

http://community.bistudio.com/wiki/Event_Scripts

initIntro.sqf is always run first, but after the intro is done and the mission starts, init.sqf is automatically called. For that reason, you don't want to call init.sqf from initIntro or weird things will happen.

In other words, put all of your intro camera scripts into initIntro.sqf, or have it call some other script like "scene.sqf" (which is what I do) where you put all of your camera commands. Only put mission related commands into init.sqf.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×