OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Kundich 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
-
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
-
I don't think you would need 3 different configs or addons. Quick example:
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.
-
yeah, that's what i was trying to say... one cfgpatches subclass == one pbo file, it needn't be three different configs of course.
-
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
-
You can include all unit classes in one CfgPatches:
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