Modding Structure – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search

Template:Stub


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 = "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[]={"testmod/gui/imagesets/mod1.imageset", "testmod/gui/imagesets/mod2.imageset" };
            };
             
            // optional: you can add custom widget styles like this
            class widgetStyles
            {
                files[]={"testmod/gui/looknfeel/mod1.styles", "testmod/gui/looknfeel/mod2.styles"};
            };
            class engineScriptModule
            {
                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
            };
             
            /*
            script module config classes are optional, define only what you want to mod
            class gameLibScriptModule
            {
                value="";
                files[]={"testmod/scripts/2_GameLib"};
            };*/
            
            class gameScriptModule
            {
                value="CreateGameMod"; // when value is filled, default script module entry function name is overwritten by it
                files[]={"testmod/scripts/3_Game"};
            };
             
            class worldScriptModule
            {
                value="";
                files[]={"testmod/scripts/4_World"};
            };
             
            class missionScriptModule
            {
                value="";
                files[]={"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