Home   Help Search Login Register  

Author Topic: Defining new RSC graphics  (Read 1944 times)

0 Members and 1 Guest are viewing this topic.

Baphomet

  • Guest
Defining new RSC graphics
« on: 08 May 2003, 02:58:20 »
All those old tutorials from the old OFPEC like bloodmixer's tut seem to be gone... likewise I think any info I think I could have previously found on defining new resource graphics, like the BI logo and such that you can select from in the trigger effects menu. If anyone is farmiliar with this I'd be appreciative if someone pointed me in the right direction.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Defining new RSC graphics
« Reply #1 on: 15 May 2003, 08:01:58 »
Sui's 5 second Custom Resource Tutorial

[size=0.5]By no means is this comprehensive. It's quick and dirty, but should get you throwing up a resource in under 5 minutes[/size]

For a start, you'll need the actual resource. It'll need to be in either .jpg, or .paa format. You'll want to make the size to a power of 2. eg:

128x64
256x128
64x128
128x128
1024x512

Basically any combination of x and y you want, provided the size is a power of 2.

Next we'll take a look at the .ext entry... heres one I pulled from one of my missions:

Code: [Select]
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 Title
   {
      idd=-1;
      movingEnable=0;
      duration=8;
      name="Title";
      controls[]={"Title"};
      class Title: RscPicture
      {
         text="Title.paa";
         x=0.200000;
         y=0.200000;
         w=0.600000;
         h=0.600000;
      };
   };
};

The first bit (class Picture) is the parent class. This defines what all classes using Picture will be. 48 (check the style) is OFP speak for "Picture".

Then we move on to defining our resource(s). I'm using a class called "Title", but you can use whatever name you want. Just make sure you call it correctly using your script or trigger ;)

If we take a look at this bit here:
...
   class Title
   {
      idd=-1;
      movingEnable=0;
      duration=8;
      name="Title";
      controls[]={"Title"};
      class Title: RscPicture
      {
         text="Title.paa";
         x=0.200000;
         y=0.200000;
         w=0.600000;
         h=0.600000;
      };
                };
...

I'll just cover the underlined bits for now (the other parts are optional unless you want to use them... they're mainly for dialog controls I think...)
  • duration=8;: This is how long your resource will remain on the screen.
  • name="Title";: The name of your resource as will appear in the trigger dropdown menu. Just note this is not the actual name of your resource (as you would use with the cutrsc/titlersc scripting command). That name is found at the top, in this case: Class Title
  • class Title: RscPicture: This bit just defines the parent class of this resource. It's using RscPicture, which we have already told OFP is a picture (style 48).
Now down to the bit you're going to have fun mucking around with:
Code: [Select]
text="Title.paa";
x=0.200000;
y=0.200000;
w=0.600000;
h=0.600000;

The first line defines the file that your resource will use. In this case, I had a picture in .paa format, I called "title.paa".

The next two lines define the resources position on the screen. Just note they are in percentage of screen distance. The range is from 0 to 1. So 0.5 is half way across (or up) the screen.
The values here (x = 0.2, y = 0.2) mean that the resource will appear 20% from the left of the screen, and 20% from the top. The great thing about this is that it doesn't matter about the size of the resource you are using, you'll always work with screen percentages... ;)

The next two lines define how large your resource appears on the screen. Again, these are percentages of screen size... range from 0 to 1.
If you wanted your resource to fill up 80% across the screen, you'd use:
w=0.8
The values there (w=0.6, h=0.6) mean the resource fills up 60% of the screen (across and up).

Anyway, that was very quickly covered. You'll need to do some experimentation on your own to get exactly what you're after...
But the more you muck around, the easier it is to understand this stuff ;)

Good Luck mate

Captain Winters

  • Guest
Re:Defining new RSC graphics
« Reply #2 on: 14 Jun 2003, 05:20:50 »
Fabulous! What's The Name OF The Folder The Images Go In? I can't seem to figure that out?

Tanks! 8)

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Defining new RSC graphics
« Reply #3 on: 14 Jun 2003, 08:17:31 »
Generally, you just put them in the same folder as your mission.sqm.

Or, you can put them in a subfolder off that directory, provided you tell OFP where to look in your .ext entry (You'd need to include the path, eg. "\resources\Title.paa")

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Defining new RSC graphics
« Reply #4 on: 14 Jun 2003, 11:03:50 »
well.... no Sui  ;)

Code: [Select]
"\resources\title.paa" <--- this will search the OFP directory for the pic (like international flags) and hence not find it

the correct line is:

Code: [Select]
"resources\title.paa" <--- this will search the mission folder  ;)


Proud Member of the Volunteer Commando Battalion

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Defining new RSC graphics
« Reply #5 on: 14 Jun 2003, 13:33:53 »
Oops... someone's been coding too much bloody DOS ;D

Thanks Messy ;)

Captain Winters

  • Guest
Re:Defining new RSC graphics
« Reply #6 on: 14 Jun 2003, 22:08:38 »
lol. thanks guys.

Tanks! 8)

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Defining new RSC graphics
« Reply #7 on: 14 Jun 2003, 22:37:43 »
well... ermm... i just corected a pro... thats all  :D
Proud Member of the Volunteer Commando Battalion

Captain Winters

  • Guest
Re:Defining new RSC graphics
« Reply #8 on: 16 Jun 2003, 01:35:38 »
@Mezzy- lmao

Tanks! 8)

Baphomet

  • Guest
Re:Defining new RSC graphics
« Reply #9 on: 16 Jun 2003, 17:44:06 »
Thanks for the info guys. Heh. I honestly forgot I even posted this. Crikey.

SpeedyDonkey

  • Guest
Re:Defining new RSC graphics
« Reply #10 on: 03 Jul 2003, 10:51:44 »
Sui, grate tutorial, thanks  ;)

But I have some problems with the transparency  :-[ Is there any tutorial on the subject or could some one explain how to make a transparent logo in Photoshop

SpeedyDonkey :wave:

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Defining new RSC graphics
« Reply #11 on: 03 Jul 2003, 14:10:56 »
Well... here's the way I do it (again, quickly and dirty).

First decide what size you want your resource to be, then use File>New. Select your size, and in contents (which is your background colour) select transparent.

Now draw (or cut/paste) in your pretty picture or text. Save it as a .TGA file, and use texview to convert it to .PAA.
The reason you save it as .TGA is because it will preserve your transparency...

Try that out and see if it helps... ;)

SpeedyDonkey

  • Guest
Re:Defining new RSC graphics
« Reply #12 on: 03 Jul 2003, 17:22:32 »
Thanks!!   :D  8)

Offline CapMorgan

  • Members
  • *
  • OFP fan
    • Cazadores de monte
Re:Defining new RSC graphics
« Reply #13 on: 07 Nov 2003, 23:53:39 »
hi there.
Does someone knows where are the original OFP and RES titles defined?
You know, the ofprlogo01.paa, ofprlogo02.paa...I cant find the code.

Thanx for reading.