OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 03 Aug 2004, 02:49:22

Title: Titles
Post by: shadow99 on 03 Aug 2004, 02:49:22
A few weeks ago, I asked people how to insert my own title. Macguba kindly answered with this:

class RscTitles
{
  class naughty2
  {
      idd=-1;
      movingEnable=0;
      duration=8;
      name="naughty2";
      controls[]={"Title"};
      class Title: RscPicture
      {
        text="naughty2.jpg";
        x=0.300000;
        y=0.000000;
        w=0.500000;
        h=1.000000;
      };
  };
};

To activate it, I use:

titleRsc ["naughty2","plain",0.1]

But yet when it is supposed to come up in my intro, the game claims "Resource naughty2 cannot be found" or something like that.

However, it's in my missions folder and defined in description.ext. What's wrong?

But it claims my "naughty2.jpg" cannot be found when I'm testing my intro. However, it's defined in description.ext and it's in my missions folder.

What is wrong?
Title: Re:Titles
Post by: TH on 03 Aug 2004, 05:11:25
did you name it naughty2? and is it a jpg?
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 05:44:01
Yes, I did.
Title: Re:Titles
Post by: macguba on 03 Aug 2004, 09:48:30
That's odd .... I cut and pasted it and it works for me.

Ah, I found this extra bit


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 naughty2
   {
      idd=-1;
      movingEnable=0;
      duration=8;
      name="naughty2";
      controls[]={"Title"};
      class Title: RscPicture
      {
         text="naughty2.jpg";
         x=0.300000;
         y=0.000000;
         w=0.500000;
         h=1.000000;
      };
   };
};

Dunno what its for, maybe you need the picture bit to make the other bit work.    Don't ask me, I just copied it all from a tutorial somewhere.     If the pic file is in the right place with the right name then "not found" usually means there is something wrong in the description.ext.
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 09:54:44
Thanks. It seems I got somewhere. Now it's complaining about dimensions. What ARE the dimensions, anyway? What do I have to resize my picture to?

It said: "<Directory of .jpg> dimensions <dimensions> not 2^n" or something very similar.

Title: Re:Titles
Post by: dmakatra on 03 Aug 2004, 10:06:35
2, 4, 8, 16, 32, 64, 96, 128, 196, 256, 512, 1024 have worked for me. I'm sure there are more.

:beat: *Gets Shot* :beat:
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 10:21:00
Now it's saying it can't load the textures!!!!!!!111!!!one!@21!!

When does it end?
Title: Re:Titles
Post by: macguba on 03 Aug 2004, 10:21:41
Both sides of the pic must be a power of 2 in pixels.    Armsty has given a pretty good list apart from 96 and 196.  ::)
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 10:30:36
I have... 512x512.

"<Directory of .jpg> title cannot load texture"

or something like that.
Title: Re:Titles
Post by: dmakatra on 03 Aug 2004, 10:32:44
Oi, its 192 and 96. Sorry.

And it works.

I've tried it.

It works.

Bwahahahhahahaha! ;D
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 10:34:17
That's blasted tiny... Oh well...
Title: Re:Titles
Post by: shadow99 on 03 Aug 2004, 10:36:07
Huh what?

Now I'm confused...?

Title: Re:Titles
Post by: macguba on 03 Aug 2004, 10:49:09
It doesn't really matter what size the file is saved:  you define how big it is on the screen in descption.ext anyway.

Don't know the texture error I'm afraid.
Title: Re:Titles
Post by: Platoon Patton on 03 Aug 2004, 13:04:02
Code: [Select]
To activate it, I use:

titleRsc ["naughty2","plain",0.1]

Also change the ,0.1 with something bigger,like 5
Title: Re:Titles
Post by: shadow99 on 04 Aug 2004, 10:08:17
0.1 brings it up for a set amount of time anyway, I believe. With the original CWC logo it did... 5 seconds or so...