Basic Modding Tutorial 1

From 7 Days to Die Wiki
Revision as of 19:50, 22 July 2020 by 73.221.79.98 (talk)
Jump to: navigation, search
Some items' or groups' chance to drop changes according to the player's gamestage. Here you can see those values for any gamestage you want using the little box below. Just type the gamestage you want in the box and press the Apply!-button. The values should change immediately, if the chance is different.

Current game stage: 1

Introduction[edit | edit source]

In this section we will go over creating a very basic mod for 7 Days to Die (Alpha 19). It will be the simplest type of mod, which simply modifies some of the parameters of existing game objects.

Specifically, we will make the nice wooden doors found on prefabs available as craftable items for the player.

Files and Folder Structure[edit | edit source]

To begin with, we will need some very specific folders and files for our mod.

1. First we need the root folder of the mod. I'm just going to create a folder called "MoreDoors".

2. Within that folder, create a subfolder called "config". This is where the actual configuration files will go. This is the only subfolder we need, because for this mod we are not adding any new assets to the game, just modifying existing assets.

3. Now create a new text file called "ModInfo.xml" in the root of MoreDoors.

4. Create three (3) text files in the config folder, called: blocks.xml, Localization.xml, and recipes.xml.

That's all we need for this simple mod. I'll explain the use of each file as we continue. Your folder structure should look like this:

MoreDoors
    \config
        \blocks.xml
        \Localization.txt
        \recipes.xml
    \ModInfo.xml

Using Xpath[edit | edit source]

Before we go further, I want to talk a little bit about xpath.

What is Xpath?[edit | edit source]

Xpath is a way of finding information in xml files, and modifying values in those xml files. In the context of our 7 Days to Die mod, it will allow us to change some of the parameters set by the main game, when the game loads up.

Xpath uses a very specific syntax, which I'm not going to document here. (See: "XPath Explained") But to help understand it, think of an XML file as almost being like a folder structure in your computer's file system.

You can have items that contain subitems, and value assignments. For example, a <block> item can have a bunch of attributes under it, which you could think of like:

\block\attribute

Xpath uses that sort of syntax for finding, adding, removing, and changing attributes of things in the game.

You can easily google for more assistance on using Xpath.