Jump to content
Sign in to follow this  
Koni

Titlecut text

Recommended Posts

Making a cutscene, and I want to black out the screen while I have a type of credits rolling.

I'm using..

titlecut ["Mission By blah blah","BLACK"]

~5

titlecut ["Written By blah blah","black"]

~5

titlecut ["Mission name blah blah","black"]

~5

but doing it this way, every change of text brings about a flash on the screen as it kind of shows what you should really be looking at then blacks in to display the next line of text.

What I'm after is for the screen to remain totally black while the text changes, and not the kind of flash I'm getting when the next text line is displayed..... is this possible ?

Thanks

---------- Post added at 11:27 PM ---------- Previous post was at 11:11 PM ----------

Sorted it out :) , sort of

titlecut ["Mission By blah blah","BLACK FADED",30]

~5

titlecut ["blah blah blah","BLACK FADED",30]

~5

works quite well, the faded,30 keeps the screen quite black while the 5 second countdown ticks over before renewing it's self on the next code line, though it does change a bit lighter shade of blacl\grey, so if anyone has a better way then please show me where I am going wrong.

New question, same again for the titletext.

Is there any text formatting that can be used to enlarge or change fonts for title text ?

Edited by Koni

Share this post


Link to post
Share on other sites

In regards to having a black background, I do this for all movies and even scenarios so that things load first before being seen:

cutText ["", "BLACK FADED"];

Even though screen is blacked out, you can still show words and images. Just use this when you want everything else visible again:

cutText ["", "BLACK IN"];

Note if you do this, you cannot use titleCut as it will override the cutText. Instead you want to use TitleRsc, which also leads to the answer of your other question. It's a bit involved to explain it all, and I recommend getting the famous Mr Murray's editing guide, but in a nutshell you need to define resources in the description.ext file for your mission. Below is an example from one of my movies, and how to call it follows.

description.ext:

class RscText
{
 type = CT_STATIC;
 idc = -1;
 style = ST_MULTI;
 colorBackground[] = {0,0,0,0};
 colorText[] = {0,0,0,0};
 font = "TahomaB";
 sizeEx = 0.06;
 h = 0.04;
};

class DiagText : RscText
{
 colorText[] = {0.9, 0.9, 0.9, 1};
 x = 0.00;
 y = 0.90;
 w = 1.00; //WindowWidth
 h = 0.2; //WindowHeight
 lineSpacing = 0.95;
};

class RscTitles
{
Titles[] = { "Diag0" };

class Diag0
{
	idd = -1;
	MovingEnable=0;
	Duration=3; // Fade Duration
	FadeIn=1; // Fade Time
	Name="Diag0"; // Name
	Controls[]={"Control01"};
	class Control01: DiagText
	{
		text = "Friday Jan 1, 2010. 11:45 hours. Chernogorsk, Chernarus.";
	};
};
};

The first class listed above has a property called sizeEx. That seems to be the key to changing font size.

To execute it from your script, such as init.sqf or whatever file, use this:

TitleRsc ["Diag0", "PLAIN DOWN", 4];

You can of course call it what you want, but "Diag0" refers to the class name in description inside the RscTitles class, and it must be listed in the Titles[] array as well. So to make more, you just make more classes, such as Diag1, Diag2, etc, and add those names to the Titles[] array.

I'm no expert on resources, I mostly learned it from Mr Murray's guide, and I know there are some others on this forum that know it front and back. But I hope this helps :)

Share this post


Link to post
Share on other sites

Yes thanks.

I actually found a thread about this after getting the right search word correct for it to show in the search, and spent till 2am last night playing around with things :)

Thanks for your code snippets though, I'll have a play around with that too :D

Share this post


Link to post
Share on other sites

Hi people... Interesting thred, cos im looking for something similar. first of all, im totaly new in making cutscenes, scenarios and load intros. If someone can write one simple example of description.ext file how to see on load of mission black screen with some text. Like this for example:

titlecut ["Mission By blah blah","BLACK FADED",30]

~5

titlecut ["blah blah blah","BLACK FADED",30]

~5

i need whole description.ext to understand where im wrong with mine. Thanks!

Share this post


Link to post
Share on other sites

There are basically 2 ways (that I know of) to go about this. The simple way does not need description.ext and can be done something like this:

titleCut ["", "BLACK",0];
2 cutText ["Shapur e-Dalanper","Plain Down",3];
sleep 4;
2 cutText ["","Plain Down",1];
sleep 0.5;
2 cutText ["June 2012","Plain Down",3];
sleep 4;
2 cutText ["","Plain Down",1];
titleCut ["", "BLACK IN", 2];

Advantage: simplicity

Disadvantages: world visible the first second before it turns black, the text is very small

The method with Description.ext would have the SQF something like this:

cutText ["", "BLACK FADED"];
TitleRsc ["Diag1", "PLAIN DOWN"];
sleep 5;
TitleRsc ["Diag2", "PLAIN DOWN"];
sleep 5;
cutText ["", "BLACK IN"];

Advantages: mission loads black from the start, you can set the text any size you want

Disadvantage: requires Description.ext

"Diag1" and "Diag2" are defined below.

Description.ext:

class RscText
{
 type = CT_STATIC;
 idc = -1;
 style = ST_MULTI;
 colorBackground[] = {0,0,0,0};
 colorText[] = {0,0,0,0};
 font = "TahomaB";
 sizeEx = 0.06;
 h = 0.04;
};

class DiagText : RscText
{
 colorText[] = {0.9, 0.9, 0.9, 1};
 x = 0.50;
 y = 0.90;
 w = 1.00;
 h = 0.2;
 lineSpacing = 0.95;
};

class RscTitles
{
Titles[] = { "Diag1","Diag2"};

class Diag1
{
	idd = -1;
	MovingEnable=0;
	Duration=2;
	FadeIn=1;
	FadeOut=1;
	Name="Diag1";
	Controls[]={"Control01"};
	class Control01: DiagText
	{
		text = "Shapur e-Dalanper";
	};
};
class Diag2
{
	idd = -1;
	MovingEnable=0;
	Duration=2;
	FadeIn=1;
	FadeOut=1;
	Name="Diag2";
	Controls[]={"Control01"};
	class Control01: DiagText
	{
		text = "June 2012";
	};
};
};

Share this post


Link to post
Share on other sites
There are basically 2 ways (that I know of) to go about this. The simple way does not need description.ext and can be done something like this:

titleCut ["", "BLACK",0];
2 cutText ["Shapur e-Dalanper","Plain Down",3];
sleep 4;
2 cutText ["","Plain Down",1];
sleep 0.5;
2 cutText ["June 2012","Plain Down",3];
sleep 4;
2 cutText ["","Plain Down",1];
titleCut ["", "BLACK IN", 2];

Advantage: simplicity

Disadvantages: world visible the first second before it turns black, the text is very small

The method with Description.ext would have the SQF something like this:

cutText ["", "BLACK FADED"];
TitleRsc ["Diag1", "PLAIN DOWN"];
sleep 5;
TitleRsc ["Diag2", "PLAIN DOWN"];
sleep 5;
cutText ["", "BLACK IN"];

Advantages: mission loads black from the start, you can set the text any size you want

Disadvantage: requires Description.ext

"Diag1" and "Diag2" are defined below.

Description.ext:

class RscText
{
 type = CT_STATIC;
 idc = -1;
 style = ST_MULTI;
 colorBackground[] = {0,0,0,0};
 colorText[] = {0,0,0,0};
 font = "TahomaB";
 sizeEx = 0.06;
 h = 0.04;
};

class DiagText : RscText
{
 colorText[] = {0.9, 0.9, 0.9, 1};
 x = 0.50;
 y = 0.90;
 w = 1.00;
 h = 0.2;
 lineSpacing = 0.95;
};

class RscTitles
{
Titles[] = { "Diag1","Diag2"};

class Diag1
{
	idd = -1;
	MovingEnable=0;
	Duration=2;
	FadeIn=1;
	FadeOut=1;
	Name="Diag1";
	Controls[]={"Control01"};
	class Control01: DiagText
	{
		text = "Shapur e-Dalanper";
	};
};
class Diag2
{
	idd = -1;
	MovingEnable=0;
	Duration=2;
	FadeIn=1;
	FadeOut=1;
	Name="Diag2";
	Controls[]={"Control01"};
	class Control01: DiagText
	{
		text = "June 2012";
	};
};
};

Thank you for this AZcoder, but cos' im totaly new in making scripts, you need to explain me step by step... First, which script goes into DESCRIPTION.EXT and which into .SQF? How to name that .SQF?

Share this post


Link to post
Share on other sites

The bottom script, which says "Description.ext" right above "code" is your full description file. Description files contain resources used for the display, music, sound effects, soldier identities, and some other things.

IMPORTANT: When you make changes to the Description file, you have to reload the mission in the editor, or it won't read the changes when you click preview. Make sure to save any changes in editor first ;) Then load.

Most missions have "init.sqf" which is a file that the mission will load automatically on start. To use the display effects above, the easiest thing is to create init.sqf, and put the SQF script above into it like this:

cutText ["", "BLACK FADED"];
TitleRsc ["Diag1", "PLAIN DOWN"];
sleep 5;
TitleRsc ["Diag2", "PLAIN DOWN"];
sleep 5;
cutText ["", "BLACK IN"];

Then click preview in the editor and watch the results.

In the Description file, you will see x & y values, that's your position on the screen for the text. Experiment with it. w & h are width of text display, and height of display.

Share this post


Link to post
Share on other sites

AZCoder is attempting to show you Dialogue creation and though you will certainly want to learn more about it, you don't actually need it to change the text at the loading of your mission. Open a new notepad document, insert the below text into it, changing the text to your choosing and save as Description.ext. Place the document into your mission folder and load your mission.

OnloadMission = "Shapur e-Dalanper\n\nFriday June 8\n\n2012";

Use the forward slash n "\n" to create spacing.

If you would like to learn more about cutscenes, check this link out. If this is not what you were looking for, perhaps you could provide some more detail so that we can help you better.

Also, Black screens are not always needed to introduce your mission. Sometimes it helps to open with an establishing shot of the overall area accompanied by the title and or other data crucial to mission start.

Edited by savedbygrace

Share this post


Link to post
Share on other sites

@savedbygrace: can you control how long a message displays with OnLoadMission? I don't know any way of doing that, but doesn't mean it can't be done :)

It's true that resources are not necessary, as shown in my first example above in post #5:

http://forums.bistudio.com/showpost.php?p=1805300&postcount=5

which is based on the black screen approach. I only recommend resources if you want control over the size of text, maybe its color, and its placement.

There is also another, it requires the Functions module on the map and looks something like this:

["Message to display",0,0.8,6,2] spawn bis_fnc_dynamictext;

The text is very readable, and has a couple special effects like scrolling. Here are the parameters:

http://forums.bistudio.com/showpost.php?p=1720271&postcount=5

Edited by AZCoder

Share this post


Link to post
Share on other sites

Oh yes, I know Dialogues are superior by far in the way of creativity. I was only offering something simple for a beginner.

There is no way to control text display time on mission load since it remains until the mission is actually loaded which could be brief to very long, depending on the content. OnMissionLoad is while the mission loads, which is before the Init takes over. That's why it must be in the Description.ext.

Functions? Awesomeness. I had not delved into functions yet and was hoping to learn more about them. Thanks for the mention pal, I'll certainly check it out.

Share this post


Link to post
Share on other sites

I apologize if that came off wrong. Resources can be confusing to learn, require a lot more work, and I only advocate their use if you have the need :D

The quickest way to learn the functions (at least for me) is to put a player on any map, create a trigger like this:

Cond: !isnil "bis_fnc_init"

OnAct: [] call BIS_fnc_help;

and click preview. More info here: http://community.bistudio.com/wiki/BIS_fnc_help

It will show all functions by source, and you can copy them to the clipboard for pasting in your favorite text editor to see how they work. Of most interest are what parameters they use, so you can call them correctly :)

Share this post


Link to post
Share on other sites

Is there a way to have a background picture (paa or jpg) instead of the "Black screen" with the text on top of that, anyone know?

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  

×