OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: LAPD on 03 Sep 2002, 14:52:48
-
Hey :wave:
I want to know how do I write text in a mission which will have color (not the white, original one).
I saw that BIS wrote in the campaign a text in blue.
How do I do that?
If you can, please write the colors the text could be painted and how to do that ?
Thanks :)
-
You could make a dialog resource in the discription.ext to define a dialog that only consists of a single colored text and then show it via createDialog.
-
Could you explain it a little more? Examples would help too. I'm interested on how to do that.
-
I didn't understand dj_flash.
Thanks anyway :)
-
Put this in an description.ext in your mission/campaign dir:
class RscText
{
type=0;
idc=-1;
style=0;
h=0.080000;
colorBackground[]={0,0,0,0};
colorText[]={0.000000,1.000000,1.000000,1.000000};
font="tahomaB24";
sizeEx=0.040000;
};
class RscTitles
{
class MyText
{
idd=-1;
movingEnable=0;
duration=4;
name="Hello World Text";
controls[]={"Text"};
class Text : RscText
{
style="16 + 2 + 512";
lineSpacing=1.000000;
text="Hello World!";
x=0.050000;
y=0.30000;
w=0.900000;
h=0.500000;
colorText[]={0,0,1,1};
font="tahomaB36";
sizeEx=0.030000;
};
};
};
Then show it via
cutRsc ["MyText","PLAIN"]
you can show pictures via
class RscPicture
{
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="tahomaB24";
sizeEx=0;
};
....
.... class Picture : RscPicture {
idc=xyz
text="Name of the Picture.jpg"
.....
Or you can put this all in a Dialog like this
class RscText
{
type=0;
idc=-1;
style=0;
h=0.080000;
colorBackground[]={0,0,0,0};
colorText[]={0.000000,1.000000,1.000000,1.000000};
font="tahomaB24";
sizeEx=0.040000;
};
class RscButton
{
type=1;
style=2;
w=0.160000;
h=0.060000;
colorText[]={0.080000,0.080000,0.120000,1};
font="tahomaB24";
sizeEx=0.020000;
default=0;
soundPush[]={"ui\ui_ok",0.200000,1};
soundClick[]={"",0.200000,1};
soundEscape[]={"ui\ui_cc",0.200000,1};
};
class MyText
{
idd=1;
movingEnable=0;
controls[]={"Text","Button"};
class Text : RscText
{
idc=303;
x=0.300000;
y=0.180000;
w=0.400000;
text="Hello World!";
};
class Button : RscButton
{
idc=1;
w=0.0;
h=0.0;
x=-0.5;
y=-0.5;
text="";
default=1;
};
};
But the it shows you a cursor.
Hope that helps.
-
Visit VektorBoson's site for a tutorial on Dialog Scripting:
http://home.arcor.de/vektorboson/index.html (http://home.arcor.de/vektorboson/index.html)
Choose tutorials, and then Dialoge in OFP:R 1.75
Link straight to it:
http://home.arcor.de/vektorboson/downloads/dialoge.zip (http://home.arcor.de/vektorboson/downloads/dialoge.zip)
English/German
8)PEACE
-
Hey Again :wave:
Well, I've download the toturial, it seems complicated (very complicated ...).
All I need is to know how to write a text in RED.
(What I realy want is that someone will write the thing I need to write in the dexription.ext and where should I write the text I want).
Any help will be welcome (of course ...) :thumbsup:
If it's to hard then just leave it. I'll try improvising something.
Thanks :)
Edit: Oops, I just saw what Dj_flash wrote. Thanks :)
But How can I make it Red?
And another thing, Can I make a text blink?
I want the word "Escape" Blink a few times in red (with the sound like in the movies ... )
-
Not sure about the color thing.. but to make some text appear to "blink" you could use this little snippet:
titletext["Escape","plain",4]
~0.3
titletext["","plain",4]
~0.3
titletext["Escape","plain",4]
~0.3
titletext["","plain",4]
ad infinitum
:toocool:
-
Thanks Kaliyuga :).
I'll try doing some changes trying to make the text color red, but if anyone knows please tell me how to do that.
Again, Thanks 8)
-
The answer you seek is in dj_flash's post. Let me show you:
Put this in an description.ext in your mission/campaign dir:
class RscText
{
type=0;
idc=-1;
style=0;
h=0.080000;
colorBackground[]={0,0,0,0};
colorText[]={0.000000,1.000000,1.000000,1.000000};
font="tahomaB24";
sizeEx=0.040000;
};
class RscTitles
{
class MyText
{
idd=-1;
movingEnable=0;
duration=4;
name="Hello World Text";
controls[]={"Text"};
class Text : RscText
{
style="16 + 2 + 512";
lineSpacing=1.000000;
text="Hello World!";
x=0.050000;
y=0.30000;
w=0.900000;
h=0.500000;
colorText[]={0,0,1,1};
font="tahomaB36";
sizeEx=0.030000;
};
};
};
Then show it via
cutRsc ["MyText","PLAIN"]
You put the message you want to display where it says Hello World! above.
You change the colour to red by changing the text five lines further down (colorText[]={0,0,1,1};) to:
colorText[]={1.0, 0.0, 0.0, 1};
Pope Zog
-
I got that, thanks :).
But a new problem just came up ... :-\. In the same mission i'm making a logo, and the script at the addon forum
(you can find it here: http://www.ofpec.com/yabbse/index.php?board=13;action=display;threadid=966 )
There I used the RscText and the RscTitles. So one I load my mission it crash to windows giving this error:
"users\Liron\missions\Holy Grail.Noe\description.ext.Rsc Text: Member already defined".
Well, I guess it means I have RscText twice (and also RscTitles).
Here is my description.ext:
minScore=300
avgScore=2400
maxScore=6500
onLoadIntro="Winstone Church, Varta"
onLoadMission="A"
debriefing = 1
showWatch = 1
showCompass = 1
showNotepad = 1
showGPS = 0
showMap = 1
onLoadIntroTime = true;
class RscText
{
type=0;
idc=-1;
style=0;
h=0.040000;
colorBackground[]={0,0,0,0};
colorText[]={0.080000,0.080000,0.120000,0.750000};
font="tahomaB24";
size=1;
};
class RscPicture
{
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="tahomaB24";
size=0;
};
class RscTitles
{
class LAPD
{
idd=-1;
movingEnable=0;
//change this if you want to have the picture fading in (fade in time in seconds)
fadein=1;
//display time of the picture in seconds
duration=4;
name="Holy Grail";
controls[]={"Background", "Picture"};
class Background: RscText
{
text="";
colorBackground[]={0,0,0,1};
x=0;
y=0;
w=1;
h=1;
colorText[]={0,0,0,0};
};
class Picture: RscPicture
{
text="LAPD.jpg";
x=0.125000;
y=0.250000;
w=0.750000;
h=0.500000;
};
};
titles[]={"LAPD"};
};
class RscText
{
type=0;
idc=-1;
style=0;
h=0.080000;
colorBackground[]={0,0,0,0};
colorText[]={0.000000,1.000000,1.000000,1.000000};
font="tahomaB24";
sizeEx=0.040000;
};
class RscTitles
{
class Escape
{
idd=-1;
movingEnable=0;
duration=4;
name="Escape";
controls[]={"Text"};
class Text : RscText
{
style="16 + 2 + 512";
lineSpacing=1.000000;
text="Escape?";
x=0.050000;
y=0.30000;
w=0.900000;
h=0.500000;
colorText[]={1.0,0.0,0.0,1};
font="tahomaB36";
sizeEx=0.030000;
};
};
};
As you can see, there is RscText twice and RscTitles twice (which I guess that what gives the error).
How can I organize it so it won't crash?
Such a long explenation ends in a little question. LOL 8)
-
Easy peasy :P
Put the definition for the class Escape inside the first declaration of the class RscTitles that contains LAPD and change the line:
titles[]={"LAPD"};
to:
titles[]={"LAPD", "Escape"};
Finally delete the second copy of the class RscText
Now it should look like this:
class RscTitles
{
class LAPD
{
idd=-1;
movingEnable=0;
//change this if you want to have the picture fading in (fade in time in seconds)
fadein=1;
//display time of the picture in seconds
duration=4;
name="Holy Grail";
controls[]={"Background", "Picture"};
class Background: RscText
{
text="";
colorBackground[]={0,0,0,1};
x=0;
y=0;
w=1;
h=1;
colorText[]={0,0,0,0};
};
class Picture: RscPicture
{
text="LAPD.jpg";
x=0.125000;
y=0.250000;
w=0.750000;
h=0.500000;
};
};
class Escape
{
idd=-1;
movingEnable=0;
duration=4;
name="Escape";
controls[]={"Text"};
class Text : RscText
{
style="16 + 2 + 512";
lineSpacing=1.000000;
text="Escape?";
x=0.050000;
y=0.30000;
w=0.900000;
h=0.500000;
colorText[]={1.0,0.0,0.0,1};
font="tahomaB36";
sizeEx=0.030000;
};
};
titles[]={"LAPD","Escape"};
};
Pope Zog
-
It worked. "Escape" in red, and blinking! :)
Thanks Everybody :) :thumbsup: