Modding Structure – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (→‎PBO structure: prefix consistency with the rest of the page)
Line 44: Line 44:
{
{
    type = "mod";     // required
    type = "mod";     // required
inputs = "testmod\inputs\my_new_inputs.xml";     // optional, when using custom inputs
inputs = "mods\testmod\inputs\my_new_inputs.xml";     // optional, when using custom inputs
dependencies[]={"Game"};  // optional, when you need to set class dependency
dependencies[]={"Game"};  // optional, when you need to set class dependency
Line 52: Line 52:
             class imageSets
             class imageSets
             {
             {
                 files[]={"testmod/gui/imagesets/mod1.imageset", "testmod/gui/imagesets/mod2.imageset" };
                 files[]={"mods/testmod/gui/imagesets/mod1.imageset", "mods/testmod/gui/imagesets/mod2.imageset" };
             };
             };
              
              
Line 58: Line 58:
             class widgetStyles
             class widgetStyles
             {
             {
                 files[]={"testmod/gui/looknfeel/mod1.styles", "testmod/gui/looknfeel/mod2.styles"};
                 files[]={"mods/testmod/gui/looknfeel/mod1.styles", "mods/testmod/gui/looknfeel/mod2.styles"};
             };
             };
             class engineScriptModule
             class engineScriptModule
             {
             {
                 value=""; // when value is empty, default entry function is used
                 value=""; // when value is empty, default entry function is used
                 files[]={"testmod/scripts/1_Core"}; // you can add any number of files or directories and they will be compiled together with original game module scripts
                 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
             };
             };
              
              
Line 71: Line 71:
             {
             {
                 value="";
                 value="";
                 files[]={"testmod/scripts/2_GameLib"};
                 files[]={"mods/testmod/scripts/2_GameLib"};
             };*/
             };*/
              
              
Line 77: Line 77:
             {
             {
                 value="CreateGameMod"; // when value is filled, default script module entry function name is overwritten by it
                 value="CreateGameMod"; // when value is filled, default script module entry function name is overwritten by it
                 files[]={"testmod/scripts/3_Game"};
                 files[]={"mods/testmod/scripts/3_Game"};
             };
             };
              
              
Line 83: Line 83:
             {
             {
                 value="";
                 value="";
                 files[]={"testmod/scripts/4_World"};
                 files[]={"mods/testmod/scripts/4_World"};
             };
             };
              
              
Line 89: Line 89:
             {
             {
                 value="";
                 value="";
                 files[]={"testmod/scripts/5_Mission"};
                 files[]={"mods/testmod/scripts/5_Mission"};
             };
             };
         };
         };

Revision as of 13:48, 18 June 2019



This page details the structure of DayZ mods as well as their configuration and presentation.

Mod structure

Mod is loaded using the -mod= launch parameter


-mod=C:\MyMods\TestMod


Typical mod folder downloaded from steam workshop will contain:

  • Addons folder, holds the mod's .pbo files
  • Keys folder, contains public .bikey used to sign the .pbo files (required for client-server signature verification)
  • meta.cpp file, holds workshop meta data (will be automatically created during mod publishing)
  • mod.cpp optional config file, holds information for mod presentation

PBO structure

The only required part of .pbo is config.cpp


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"};
            };
        };
    };
};


The internal structure is largely up to the modders themselves, e.g. in case of script files, it doesn't matter where they are placed as long as they are in their respective script module and paths are set properly.

Mod presentation

Configured through mod.cpp in the mod root folder


name = "Mod name"; 								// name
picture = "Mods/TestMod/modpic.edds";			// picture
logo = "Mods/TestMod/modlogo.edds";				// logo
logoSmall = "Mods/TestMod/modlogosmall.edds";	// icon
logoOver = "Mods/TestMod/modlogohover.edds";	// logo on mouse hover
tooltip = "tooltip";							// tool tip on mouse hover
overview = "Bestest mod"; 						// overview
action = "https://dayz.com/";					// link
author = "modguy";								// author
version = "1.5";								// version