Skip to content
Konijima edited this page Jul 13, 2022 · 12 revisions

BaseMod

BaseMod can be used as an example or template to structure a Project Zomboid LUA mod.
Proper usage of the require function to manage file load order and prevent usage of globals.


Selling Points

  • Quick-start a new PZ mod.
  • Easily use Custom Events and GlobalModData in your mod.
  • Neat base structure to start and grow your project into.
  • Modularize and reload scripts efficiently during development.

Let's Get Started

First of all, fork/clone or download this project and copy the lua/ directory into your mod media/ directory.

Go to lua/shared/MyModName/Config.lua and edit the configuration of the mod.

  1. Change the ModName for the name of your mod.
  2. Change the ModInfo with your own and add anything you want to it.
  3. Define the GlobalModData table names your mod will use.
  4. Define the Custom Events your mod will use.
  5. Use a text-editor to rename all instance of MyModName by your own mod name.
  6. Rename the 3 directories MyModName by your own mod name.

If you need to, add new fields to the config object and access it using Client.Config.MyField and Server.Config.MyField.