The config.cpp
is used to tell dayz how and where to load your mod from.
class CfgPatches // required
{
class TestMod
{
requiredAddons[]=
{
"DZ_Data", // addon depedency
};
};
};
class CfgMods // required in pbo's which add/modify scripts or inputs
{
class TestMod
{
type = "mod"; // required
inputs = "mods\testmod\inputs\my_new_inputs.xml"; // optional, when using custom inputs
dependencies[]={"Game"}; // optional, when you need to set class dependency
class defs
{
// optional: you can add custom imagesets like this
class imageSets
{
files[]={"mods/testmod/gui/imagesets/mod1.imageset", "mods/testmod/gui/imagesets/mod2.imageset" };
};
// optional: you can add custom widget styles like this
class widgetStyles
{
files[]={"mods/testmod/gui/looknfeel/mod1.styles", "mods/testmod/gui/looknfeel/mod2.styles"};
};
class engineScriptModule
{
value=""; // when value is empty, default entry function is used
files[]={"mods/testmod/scripts/1_Core"}; // you can add any number of files or directories and they will be compiled together with original game module scripts
};
/*
script module config classes are optional, define only what you want to mod
class gameLibScriptModule
{
value="";
files[]={"mods/testmod/scripts/2_GameLib"};
};*/
class gameScriptModule
{
value="CreateGameMod"; // when value is filled, default script module entry function name is overwritten by it
files[]={"mods/testmod/scripts/3_Game"};
};
class worldScriptModule
{
value="";
files[]={"mods/testmod/scripts/4_World"};
};
class missionScriptModule
{
value="";
files[]={"mods/testmod/scripts/5_Mission"};
};
};
};
};
name = "Mod name"; // name
picture = "Mods/TestMod/modpic.tga"; // picture in expanded description
logoSmall = "Mods/TestMod/modlogosmall.tga"; // icon next to mod name when description is not expanded
logo = "Mods/TestMod/modlogo.tga"; // logo below game menu
logoOver = "Mods/TestMod/modlogohover.tga"; // on mouse hover over logo
tooltip = "tooltip"; // tool tip on mouse hover
overview = "Bestest mod"; // overview
action = "https://dayz.com/"; // link
author = "modguy"; // author
version = "1.5"; // version
This is a super simple CPP that can be used for when making a mod that only contains scripts
class CfgPatches
{
class TheMod
{
requiredAddons[]={}; // Put here any mods you wish to have load before yours this can also ensure that functions that you override take precedent.
};
};
class CfgMods
{
class TheMod
{
name = "The Mod name"; //The name for the mod
type="mod"; //Required
inputs = "TheMod\data\inputs.xml"; //The modded inputs(key binds)
dependencies[]={ "Game", "World", "Mission"}; // the script modules used my your mod
class defs
{
class gameScriptModule
{
value="";
files[]={"TheModName/scripts/3_Game"}; // the path to where your scripts are for the specified script module
};
class worldScriptModule
{
value="";
files[]={ "TheModName/scripts/4_World" };
};
class missionScriptModule
{
value="";
files[]={ "TheModName/scripts/5_Mission" };
};
};
};
};
This is an example from IceBlade's Armband Modding Tutorial which can be found here. Note that, in comparison to the above examples, class cfgMods{};
is missing. That's because there are no scripts needed for this mod.
class CfgPatches
{
class IceBlade_Clothing // Name of your mod.
{
units[]= // -------------------------------------------------------- |
{ // You can make a list of your items in units[]=. Each item |
"IB_Armband_Example", // must end with a comma (,) EXCEPT for the LAST line. |
"IB_Armband_Dragon" // No comma on last line. |
}; // Example: "IB_Armband_Dragon", |
weapons[]={}; // "IB_Armband_DB" |
requiredVersion=0.1; // |
requiredAddons[]= // |
{ // -------------------------------------------------------- |
"DZ_Characters" // Addons from the game your mod requires. No comma on |
}; // last line. For clothing all you need is DZ_Characters. |
}; // -------------------------------------------------------- |
};
class cfgVehicles
{
// ARMBANDS
// --------------------------------------------------------
class Armband_ColorBase; // if you are adding new classes/items or overrideing classes/items you must include the class they are inheriting from.
class IB_Armband_Dragon : Armband_ColorBase // Replace IB with your own prefix. Replace Dragon with your armband name.
{
displayName="Dragon Armband"; // Name that players will see ingame.
descriptionShort="Dragon Armband by IceBlade"; // Description that players will see ingame.
scope=2; // Leave alone.
color="ArmbandDragon"; // Replace Dragon with your armband name.
hiddenSelectionsTextures[]= // The file paths to your textures. Yes, you must keep the doubles.
{
"\IceBlade_Clothing\clothing\data\armbands\armband_dragon_g_co.paa",
"\IceBlade_Clothing\clothing\data\armbands\armband_dragon_small_co.paa",
"\IceBlade_Clothing\clothing\data\armbands\armband_dragon_small_co.paa",
"\IceBlade_Clothing\clothing\data\armbands\armband_dragon_big_co.paa",
"\IceBlade_Clothing\clothing\data\armbands\armband_dragon_big_co.paa" // No comma on last line.
};
};
};