Modding Basics – DayZ - Bohemia Interactive Community (2024)

Contents

  • 1 Requirements
  • 2 Setting up the Project Drive
  • 3 Folder Structure and config.cpp
  • 4 Packing the Mod
  • 5 Preparing FilePatching
  • 6 Creating our First Script
  • 7 Testing the Mod
    • 7.1 Singleplayer
    • 7.2 Multiplayer
  • 8 Publishing

We will be creating a simple mod that will print a message into the script log whenever the player jumps.

In order to do so we have to create the folder structure of the mod and then pack it into a .pbo file. A mod can have several .pbo files but most smaller mods will only ever need a single one.

Requirements

  • Steam Version of DayZ SA
  • DayZ Tools (Available through steam by navigating through Library -> Tools)
  • Basic syntax understanding of Enforce Script
  • Understanding of the PBO Structure

For the Workbench to detect the game, DayZ must have been started at least once! Otherwise a "game is not installed, exiting" error message will stop Workbench on its track.

Setting up the Project Drive

Create a Project Drive to store a representation of the DayZ filesystem and all of its files.

  • Launch DayZ Tools from Steam, selecting "Play DayZ Tools"
  • In the menubar, click Settings.
  • Adjust the path to the Project Drive by unchecking Default and then choosing a path that has a minimum of 20gb free space on the drive.
  • In the dropdown for Drive Letter, select one. Make sure to note which one you selected. It is recommended to use 'P:\'.
  • Click apply
  • In the menubar, navigate to Tools and then select Extract Game Data.
  • Wait for the process to finish

Folder Structure and config.cpp

  • Start by creating a folder that will house the mod namesake. This is otherwise called the root prefix of a mod. In this example, we will create one in our 'P:\' drive called FirstMod.
  • Within that folder let's create another folder called Scripts and then within that folder create another folder called 4_World.
  • Let's first create the mod configuration. Within the Scripts folder create a new file called config.cpp and then copy the following sample:
class CfgPatches{class FirstMod{requiredAddons[] ={// ""};};};class CfgMods{class FirstMod{type = "mod";class defs{class worldScriptModule{value = "";files[] = { "FirstMod/Scripts/4_World" };};};};};
Read up on the config.cpp CfgMods structure

DayZ standalone has 5 script modules that can be modded. In order that they load they are 'engineScriptModule', 'gamelibScriptModule', 'gameScriptModule', 'worldScriptModule' and 'missionScriptModule'. Using the correct script module is very important!

Packing the Mod

Although we are not ready to test, let's pack the mod. This is so we can create and edit scripts through file patching.

When packing a mod, make sure the addons (and keys) folder are in lower case and that the files within addons are also lowercase. This is so your mod will work with the DayZ Linux Server binaries.

  • To start off, let's create a folder where we will place all of our packed mods. Within your work drive, create a new folder called Mods.
  • Within that folder let's create the folder that will be our first mod. Let's name it @FirstMod. All mods require an addons folder so let's also create that within the mod folder.
  • Launch DayZ Tools from Steam, selecting "Play DayZ Tools"
  • Click "Addon Builder"
  • Set the Addon source directory directory, in our case it will be P:\FirstMod\Scripts'
  • Set the Destination filename, in our case it will be P:\Mods\@FirstMod\addons\
  • At the bottom left of the window, select Options and set path to project folder to your work drive
  • Click Pack and wait (if this process fails check 'Enable extended logging' to see why or uncheck 'Binarize').

Preparing FilePatching

  • Go to your DayZ installation folder. It will be within the steamapps folder at 'steamapps/common/DayZ'.
  • Copy the full path.
  • Open a command line window and run the following command, replacing 'DayZInstallationFolder' with the path you copied earlier.
mklink /J "DayZInstallationFolder\FirstMod" "P:\FirstMod"
  • Navigate back to the DayZ installation folder, you should now see 'FirstMod' there. Enter the folder and you should see 'Scripts' and the files within it as you would see in the work drive.

Creating our First Script

Let's create a script inside the world script module that will output to the script log whenever we jump.

To start navigate to the '4_World' folder created earlier.

If you are or ever wish to work with workbench then do the following. Create a new folder called 'FirstMod'. This is because 'Workbench' does not distinguish the files and folders between what mod they come from, or if it was even a mod.

Let's create a script that will "mod" an existing class. Let's first create the 'PlayerBase.c' file within the current folder. We do that by adding the 'modded' keyword to the class declaration. Within this new class let's override a method to add our own behavior, in this case, it would be to print to the script log.

modded class PlayerBase// modded keyword for modding an existing class{override void OnJumpStart()// overriding an existing method{super.OnJumpStart();// call the original jump callback method so we don't break stuffPrint("My first mod, yay!");// our modded print}}

Testing the Mod

Make sure to always properly test your mod before releasing it to the public!

Singleplayer

Let's first create a simple singleplayer mission that will spawn a playable character within chernarus on game load.

  • Within your DayZ installation folder, if it doesn't exist create a new folder named 'missions'. Enter the folder.
  • Create a new folder called 'firstMission.ChernarusPlus'. Note that the 'firstMission' is the name of the mission and 'ChernarusPlus' is the name of the world as named within 'CfgWorlds'.
  • Within the newly created mission create the entry point script 'init.c' and paste the following player spawn script

Mission CreateCustomMission(string path){return new MissionGameplay();}void main(){PlayerBase player;ItemBase item;// Create playerplayer = PlayerBase.Cast( GetGame().CreatePlayer(NULL, "SurvivorF_Linda", "2200 10 2200", 0, "NONE") );// Spawn a black t-shirtitem = player.GetInventory().CreateInInventory("TShirt_Black");// Spawn a green short jeansitem = player.GetInventory().CreateInInventory("ShortJeans_Green");// Spawn a brown working bootsitem = player.GetInventory().CreateInInventory("WorkingBoots_Brown");// Spawn an apple in the t-shirt, don't redefine 'item' so we can still spawn other items in the t-shirtitem.GetInventory().CreateInInventory("Apple");// Select player the client will be controllingGetGame().SelectPlayer(NULL, player);}

Open a command-line window and run the following command, replacing 'DayZInstallationFolder' with the path dayz is installed at.

start /D "DayZInstallationFolder" DayZDiag_x64.exe "-mod=P:\Mods\@FirstMod" "-mission=./missions/firstMission.ChernarusPlus" -filePatching

Additional mods can be added by being delimited by a semi-colon. For example: -mod=P:\Mods\@FirstMod;P:\Mods\@SecondMod.

We are using the singleplayer mission created earlier.

If you are using the Script Editor within Workbench, you will now see the custom message in the output section every time you jump.If you are not, navigate to your profiles folder ( default: "%localappdata%/DayZ" ) and open the most recent file starting with script. This will contain the message.

Multiplayer

Open a command-line window and run the following command, replacing 'DayZInstallationFolder' with the path dayz is installed at.

start /D "DayZInstallationFolder" DayZDiag_x64.exe "-mod=P:\Mods\@FirstMod" -filePatching -server -config=serverDZ.cfg

where the serverDZ.cfg can be copied from the DayZ Server distribution on Steam. It is loading the 'dayzOffline.ChernarusPlus' mission by default. Within the server configuration, you will need to modify the following options:

BattlEye = 0;// turn off BE since diag exe does not run with itverifySignatures = 0;// if testing mods which aren't properly signed yetallowFilePatching = 1; // allow clients with unpacked data to join

You can then join the server by using the following command:

start /D "DayZInstallationFolder" DayZDiag_x64.exe "-mod=P:\Mods\@FirstMod" -filePatching -connect=127.0.0.1 -port=2302

Publishing

Before publishing disable filepatching by removing the launch parameter and pack all the .pbo files again. Verify that everything works without filepatching enabled.

Additional steps you will need to go through when you want to share the mod with the world through the steam workshop:

  • Use DS utils (DayZ Tools) to create a private and public bikey and use it to sign your pbo, as well as include the public bikey in your mod
  • Use Publisher (DayZ Tools) to upload to Steam Workshop

Retrieved from ""

Modding Basics – DayZ - Bohemia Interactive Community (2024)

FAQs

How to mod DayZ standalone? ›

Installing Mods on Your DayZ Experimental Client

Find the mods you would like to use and click Subscribe. Launch DayZ and go to the MODS tab. Click the drop-down arrow on one of the mods, then the three dots and Open Folder in Windows Explorer. Copy and paste these mods to a new folder on your Desktop.

Did Bohemia Interactive make DayZ? ›

DayZ is a multiplayer only survival video game developed and published by Bohemia Interactive.

Where is the DayZ mod folder? ›

You can find this directory on the same hard drive where you have DayZ installed. The name of the folder is the WorkshopID of the respective mod. For Community Framework, the WorkshopID is 1559212036 .

What are DayZ mods written in? ›

Enforce Script is the language that is used by the Enfusion engine first introduced in DayZ Standalone. It is a Object-Oriented Scripting Language (OOP) that works with objects and classes and is similar to C# programming language.

Can you play DayZ singleplayer with mods? ›

DayZ is primarily a multiplayer game but can be played solo through mods and private servers. DayZ is not a single player game by default? but there are unofficial mods that can installed for solo play. To setup a private server, you'll need to install server, configure settings, and connect to play.

What is a standalone mod? ›

Standalone mods are the most primitive type of mod, working by directly replacing game files. Standalone mods are distributed as a partial copy of the game and installed by merging that copy into a Rain World installation, replacing all colliding files in the process (including Assembly-CSharp.

What engine does Bohemia Interactive use? ›

Enfusion Engine - Powering the future of Bohemia.

What is the end goal of DayZ? ›

Survival is the primary goal in DayZ.

What does DayZ stand for? ›

• 8y ago. DayZ=Day Zero. The day when chernarus was hit by the infection that killed a big part of it's population. The human survivors (us players) are immune to the virus. The infected in DayZ are not zombies, they are not living dead they are infected "sick" people.

How do I get to my mods folder? ›

The mods folder is located in your documents folder, not in the program files. Navigate to your PC > Documents > Electronic Arts > The Sims 4 folder and there you will find the mods folder.

What does the Z stand for in DayZ? ›

Actually the Z stands for Zero DayZero.

How many people played DayZ mod? ›

I almost can't belive its been more than a decade since the mod took the world by storm.

Is there swearing in DayZ? ›

You have the option to kill other survivors too, and there are a variety of guns and melee weapons to help you along the way. Sex: None, really. Swearing: There IS mild swearing in the game, which is the speech of some fellow survivors. Once, I bore a gun, and the attacking survivor shouts on the screen: "Sh*t!

Is DayZ standalone or modded? ›

The standalone title, also called DayZ, carries over many of the core gameplay mechanisms of the Arma 2 mod. DayZ has enhanced graphics, enhanced UI, and AI compared to the mod.

Can you build in DayZ standalone? ›

As of 1.0, players can construct bases or camps, ranging from simple loot stashes in underground stashes or barrels, to complex walled structures with Fences, Watchtowers, an electricity system and vehicles.

What do you need to play DayZ mod? ›

DayZ Mod Recommended Requirements
  1. CPU: Intel Core i5 or AMD Phenom X4 or faster.
  2. CPU SPEED: Info.
  3. RAM: 2 GB.
  4. VIDEO CARD: Nvidia Geforce GTX 260 or ATI Radeon HD 5770 or faster with Shader Model 3 and 896 MB VRAM.
  5. DEDICATED VIDEO RAM: 896 MB.
  6. PIXEL SHADER: 3.0.
  7. VERTEX SHADER: 3.0.
  8. OS: Windows 7.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 5443

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.