Home   Help Search Login Register  

Author Topic: About « Class » of description.ext file  (Read 1106 times)

0 Members and 1 Guest are viewing this topic.

Strike Commander

  • Guest
About « Class » of description.ext file
« on: 10 Jul 2005, 22:33:58 »
Hello there,
I work to an addon who use some class of description.ext file, how can I put these class in config.cpp or in any other file? because I would like using this addon in every other mission...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:About « Class » of description.ext file
« Reply #1 on: 10 Jul 2005, 22:43:21 »
Hmmmm, not sure what you mean exactly.

The description.ext file is for use in missions and has nothing to do with addons.

Can you explain more?


Planck
I know a little about a lot, and a lot about a little.

Strike Commander

  • Guest
Re:About « Class » of description.ext file
« Reply #2 on: 10 Jul 2005, 23:09:51 »
in this addon I use some dialogs class and some texts class of desrciption.ext. I would like to put this dialogs class and texts class to the config.cpp of my addon.

example, this is a part of my description.ext
Code: [Select]
class RscTextBlack
{
   type = CT_STATIC;
   style = ST_LEFT;
   idc = -1;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {0, 0, 0, 1};
   font = "tahomab48";
   size = 0.35;
   sizeEx = 1;
   lineSpacing = 1.0;
   text = "";
};

and I want to put that in this config.cpp for use in any other mission.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:About « Class » of description.ext file
« Reply #3 on: 10 Jul 2005, 23:18:21 »
I think it would need to be supplied as a description.ext that a mission maker can add to his own description.ext for his mission.

I don't think you can incorporate that into a config.cpp.

But maybe someone else can prove me wrong.   ::)


Planck
« Last Edit: 10 Jul 2005, 23:18:48 by Planck »
I know a little about a lot, and a lot about a little.

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
Re:About « Class » of description.ext file
« Reply #4 on: 10 Jul 2005, 23:50:53 »
But maybe someone else can prove me wrong.   ::)

I think someone should be able to prove you wrong. I'm pretty sure you can add a resources section to a config.cpp file. If that doesn't work out, try this other solution:

As far as I know you can access all files in any of the loaded addons if you provide the correct path. Hence, you can create a file that contains your resource definitions and compress it with your addon. The user of your addon can then use #include to incorporate the resources into his own description.ext file.

I'm not sure about the path to access the addon file. I did some testing to that subject a long time ago but I have forgotten how to actually do this in the meantime, so you will have to do some of the testing on your own. I would suggest you try the paths "\<addon name>\<file name>" or ".\<addon name>\<file name>" first. Or maybe someone else know which path to use.

Or maybe my memory deceives me and I'm talking utter bullshit. No guarantees on this one.

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:About « Class » of description.ext file
« Reply #5 on: 11 Jul 2005, 01:54:44 »
here is an example of the kind of thing you want to do

this one's from author CHN

in your, or anyone else's editor, you would select this via static objects, or, you'd just insert a reference to it in mission.sqm eg


Just say no to bugz

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:About « Class » of description.ext file
« Reply #6 on: 11 Jul 2005, 03:26:00 »
Yes Mikero that is a config addon, which uses the empty.p3d in the data3d.pbo, but in this case he wants to incorporate a resource........a dialogue into a config.cpp.

I can't think of any class you could put that under from any of the main config classes.
These things belong, I think, in a description.ext.


Planck
I know a little about a lot, and a lot about a little.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:About « Class » of description.ext file
« Reply #7 on: 11 Jul 2005, 04:42:08 »
Snypir's SP/MP support pack has dialogs. You must put an #include statement into your description.ext to be able to use them. So I doubt you can define dialogs directly in a config like that. It is possible to define some description.ext "things" in a config though--sounds are definately possible, and maybe other things too.

Download his pack (off the ed depot) to see how he does it. Too bad the #include statement only works to include stuff from addons though, or else 3rd party scripts like the SOW system could have their dialogs kept separate from the rest of the mission's description.ext.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Strike Commander

  • Guest
Re:About « Class » of description.ext file
« Reply #8 on: 11 Jul 2005, 17:40:46 »
I looked in Snypir's SP/MP support pack , he call an .h file with the command #include in the description.ext file. I tried to make the same thing by putting in a file the example that I gave before. when I call the .h file from the description.ext it works like in Snypir's SP/MP support pack , but when I tried to call the .h file from the config.cpp, it didn't works!  :-\

any other idea? maybe someone know if and/or how I can call a .h file by a script...

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:About « Class » of description.ext file
« Reply #9 on: 11 Jul 2005, 18:32:31 »
You can't define any resouces in config.cpp...
You can only define resources in the resource.bin (or, resource.cpp...)...

The problem is that resource.bin/cpp can't be used per AddOn basis, only if you make a Mod... The resource.bin/cpp must be in the 'bin' folder in OFP root...

Anyway, don't call the .h from any .cpp, if you want to make a sort of description.ext 'addon' you need to do it like snYpir did and call a .h via the mission's description.ext by using #include...

This has been one of the annoyances for addon makers because the mission editor still needs to add the #include in their desc...ext, and usually that renders out the possibility for  the mission author to use his/her own resources...
Unless the addon author has thought of that before hand and provided an edited version of the .h for that kind of scenario...
« Last Edit: 11 Jul 2005, 18:35:47 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Strike Commander

  • Guest
Re:About « Class » of description.ext file
« Reply #10 on: 11 Jul 2005, 19:58:25 »
 ;) ok, thanx to all for the answers