Home   Help Search Login Register  

Author Topic: Configuring cfgPatches: Is This Method Viable?  (Read 2041 times)

0 Members and 1 Guest are viewing this topic.

Offline Kundich

  • Members
  • *
  • "Habit is the daily battleground of character."
Configuring cfgPatches: Is This Method Viable?
« on: 21 Nov 2005, 23:39:46 »
Purely for the sake of my own anal-retentiveness, I would like to structure more than one class in my cfgPatches section in order to more easily keep track of my specific units and weapons corresponding to each class.  For example, I'd like to have:


Class cfgPatches
{
        class BLUFOR
        {
                units[]={};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
        class OPFOR
        {
                units[]={};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
        class FIA
        {
                units[]={};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
};


Might something like this work?  I don't want to get too far into writing the thing if it's not even possible.  Please let me know.


Thanks,
ADM

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Configuring cfgPatches: Is This Method Viable?
« Reply #1 on: 22 Nov 2005, 00:41:18 »
it would work given you had one config for  three different pbo files, named blufor, opfor and fia. i personally would at least use tags in order to prevent addon collisions... http://www.ofpec.com/tags_about.php
« Last Edit: 22 Nov 2005, 00:43:33 by remcen »
we're looking for members: IM:UC MOD

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Configuring cfgPatches: Is This Method Viable?
« Reply #2 on: 22 Nov 2005, 03:06:26 »
I don't think you would need 3 different configs or addons. Quick example:

Code: [Select]
Class cfgPatches
{
        class BLUFOR
        {
                units[]={guy1};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
        class OPFOR
        {
                units[]={guy2};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
        class FIA
        {
                units[]={guy3};
                weapons[]={};
                requiredAddons[]={};
                requiredVersion=1.90
        };
};

class cfgVehicles
....
class guy1...
class guy2...
class guy3...

In this example, there are 3 different units configured in the same addon. Each of the units is in a different part of the cfgPatches section. All that means is that if you place "guy1", the mission will write "BLUFOR" into the 'required addons' sections of the mission.sqm. Any 'missing addon:' errors regarding this unit will also say "BLUFOR".

Note that this can lead to confusion if the cfgPatches classname is different than the .pbo filename. For this reason, I would suggest that you only use 1 cfgPatches class, with the classname == to your .pbo filename. Also be sure to use OFPEC tags, as remcen stated.

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!

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Configuring cfgPatches: Is This Method Viable?
« Reply #3 on: 22 Nov 2005, 15:01:28 »
yeah, that's what i was trying to say... one cfgpatches subclass == one pbo file, it needn't be three different configs of course.
we're looking for members: IM:UC MOD

Offline Kundich

  • Members
  • *
  • "Habit is the daily battleground of character."
Re:Configuring cfgPatches: Is This Method Viable?
« Reply #4 on: 22 Nov 2005, 20:01:41 »
Just for clarification, I want to reduce the number of required addons by containing all units in one addon, but I want to organize them in a way that, from your comments, does not appear feasible.  Is it possible to break down the class further, i.e.:



class cfgPatches
{
     class adm_units
     {
          class blufor
          {
               units[]={};
               weapons[]={};
           };
          class opfor
          {
               units[]={};
               weapons[]={};
          };
          requiredaddons[]={};
          requiredversion=1.90
     };
};



I structured this wit units and weapons internal to the sub-sub class and the others as a being vital to the sub-class.  Does that make sense?  I guess it couldgo either way, but then again, I don't know.

The other alternative, I guess would be to modify an entire BIN file, but I'd rather not do that.  Let me know what you think.


Thanks,
ADM

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Configuring cfgPatches: Is This Method Viable?
« Reply #5 on: 22 Nov 2005, 20:14:46 »
You can include all unit classes in one CfgPatches:

Code: [Select]
class CfgPatches
{
    class nameofmyPBO
    {
        units[]={unitclassname1, unitclassname2, etc...etc};
        weapons[]={};
        requiredaddons[]={};
        requiredversion=1.90
    };
};


As you can see the first class under CfgPatches is the name of the PBO that has the config file that defines the unit classnames in CfgVehicles section and possibly any p3d model files.


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