Jump to content
Koni

Camera scripting "fade out"

Recommended Posts

I have a scene where the camera is like flying through the air and it will follow one path for say 8 seconds then change direction and fly that way for 8 seconds, but I want to get a fade out and fade in just before the camera reaches the end of the first direction so you don't actually see the camera stop and change direction, so it like fades to black a second or so before it needs to stop, then fades back in again just after the change of direction.

;=== 0:18:00

_camera camPrepareTarget [-65942.70,-64244.34,160.15]

_camera camPreparePos [5910.95,5304.58,2.00]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 0

@camCommitted _camera

sleep 4;

;=== 0:18:18

_camera camPrepareTarget [-65942.70,-64244.34,159.98]

_camera camPreparePos [5823.09,5219.55,7.85]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 8

@camCommitted _camera

So the cameras going to take 8 seconds to get to the end of it's run, but I want the fade to activated say 5 seconds into the cameras flight ?

titlecut [" ","BLACK Out",1]

~1

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

Thanks

Share this post


Link to post
Share on other sites

I'm not sure about doing this under SQS, but if you convert your script to SQF, then you can spawn parallel threads which is how I do things during a camera commit. Here is your sample script converted to SQF:

//=== 0:18:00
_camera camPrepareTarget [-65942.70,-64244.34,160.15];
_camera camPreparePos [5910.95,5304.58,2.00];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
sleep 4;

[] spawn
{
sleep 4;
titlecut ["","BLACK Out",2];
sleep 1;
titlecut ["","BLACK IN",2];
};

//=== 0:18:18
_camera camPrepareTarget [-65942.70,-64244.34,159.98];
_camera camPreparePos [5823.09,5219.55,7.85];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8;
waitUntil {camCommitted _camera};

Notice the spawn in the middle. It will wait 4 seconds before blacking out. At the same time the next camera commit is going. You will surely need to adjust the timing here, maybe sleep 5 or 6 seconds inside the spawn before the black out.

If you go this route, make sure to call the script with execVM as it's SQF.

Share this post


Link to post
Share on other sites

Thanks AZCoder, will have a play around with it tonight :)

Share this post


Link to post
Share on other sites

Also you dont need the time codes //=== 0:18:18, thats why AZCoder remmed them out, they can be deleted totaly as you set time in your mission.

Some explantions

waitUntil {camCommitted _camera};

This replaces the @ function, @ is an SQS feature which is now outdated, the game uses both SQF and SQS but SQF is way more efficent for scripting. they both mean the same thing though.

_camera camPrepareFOV 0.700;

This is the default or stock field of view. The smaller the number the wider the field of view, the larger the number the more zoomed in it will be.

Also you can add camera effects and text effects, these look good and can add extra visuals to your intro. An example of this is the ANN news cast function.

title = parsetext "<t size='2.3'>Jame Cameron & Barack Obama in Gay love Scandle</t>Thousands of playboy magazines go missing.";

scroll = parsetext " 1blah blah blah - 2blah blah blah - 3blah blah blah - 4blah blah blah - 5blah blah blah";

nul = [title,scroll] spawn BIS_fnc_AAN;

Hope these ideas help, depending on how the script is called this willwork in MP too.

Calling the Script

_intro = player execVM "your\file\tree\intro.sqf";

I you are not sure what that means basically, it means adding the above command to the Intialization file ie the init.sqf file. If you dont have one just make one and add those lines. This is from an MP mission so you might need to tweak it a little

Anyhow hope thats helpful, and not teaching to suck eggs.

Bp

Share this post


Link to post
Share on other sites
I have a scene where the camera is like flying through the air and it will follow one path for say 8 seconds then change direction and fly that way for 8 seconds, but I want to get a fade out and fade in just before the camera reaches the end of the first direction so you don't actually see the camera stop and change direction, so it like fades to black a second or so before it needs to stop, then fades back in again just after the change of direction.

;=== 0:18:00

_camera camPrepareTarget [-65942.70,-64244.34,160.15]

_camera camPreparePos [5910.95,5304.58,2.00]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 0

@camCommitted _camera

sleep 4;

;=== 0:18:18

_camera camPrepareTarget [-65942.70,-64244.34,159.98]

_camera camPreparePos [5823.09,5219.55,7.85]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 8

@camCommitted _camera

So the cameras going to take 8 seconds to get to the end of it's run, but I want the fade to activated say 5 seconds into the cameras flight ?

titlecut [" ","BLACK Out",1]

~1

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

Thanks

Just a quick note:

Instead of @camCommitted _camera

You can use a sleep:

~8

Share this post


Link to post
Share on other sites

;=== 0:18:18

_camera camPrepareTarget [-65942.70,-64244.34,159.98]

_camera camPreparePos [5823.09,5219.55,7.85]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 8

~6

titleCut [" ","BLACK OUT",1]

~1

titleCut [" ","BLACK FADED",10]

~1

titleCut ["","BLACK IN",1]

Share this post


Link to post
Share on other sites

Thanks everyone :)

I do really need to learn more sqf, still mixing up my sqf n sqs :) but that's exactly what I was after Celery, thanks.

@Bigpickle

Thanks for your reply, though I have been making scenes for a few years now, I know quite a lot of the basics and overlays etc, it's mainly the sqf side of things Im not that up on.

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

×