How to create a mod [B42]

Project Zomboid593 views17 favorites4 min readby El-SoplyaUpdated 2 FebView on Steam ↗

Introduction

Project Zomboid is a home to almost 50 thousand modifications from users, all is very likely to be unique or addon-like or maybe ports to newer versions from other users. If you have your own idea of mod, that will improve your or maybe even everyone's game expierence - this guide will help you with basis.

Project Zomboid was created using both Java and Lua languages. For mod creation you need to know only Lua. Tho it can be daunting to navigate the complexities of modding, especially on the Lua aspect when you have no programming experience. A lot is possible and your main limitation is knowing how to achieve things and the best course of actions, which you will learn after practicing more and more. Get used to the environment, learn the various tools available and how modding works, and don't discourage if your first mod doesn't do great or doesn't work too well because you will learn from it.

It is clear that AI tools will usually bring you more problems than solutions if you blindly trust it, and you will end up directly going back to square one most of the time. The list below are a few tips to help you get started with modding Project Zomboid:

  1. Start Small: Begin with simple mods and gradually increase complexity as you become more comfortable with the process of making mods.
  2. Utilize Resources: Take advantage of available resources such as the JavaDocs[pzwiki.net], community forums, and the few tutorials to learn more about the modding practices. Make sure to read the wiki pages of the modding fields[pzwiki.net] you are working with.
  3. Experiment: Don't be afraid to experiment with code snippets and test them in a controlled environment. This will help you understand how different functions and methods work.
  4. Learn from others: It is likely what you are trying to achieve has already been done or something similar was already done. Look for existing mods that achieve similar goals and study their implementation to reverse engineer the method used and create your own. You can access the files of mods you have downloaded with the method explained in the game files[pzwiki.net] page.
5. Ask for Help: If you're stuck, reach out to the modding community[pzwiki.net] for assistance where many experienced modders are willing to help newcomers. Simply ask your questions and be respectful, and you will get some help, some answers or at the very least some guidance.

Folder Structure

When working on a mod, it is highly advised to follow the guide regarding mod structure[pzwiki.net] first which explains how to setup folders for your mod to be detected in-game. It notably focuses on using the Workshop folder instead of the mods folder inside the cache folder due to its advantages and the cons of modding from the mods folder.

Individual pages for the modding fields also explain the important folders they use.

Programming Environment

Visual Studio Code is the norm for programming Project Zomboid mods thanks to many extensions made by the community. These extensions are the following:

  • Umbrella - syntax highlight for the Lua API.
  • Project Zomboid Script Support - syntax highlight for the Scripts.
  • Zed Script - another syntax highlight for the Scripts.

IntelliJ IDEA is also another IDE which is often used to parse the Java files easily after decompiling the game code.

Notepad++ is not recommended as other editors with a bit more if not equal setup provide a better working environment for programming while also having extra tools for Project Zomboid modding. It is especially limited as it can't be used as an IDE to easily navigate a mod project files.

Image Editing

No particular software is suggested for image editing, you are free to use softwares you confortable with. However, here are a few suggestions:

  • GIMP- a free and open-source image editor that is powerful and versatile.
  • Photoshop - a professional image editing software with advanced features but paid.
  • Krita - a free and open-source digital painting software that is great for illustrations and concept art.
  • Canva - image-design editor built-in browser

3D Modelling

Same as for editing images, no particular software is suggested for modeling and animating, you are free to use softwares you comfortable with. However, we suggest Blender which is a powerful and free open-source 3D modeling software used by the majority of the community but with a steep learning curve.

There are no specific tutorials for Project Zomboid modeling, but you can find many general tutorials on how to use Blender and how to create 3D models.

Mapping

A dedicated set of tools are maintainted specifically for Project Zomboid mapping, which are listed on the main Mapping page[pzwiki.net].

Video Guide

This is the best guides for b42 mod creation, it's a playlist of one famous modder - SimonKDT:

My mod

This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.