Project Zomboid

Project Zomboid

Spiffo's Workshop
Welcome to Spiffo's Workshop, the place to find Project Zomboid mods, maps, buildings, and other things to tinker with. For our Modding Policy, click the "Learn More" Button below.
Learn More
How do I start making mods?
I've learned the basics of Lua and what an API is, but I'm still ♥♥♥♥♥♥♥♥♥♥. Can anyone link a tutorial or guide to help me out or something, please?
< >
Showing 1-13 of 13 comments
★Rainmaker★ 17 24 Dec, 2024 @ 12:14am 
I've thought about writing up a guide for making B42 mods because I really want more and more players to learn how to do this stuff. It's fun and the more mod devs we have, the better PZ can become overall.

Here's an attempt to explain the basic setup for B42.

Go to your Users/YourUserName/Zomboid/Workshop

That's where it all begins. Next I'll explain how to set up an empty mod that you can start doing stuff to and with.

Create a new folder, let's name it "A Mod by Wartime Photographer" (obviously without the " ")
In this folder create another new folder, named "Contents"
In "Contents", create a new folder named "mods"
In "mods", create a new folder named the way your mod's gonna be named. For this example the folder's gonna be "A Mod by Wartime Photographer"
In "A Mod by Wartime Photographer", create a new folder named "42", and a new folder named "common" (don't even worry about the common folder, it can stay empty since we're in B42)
In 42, create a new folder named "media"
In "media", you're going to need a new folder for everything you plan on adding/modifying, such as "clothing", "lua", "models_x", "scripts", "textures", etc.

Now you have all your folders ready to go, so let's set up a couple of mod.info files so you can actually enable your mod ingame. The mod.info file has to be an actual .INFO file, so just renaming a .txt file won't be enough. You can copy a mod.info file from someone else's mod and just edit its data if you need to.

The mod.info file can be set up like so, from top to bottom:
name=A Mod by WartimePhotographer
id=AModByWartimePhotographer
description=This is where you can describe what your mod does.
poster=
icon=

You can leave the poster and icon empty, or get yourself some .png files to use there. The poster can be a 256x256 png and the icon can be a x32x32 png.

The first mod.info file needs to be at A Mod by Wartime Photographer/Contents/mods/A Mod by Wartime Photographer.
The second mod.info file needs to be at the 42 folder.
Both should be 100% identical.

That's it, that's all you need to get started.
★Rainmaker★ 17 24 Dec, 2024 @ 12:20am 
Oh yeah and about subfolders, you can just look how PZ does them and do the exact same setup. So in Steam/steamapps/common/ProjectZomboid/media, you can look how the subfolders go. Open "lua" and you'll see client, server, shared, so if you plan on adding/editing lua, just make those same folders.
Last edited by ★Rainmaker★; 24 Dec, 2024 @ 12:20am
Exalted Samurai 1 24 Dec, 2024 @ 7:19am 
I did not want to create a new discussion but thought this follow up question.

How do you tag build 42? I cannot seem to find an answer to this.
Originally posted by Exalted Samurai:
I did not want to create a new discussion but thought this follow up question.

How do you tag build 42? I cannot seem to find an answer to this.

That's when you click workshop on the main menu and create/update a mod. Then you can add tags to it, and a workshop description. You'll need to have a preview.png to do this though, I think.
Originally posted by ★Rainmaker★:
Originally posted by Exalted Samurai:
I did not want to create a new discussion but thought this follow up question.

How do you tag build 42? I cannot seem to find an answer to this.

That's when you click workshop on the main menu and create/update a mod. Then you can add tags to it, and a workshop description. You'll need to have a preview.png to do this though, I think.
Thank you. I know the basic contents like folder structure already, but how to "know" the function or paramater I need?

E.g. I want to trigger a sound event when zombies die, what is that event, what function can make the game play my sound file? I've looked into pzwiki modding page for some time, but I find it hard to get these things.

All I can know is just some item ID, or some recipe / sound event already defined in the game file...
★Rainmaker★ 17 24 Dec, 2024 @ 8:36am 
A really good tool for that is Notepad++
Select the PZ media folder as your workspace and then right click it -> Find in Files -> type what you're looking for in "Find what:"
That's how I found almost all the lua stuff I've edited, especially all the TimedActions which can be painful to scroll through.
Originally posted by ★Rainmaker★:
A really good tool for that is Notepad++
Select the PZ media folder as your workspace and then right click it -> Find in Files -> type what you're looking for in "Find what:"
That's how I found almost all the lua stuff I've edited, especially all the TimedActions which can be painful to scroll through.
Thank you again, I thought there would be a place that modders can easily find all the functions...:lunar2019crylaughingpig:

I find vscode can search in files too, I'll check if there're some related functions.

By the way, your mods are great!:ontoagoodthing:
WillieSea 1 26 Dec, 2024 @ 8:35am 
You can also make your mod in your 'users' folder found here:
C:\Users\ComputerName\Zomboid\mods

Each mod will be in its own folder in the mods folder above.
For example:
C:\Users\ComputerName\Zomboid\mods\Levelers
C:\Users\ComputerName\Zomboid\mods\WillieSea

Each individual mod folder will have a folder named '42' and 'common' in it.

Each '42' folder will have the 'media' folder with all the various folders that pertains to your mod.
It is also where you put the 'mod.info' file and your icon and poster image files.

The 'common' folder is simply left empty.

If you also have a v41 mod, you can create a '41' folder where you created the '42' folder and put all version 41 mod files in that folder.
Mork 30 Dec, 2024 @ 10:30pm 
Thanks for the clarifications, I didn't add the "common" folder and the game wouldn't want to recognize my mod.
I used the old "mod" folder (as explained by WilliSea) as I always have done, but, if I understand correctly, if I place my mod in the "Workshop" folder (with all the correct subfolders, ofc) it will automatically be listed on the steam workshop? Or did I miss the purpose of that folder?
★Rainmaker★ 17 30 Dec, 2024 @ 10:31pm 
No. You'll have to go ingame, and through the main menu -> workshop buttons to actually upload it.
Placing it in your workshop folder just lets you use it ingame for debugging/developing.
bUrnIt 4 12 Jan @ 5:01am 
Originally posted by ★Rainmaker★:
Originally posted by Exalted Samurai:
I did not want to create a new discussion but thought this follow up question.

How do you tag build 42? I cannot seem to find an answer to this.

That's when you click workshop on the main menu and create/update a mod. Then you can add tags to it, and a workshop description. You'll need to have a preview.png to do this though, I think.
Hey sry to follow up on this, this late.
I notice I can't add tags like QoL or WIP from 41.78
Are those tags (and other that don't appear in the dropdown on PZ workshop upload) only on the build 42 ? or is there a way to add them alternatively (I tried from workshop.txt file, but it gets overwritten.)
I added tags to the workshop.txt file.

tags=Build 41;Build 42;Skills
Originally posted by bUrnIt:
Originally posted by ★Rainmaker★:

That's when you click workshop on the main menu and create/update a mod. Then you can add tags to it, and a workshop description. You'll need to have a preview.png to do this though, I think.
Hey sry to follow up on this, this late.
I notice I can't add tags like QoL or WIP from 41.78
Are those tags (and other that don't appear in the dropdown on PZ workshop upload) only on the build 42 ? or is there a way to add them alternatively (I tried from workshop.txt file, but it gets overwritten.)
Did you ever figure out the tag thing? Trying to add `QoL` to a mod I made but can't seem to do it. The workshop.txt file is overwritten in the process of updating the Workshop Item, so no go there.
< >
Showing 1-13 of 13 comments
Per page: 1530 50