Jump to content
Sign in to follow this  
nedal

Problem with resources/ classes / titles

Recommended Posts

i want to make an intro with many texts using the same class

description.ext

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class RscStdText

{

type=0;

idc=-1;

style=2;

colorBackground[]={0,0,0,0};

colorText[]={1,1,1,1};

font="TahomaB14";

size=1;

};

class RscTitles

{

titles[]={starttext1,Starttext2,Starttext3};

class starttext1

{

titles[]={screen1, Titel1};

idd=-1;

movingEnable=0;

duration=5;

name="starttext1";

controls[]={"Screen1","Titel1"};

class Screen1 : RscStdText

{

style=48;

text="bopl.jpg";

x=0.388;

y=0.2;

w=0.225;

h=0.3;

};

class Titel1 : RscStdText

{

text="[BoP] Oberst Nedal presents";

colorText[]={0.8,0.1,0,0.8};

font="TahomaB48";

size=1.0;

x=0.1;

y=0.55;

w=0.8;

h=0.05;

};

};

class starttext2

{

titles[]={screen2, Titel2};

idd=-1;

movingEnable=0;

duration=5;

name="starttext2";

controls[]={"Screen2","Titel2"};

class Screen2 : RscStdText

{

style=48;

text="czlbanner.jpg";

x=0.1;

y=0.2;

w=0.8;

h=0.2;

};

class Titel2 : RscStdText

{

text="www.clanzone-league.com";

colorText[]={0.8,0.1,0,0.8};

font="TahomaB48";

size=1.0;

x=0.1;

y=0.50;

w=0.8;

h=0.05;

};

};

class starttext3

{

titles[]={text1};

idd=-1;

movingEnable=0;

duration=5;

name="starttext2";

controls[]={"text1"};

class text1 : RscStdText

{

idc = 150150;

text="";

colorText[]={0.8,0.1,0,0.8};

font="TahomaB48";

size=1.0;

x=0.1;

y=0.50;

w=0.8;

h=0.05;

};

};

};

init.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

~3

TitleRsc ["starttext1","Black",5]

~5

TitleRsc ["starttext2","Black",5]

~5

ctrlSetText1 [150150,"czl 1 v 1 Deathmatch Surprise"];

~4

ctrlSetText1 [150150,"Suprice Fight Town will be:"];

~4

titleCut ["test","Black out",0]

i want to make many messages using the idc = 150150;

from class starttext3

and the text should be not written in description, but in init.sqs.

it is made this way in oyc tournament map

but i just dont get it, and in all tutorials i have found there is no such thing like idc = xxxx and the text in the init.sqs file

Share this post


Link to post
Share on other sites

Hello !

Your problem is that you mix up two different things : text resources and dialogs.

"TitleRsc" will display your text as defined in the description, but "CtrlSetText" will only modify texts which appear in a dialog.

Ig.

Share this post


Link to post
Share on other sites

and CtrlSetText are defined in description.ext and used in dialog scripts?

I thauolt about that too, but i could not find any CtrlSetText in the description (saw this system in OYC Tournament)

Share this post


Link to post
Share on other sites

ctrlSetText is a scripting command and does not appear in the description.ext. Like Igor said it changes the text within a dialog. AFAIK, all text in resources is static, i.e. you cannot change it ingame using scripts. I'm interested though in the oyc tournament map you mentioned. Could you please post its description.ext/scripts.

Share this post


Link to post
Share on other sites

in the OYC Tournament map they have a huge Description.ext

here is the Introa part of it

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class introa

{

idd = -1;

movingEnable = true;

controlsBackground[] = {bg};

class bg : RscText

{

colorBackground[] = {0,0,0,1};

text =;

x = 0;

y = 0;

w = 1;

h = 1;

};

objects[] = { };

controls[] = {txx1,txx2,paa1};

class txx1 : RscText14

{idc = 789995;style = ST_CENTER;x = 0.05;y = 0.47;w = 0.90;h = 0.1;text = "";};

class txx2 : RscText15

{idc = 789996;style = ST_CENTER;x = 0.05;y = 0.47;w = 0.90;h = 0.1;text = "";};

class paa1 : RscPicture

{idc = 789001;x = 0;y = 0;w = 1;h = 1;text = "";};

};

This idc {idc = 789996;......

they have in the description.ext

is used in the Init.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ctrlSetText [789996,"J A P A N"];

OYC Mission File here

I am trying to make something similar, but i just dont get it

Share this post


Link to post
Share on other sites

As Igor Drukov already said: You mix dialogs and resources up.

In your case, you have to use dialogs, you can use there ctrlSetText. You can find a dialog tutorial on my homepage, in German and in English language. Just click on my WWW-button

Share this post


Link to post
Share on other sites

vektorboson, you made some nice tutorials good job m8

(info: DROP.zip tutorial cant be downloadet from your page, gues link is wrong)

but in this Tut, and in all others i have read, i could not find some CTRLSETTEXT System wich is used in OYC MAP

i am trying to understand this OYC MAP, where

ctrlSetText [789996,"J A P A N"]; is used in the intro script, and the number 789996 referes to description.ext

class txx2 : RscText15

{idc = 789996;style = ST_CENTER;x = 0.05;y = 0.47;w = 0.90;h = 0.1;text = "";};

I am confused since you all tell me this does not work, it is mixing up ctrlSetTexts, dialogs and classes.

But in the map from OYC it works !!!!

just have a look on it your self, if you dont beleive me   smile

Download OYC MAP here

I think the idea of making ONE class in DESCRIPTION.EXT and in the INTRO.SQS many texts, using the same class is great!

MEANS there is no TEXT in the CLASS in DESCRIPTION.EXT, just font, color, size!

and in the intro.sqs you just write the texts, and refere with the IDC number to the same class

but i dont understand how it works, since it does not work in my map

Quote[/b] ]ctrlSetText is a scripting command and does not appear in the description.ext.

but where are the inforamtions wich font size and color is used for the ctrlSetText ?

i am confused

Share this post


Link to post
Share on other sites
Quote[/b] ]I am confused since you all tell me this does not work, it is mixing up ctrlSetTexts, dialogs and classes.

But in the map from OYC it works !!!!

I´m just downloading OYC to take a look. My suspicion is though, that OYC uses dailogs instead of resources. Their definition within the description.ext is in some cases very similar. In some sense, dialogs are resources with avtive elements like buttons and changeable text. Dialogs are actived from script with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">createDialog "dialogName"

and resources with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleRsc["resourceName","PLAIN"]

Share this post


Link to post
Share on other sites

Hi, in the ActiveText-example I am using ctrlSetText to change the text of a static text-control. Please just look once more at the tutorial, thank you!

Share this post


Link to post
Share on other sites

Hi, simple solution smile_o.gif, the command is called ctrlSetText and not ctrlSetText1. The latter does not exist, hence the unknown operator. Sorry, I should have corrected this before, I only thought it an misprint on your side.

Unfortunately, the Intro still won´t work as expected (cool graphics by the way) because I think you cannot have a dialog and resources at the same time. Here´s the init.sqs with the titleRsc commented out to show that the changing text works:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleCut ["","BLACK",3]

0 setfog 0.7

0 fademusic 0.35

? (alive S1) : S1t=true

? (alive S2) : S2t=true

[] exec "score.sqs"

[] exec "scoretimer.sqs"

gamerun=true

S1Score=0

S2Score=0

createDialog "introczl"

~3

;TitleRsc ["starttext1","Black",5]

~5

;TitleRsc ["starttext2","Black",5]

~5

ctrlSetText [150150,"czl 1 v 1 Deathmatch Surprise"];

~4

ctrlSetText [150150,"Suprice Fight Town will be:"];

~4

ctrlSetText [150150,""];

~1

ctrlSetText [150150,"?"];

~0.2

ctrlSetText [150150,"Morton?"];

~0.2

ctrlSetText [150150,"?"];

~0.2

ctrlSetText [150150,"Lamentin?"];

~0.2

ctrlSetText [150150,"?"];

~0.2

ctrlSetText [150150,"Meaux?"];

~0.2

ctrlSetText [150150,"?"];

~0.2

ctrlSetText [150150,"Saint Pierre?"];

~0.2

ctrlSetText [150150,"?"];

~0.2

ctrlSetText [150150,"Gravette?"];

~0.2

ctrlSetText [150150,"?"];

~1

ctrlSetText [150150,"YOUR FIGHT TOWN IS:"];

~0.5

ctrlSetText [150150, [format["Starting location: %1",ortmsg]]];

~5

titleCut ["","Black out",0]

exit

I suggest to move the resources stuff within the dialog. Pictures will work there also. You can give all the controls within a dialog its own idc. Then you can (un)hide a control

with ctrlShow[idc,true/false]. Take a look at vektorboson´s tutorial and the official ComRef for all the other stunts with controls.

Hope this helps,

Spinor

Share this post


Link to post
Share on other sites

WOW    thanks a lot for the help and

Thanks a lot for the compliment about the grafiks

i have put all the resources in the dialog   smile_o.gif

NOW i have 3 litle problems

1. the intro works in the editor, but not on server sad_o.gif

2. how can i end the dialog? start with createDialog is there something like deleteDialog? at the end of dialog the game waits with black screen  sad_o.gif    

3. in the dialog it is posible to get out of the dialog with the ESC button, is there a way so no one can get out of the dialog with ESC button?

Share this post


Link to post
Share on other sites

i could solve the problem with ending of the DIALOG.

i end it with "closedialog 0" and it works.

but the 2 other problems i stil have sad_o.gif

1. the intro works in the editor, but not on server. if i start the mission on server i just get a black screen

2. in the dialog it is posible to get out of the dialog with the ESC button, is there a way so no one can get out of the dialog with ESC button?

Share this post


Link to post
Share on other sites
Quote[/b] ]1. the intro works in the editor, but not on server. if i start the mission on server i just get a black screen

I'm not sure about this. I never had any problems with dialogs on a server. Maybe this is not the dialog but the the BLACK IN titleCut.

Quote[/b] ]2. in the dialog it is posible to get out of the dialog with the ESC button, is there a way so no one can get out of the dialog with ESC button?

There is a command called disableUserInput true/false (better check for syntax). Turning it on while the Intro runs should disable the player from quitting it. Make sure though to enable it again, as it completely blocks any input.

Share this post


Link to post
Share on other sites

thanks, disableUserInput true/false works!

BUT i stil have the problem that on server the mission stays black! sad_o.gif      

i removed the BLACK IN titleCut, but this did not help.

as soon the mission is loadet, i get a black screen and nothing is happening anymore!!

i tried many things, i removed titlecut, i took out the intro from init.sqs and put it in a seperate script wich i startet on mission load, i changed _ok = createDialog "introczl" to createDialog "introczl", but all this did not help!! sad_o.gif

Here my mission i am working on

crazy_o.gif

Share this post


Link to post
Share on other sites

Hi,

I still dont know what is causing the behaviour but it can be cured by including a short delay, e.g.

~0.1

just before createDialog.

Share this post


Link to post
Share on other sites

WOOOOOOOOWWWW ~0.1 and it works

thats what i call miracle programming (miracle since no one knows why it does not work without smile_o.gif )

THANK YOU ALL GUYS FOR HELPING smile_o.gif)

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  

×