Modding: Difference between revisions

From PZwiki
m (→‎New modding page, under construction: Minor mechanical fixes)
(Merge old and new pages, remove old links, resort page, general overhaul)
Line 1: Line 1:
{{Languages}}
{{Languages}}
{{Header|Modding|version=Version 41|incver=68}}
{{Header|Modding|version=Version 41|incver=78.16}}
[[File:SpiffosWorkshop.png|link=https://steamcommunity.com/app/108600/workshop/|frame|right|Spiffo's Workshop is the home of [[Project Zomboid]] mods on [[Steam]].]]
[[File:SpiffosWorkshop.png|link=https://steamcommunity.com/app/108600/workshop/|frame|right|Spiffo's Workshop is the home of [[Project Zomboid]] mods on [[Steam]].]]
This page is being reworked. Please see the [[Modding#New modding page, under construction|new page variant]] lower down, and make changes there


=='''Terms & Conditions'''==
=='''Terms & Conditions'''==
By playing Project Zomboid, you agree to the: '''[https://projectzomboid.com/blog/support/terms-conditions/ Terms and Conditions]'''
By playing Project Zomboid, you agree to the '''[https://projectzomboid.com/blog/support/terms-conditions/ Terms & Conditions]'''.


In terms of the modding of PZ, you also agree with the: '''[https://projectzomboid.com/blog/modding-policy/ Modding Policy]'''
By modding Project Zomboid, you also agree with the '''[https://projectzomboid.com/blog/modding-policy/ Modding Policy]'''.


===Key restrictions===
===Key restrictions===
*The Indie Stone reserve the right to implement any features in the game irrespective of whether mods exist that accomplish the same goal.
*The Indie Stone reserves the right to implement any features in the game irrespective of whether mods exist that accomplish the same goal.
*PZ modders are solely responsible for their mod, including (but not limited to compliance with any hosting platforms (such as Steam Workshop). They are also responsible for obtaining third party consents for any third party materials in the mod. Legally, we have to ask that modders to ‘represent and warrant’ (i.e. promise legally) that their mod is their own original work and any third party contents are fully and properly licensed by the modder.
*Modders are solely responsible for their mod, including (but not limited to compliance with any hosting platforms (such as Steam Workshop). They are also responsible for obtaining third party consents for any third party materials in the mod. Legally, we have to ask that modders to ‘represent and warrant’ (i.e. promise legally) that their mod is their own original work and any third party contents are fully and properly licensed by the modder.
*Creation of mods is subject to our [https://projectzomboid.com/blog/modding-policy/ modding policy], which may be updated from time to time with any technical requirements regarding how PZ mods must work.
*Creation of mods is subject to our [https://projectzomboid.com/blog/modding-policy/ modding policy], which may be updated from time to time with any technical requirements regarding how PZ mods must work.
*Project Zomboid modders are free to receive monetary/gift donations from the players who use their releases, and appreciate the time and effort put into them. However having mods created exclusively for those who choose to donate (or separate ‘in-mod’ content and bonuses) is not allowed. Mod creators cannot sell modifications to Project Zomboid.
*Project Zomboid modders are free to receive monetary/gift donations from the players who use their releases, and appreciate the time and effort put into them. However, having mods created exclusively for those who choose to donate (or separate ‘in-mod’ content and bonuses) is not allowed. Mod creators cannot sell modifications to Project Zomboid.


==How to install/play mods==
==Installing and using mods==
[[File:Mod unchecked.jpg|thumb|right|350px|Mod menu]]
*[[Installing mods]] - how to install mods for [[Steam]] or [[GOG]] version of the game.
To get a full tutorial on how to install mods, see [https://theindiestone.com/forums/index.php?/topic/1395-how-to-install-uninstall-mods RoboMat's tutorial on the forums].
*[[Using mods]] - how to enable and configure mods.
*[[Mod problems solution]] - what to do if mods do not work well or break the game.
<span style="font-size: 120%; font-weight: bold; color: green;">Tip: </span> join [https://discord.gg/theindiestone The Indie Stone Discord server] for get access to '''#mod_support''' channel, where you can ask question about using mods.


To start a mod up, first make sure the mod is installed in the correct directory. Once you have done this, start up Project Zomboid. Once you get to the main menu, down at the bottom of the screen when you see "Survival" and "Sandbox" you will also find a menu option called Mods. Click on it, which will then lead you to the mod menu.
To start a mod up, first make sure the mod is installed in the correct directory. Once you have done this, start up Project Zomboid. Once you get to the main menu, down at the bottom of the screen when you see menu options you will also find a menu option called MODS. Click on it, which will then lead you to the mod menu.


In there you should see the list of mods that you have installed. Double click on the mod you wish to start and a green tick should appear next to the mod.
In there you should see the list of mods that you have installed. Double click on the mod you wish to start and a green tick should appear next to the mod.
Next thing to do is shut down Project Zomboid and start it up again. Once started your mod should now be ready to go. Instructions on using the mod are usually contained in README's or information in the thread.
Next thing to do is shut down Project Zomboid and start it up again. Once started your mod should now be ready to go. Instructions on using the mod are usually contained in README's or information in the thread.


==Current mods==
==Current mods==
{{Main|Mods}}
*[https://steamcommunity.com/app/108600/workshop/ Spiffo's Workshop]
*[https://steamcommunity.com/app/108600/workshop/ Spiffo's Workshop]
*[https://theindiestone.com/forums/index.php?/forum/58-mods/ Completed mods]
*[https://theindiestone.com/forums/index.php?/forum/58-mods/ Completed mods]
*[https://theindiestone.com/forums/index.php?/forum/59-wip/ Work-in-Progress mods]
*[https://theindiestone.com/forums/index.php?/forum/59-wip/ Work-in-Progress mods]


==Modding tutorials==
==Creating mods==
{| class="pztable-com sortable" style="width:50%;"
In modding for PZ, there are several main directions:
! style="width:60%;" | Tutorial
*'''Changing scripts''' - scripts in the game describe the parameters of items, recipes, and vehicles. Making a mod that changes the values ​​of items, vehicles, a recipe, or adds a new item is not a difficult. This does not require programming knowledge; any text editor may be used. Scripts are in .txt files and have a specific structure.
! style="width:20%;" | Author
*'''Writing Lua code''' - the main direction in PZ modding. Most mods contain Lua code. PZ is developed mainly in Java and Lua, so using Lua code in mods is closely related to the exploration of Java and Lua game code. When creating more complex mods, you will have to dive into the decompiled Java code of the game. We will cover the basics of the Lua language, but you should be familiar with the basics of programming. A general understanding of the syntax of the Java language is also desirable, as it may be necessary to explore the game code to figure out how some functions work.
! style="width:20%;" | Last updated
*'''Creating 3D models''' - at the moment, with the help of mods, you can add new models of vehicles, weapons, ordinary items, and clothes to the game. The game uses 2 model formats - .X and .FBX. For us to create mods with models, the .FBX format will be enough.
|-
*'''Creating animations''' - Creating animations for the character. Includes creating an animation file and integrating it into the game.
| [https://github.com/FWolfe/Zomboid-Modding-Guide Project Zomboid Modding Guide] <small>(WIP)</small>
*'''Creating textures, pictures and icons''' - This direction complements the others. Models will need textures, items will need icons, the interface will need certain images, and maps will need textures for new tiles (new objects to be placed on the map).
| Fenris Wolf
*'''Map creation''' - create locations, buildings, and general environments for the game. See [[#Mapping]].
| July 27, 2019
*'''Translations''' - translating game to various languages, see [[#Translations]].
|-
| [[Lua Events]] (v41.65)
| co`
| {{#switch:{{REVISIONMONTH1:Lua Events}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December}} {{REVISIONDAY:Lua Events}}, {{REVISIONYEAR:Lua Events}}
|-
| [https://theindiestone.com/forums/index.php?/topic/61-robomats-modding-tutorials-updated-12112013/ RoboMat's Tutorials]
| RoboMat
| July 24, 2013
|-
| [https://www.projectzomboid.com/modtools/ModdingGuide2.rtf Java Scripting Guide (very out of date, only the item and recipe sections seems to be applicable to current builds)]
| Lemmy101
| July 24, 2013
|}


====A note regarding optimization and timestamps====
<span style="font-size: 120%; font-weight: bold; color: green;">Tip: </span> Join [https://discord.gg/theindiestone The Indie Stone Discord server] to access the '''#mod_development''' chat, where you can ask any question about creating Project Zomboid mods.
This numerical information in the console.txt output log is a timestamp, such as in "LOG  : General    , 1669904231941"
If you need to evaluate the runtime impact of code it is a good metric.


====A note regarding updating and/or changing mods====
===Working tools===
Removing .txt and .lua files from a mod before updating them to the steam workshop may result in file mismatch errors etc. on account of steam not automatically removing said files from clients and/or servers.
*'''Text editors''' - used to edit scripts and write code. Preferably use editors with Lua syntax highlighting - like [https://notepad-plus-plus.org Notepad++] or [https://code.visualstudio.com/ VS Code]
One solution is manually deleting these files from the installation directories of the server and/or clients.
*'''Image editor''' - used to create icons, textures for items and tiles. For example: [https://www.gimp.org/ GIMP], [https://www.adobe.com/ru/products/photoshop.html Photoshop] (paid)
As well modders can avoid this issue by keeping those files, instead of removing them, but editing those files so they are empty instead of having any functional content. Including commented text explaining the reason for this in the files is also a good practice.
*'''3D modeling''' - used to work on 3D models. For example: [https://store.steampowered.com/app/365670/Blender Blender]


====A note regarding Macs, Linux and case sensitivity====
====Modding tools====
Note that, unlike Windows, Mac and Linux OS are case-sensitive regarding file and directory names.
*[https://github.com/Konijima/PZ-Libraries Decompiling & setting up auto-complete/intellisense in IDEA IntelliJ]
Although people playing PZ on Linux is uncommon, it's far more common with server hosting services.
*[https://www.guidgenerator.com/ Free Online GUID Generator: for making GUIDs for modded clothing and outfits.]
To avoid issues, make sure and follow the vanilla PZ capitalization conventions for file and directory names.


For example: with clothing mods fileguidtable.xml works for Windows and Mac, but will cause serious issue for Linux as it will be looking for "fileGuidTable.xml", as that is how the vanilla PZ file is capitalized. Although Client, Server, and Shared will work for the lua directories for non-Linux systems. it won't work for Linux; consequently use the vanilla capitalization, "client", "server" and "shared" for those.
====Mapping tools====
 
*[https://theindiestone.com/forums/index.php?/topic/50425-latest-tilezed-worlded-and-tilesets-march-14-2022/ TileZed, WorldEd, and Tilesets] <small>(March 14, 2022)</small>
====Javadoc reference to Project Zomboid codebase====
*[https://theindiestone.com/forums/index.php?/topic/23816-latest-tilezed-worlded-and-tilesets-may-17-2018/&do=findComment&comment=270743 TileZed, WorldEd, and Tilesets] <small>(May 17, 2018)</small>
*[https://zomboid-javadoc.com/41.78/ Project Zomboid Java documentation v41.78 (Unofficial)]
*[https://projectzomboid.com/modding/ Project Zomboid Java documentation v41.77]<!--Previous/Outdated: "https://theindiestone.com/zomboidjavadocs/"-->
*[https://zomboid-javadoc.com/41.65/ Project Zomboid Java documentation v41.65 (Unofficial)]
*[https://zomboid-javadoc.com/40.43/ Project Zomboid Java documentation v40.43 (Unofficial)]
*[https://zomboid-javadoc.com/39.67/ Project Zomboid Java documentation v39.67 (Unofficial)]
*[https://zomboid-javadoc.com/38.30/ Project Zomboid Java documentation v38.30 (Unofficial)]


====Basic Lua language====
===Basic Lua language===
*[[Lua Intro|An Introduction to Lua]]
*[[Lua Intro]] - an introduction to Lua
*[[Variables Assignments Datatypes|Variables, Assignments and Datatypes]]
*[[Variables Assignments Datatypes]] - variables, Assignments and Datatypes
**[[Variables Assignments Datatypes/Task one solutions|''Test yourself solutions'']]
**[[Variables Assignments Datatypes/Task one solutions|Task one solutions]] - ''test yourself solutions''
*[[Arithmetic Operators]]
*[[Arithmetic Operators]]
*[[Relational and Boolean Operators]]
*[[Relational and Boolean Operators]]
*[[Concatentation and Length Operators]]
*[[Concatenation and Length Operators]]
*[[If Statements and Functions]]
*[[If Statements and Functions]]
*[[Loops]]
*[[Loops]]
*[[Local and Global Variables]]
*[[Local and Global Variables]]
*[[Tables (modding)|Tables]]
*[[Tables (modding)]]
*[[Looping Through Tables]]
*[[Looping Through Tables]]
*[[Lua Functions]]
*[[Lua Functions]]
*[[Lua Objects]]
*[[Lua Events]]


====Typescript modding====
===Other resources===
You can now use Typescript language to write your mods which are then compiled into lua. However it is not necessary to use Typescript to write mods.
{{Improve}}
*[https://github.com/asledgehammer/PipeWrench/wiki PipeWrench - Wiki]
*[[Mod structure]] - how the mod works and how to create a template for the mod
*[https://github.com/asledgehammer/PipeWrench PipeWrench - Typing]
*[[Folders structure]] - description of files and folders that will be useful when developing mods
*[https://github.com/Konijima/pzpw PZPW - NodeJS Command-line Tool]
*[[Debug mode]] - how to run the game in developer mode and use it
*[[Startup parameters]] - startup parameters to launch the game with
*[[Scripts guide]] - scripting guide (.txt files) for items, recipes and translations
*[[File formats]] - file formats documentation
*[[Decompiling game code]] - how to study the Java source code of the game
*[[New Tiles]] - making new tiles
*[[Testing Mods in Multiplayer]] - guide about setting up the mod to work on the server
*[[GameTime]]
*[[List of Tiledefs in use by mods]]
*[[Room definitions]]
*[[Tile Properties]]
*[[Vehicle Zones]]


====Modding tools====
==Mapping==
*[https://github.com/Konijima/PZ-Libraries Decompiling & setting up auto-complete/intellisense in IDEA IntelliJ]
{{Main|Mapping}}
*[https://notepad-plus-plus.org/downloads/ Notepad++, a simple editor.]
{| class="pztable-com sortable" style="width: 50%;"
*[https://code.visualstudio.com/ VS code, a simple editor.]
! style="width: 60%;" | Tutorial
*[https://www.guidgenerator.com/ Free Online GUID Generator: for making GUIDs for modded clothing and outfits.]
! style="width: 20%;" | Author
! style="width: 20%;" | Last updated
|-
| [https://theindiestone.com/forums/index.php?/topic/21951-the-one-stop-tilezed-mapping-shop/&tab=comments#comment-251715 The One Stop TileZed Mapping Shop]
| RingoD123
| January 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/22576-how-to-combine-map-mods/&tab=comments#comment-257834 How to Combine Map Mods]
| RingoD123
| June 11, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&tab=comments#comment-73574 Full list of current Room Definitions]
| RingoD123
| February 7, 2014
|-
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&page=3&tab=comments#comment-257787 Making new room definitions]
| RingoD123
| June 10, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos]
| Thuztor
| April 20, 2015
|-
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos] <small>(Outdated)</small>
| Thuztor
| September 12, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/21932-project-zomboid-mapping-instructions-vegmap-to-testing-custom-map/&tab=comments#comment-251579 VegMap to Testing Custom Map]
| Cpt_Paradox
| January 28, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/23264-making-rooms-with-the-place-wall-tool-item-spawns-ortho-and-more/&tab=comments#comment-265065 Making rooms with the place wall tool, item spawns, ortho and more!]
| Cpt_Paradox
| November 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/23263-sliding-glass-doors-new-textures-heres-how/&tab=comments#comment-265063 Sliding Glass Doors, New Textures, Here's How!]
| Cpt_Paradox
| November 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/21943-how-to-make-a-map-start-to-finish-full-video-tutorial/&tab=comments#comment-251657 How to make a map Start to Finish Full Video Tutorial]
| BlackBeard
| January 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/22018-all-player-made-building-archives-verison-2-532019/&tab=comments#comment-252207 All player made Building Archives]
| BlackBeard
| May 31, 2019
|-
| [https://theindiestone.com/forums/index.php?/topic/8790-custom-texture-packs-and-tile-definitions/&tab=comments#comment-113526 Custom texture packs and tile definitions]
| EasyPickins
| June 5, 2014
|-
| [https://theindiestone.com/forums/index.php?/topic/22127-cards-tutorial-for-terrain-generation/&tab=comments#comment-252998 Card's Tutorial for Terrain Generation]
| Cardenaglo
| February 22, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/18084-video-tutorials-mapping-atox-warrior/&tab=comments#comment-221862 Video Tutorials mapping]
| Atoxwarrior
| June 26, 2016
|}


====Important additional modding resources====
====Mapping resources====
*[https://discord.com/channels/136501320340209664/232196827577974784/901629291274575883 Setting up the mod.info file: a link to a post on TIS Discord explaining how.]
*[https://www.pztiles.com/home PZ Tiles and a comprehensive selection of other mapping and tile making resources.]
*[https://theindiestone.com/forums/index.php?/topic/9799-key-code-reference/ PZ Keycode references.]
*[https://drive.google.com/drive/folders/12jQxlDlyC-fACV45oCWshZb60QHoQ6kf The build 41 base and vegetation maps for PZ.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Items%20variables.md Variables to use when creating an item.]
*[https://theindiestone.com/forums/index.php?/topic/25742-project-zomboid-basemap/ The build 40 base and vegetation maps for PZ.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Make%20a%20custom%20skill%20or%20perk.md Guide for adding a new Skill/Perk, add XP and find all perks names.]
*[https://drive.google.com/file/d/1zvjxsjLi2KGwU7SVbLoH2m32UuSgCxcw/view?usp=sharing An app for replacing the zombie layers on cells.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20make%20a%20custom%20trait.md Guide for adding a custom trait.]
*[https://drive.google.com/file/d/1PRsZfmE3Ov7U9Nc_mSBv62fMFROpIIct/view?usp=sharing An app for moving the cells in maps.]
*[https://discord.com/channels/136501320340209664/279303619277488128/946017802647658586 A more recent base map for PZ.]


====General additional modding resources====
==Localization==
*[https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003 How To Create an Animation.]
*[https://steamcommunity.com/sharedfiles/filedetails/?id=2721464487 Guide to make a hair mod.]
*[https://www.youtube.com/playlist?list=PLwV27NP3RkJl27tveCa9EMMvAdjmGXZsf A YouTube playlist with Blackbeard's modding tutorials.]
*[https://discord.com/channels/136501320340209664/279303619277488128/864229655867031572 Photoshop Masks used for making and editing tile sprites, a link to a post on TIS Discord with the file.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20use%20global%20modData.md Global Mod Data: How to use this powerful tool for tracking global mod data.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20make%20a%20custom%20timed%20actions.md Guide to make a custom Timed Action.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Animation%20list.md A list of all the animation variables used in timed actions.]
*[https://github.com/Poltergeistzx/Project-Zomboid/blob/main/docs/TimedActions%20Flow%20Chart.pdf A flow chart for the Timed Actions]
*[https://github.com/Konijima/PZ-Community-API/tree/master/Contents/mods/CommunityAPI/media/lua/client/SpawnerAPI  SpawnerAPI: Allows for pending the spawns of vehicles, items, zombies in order to spawn things anywhere in the world. Upon loading the cell in question the item becomes spawned in.]
*[https://discord.com/channels/136501320340209664/232196827577974784/864843709900128278 Guide to how PZ loot distribution works on TIS Discord.]
*[https://discord.com/channels/136501320340209664/232196827577974784/899479292088569906 Spawning a tile from it's name: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/891769429543759883 How to spawn loot on specific zombie outfit corpses: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/890921284379246613 Item spawning examples that work: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/867969619749666866 An archive with files demonstrating how to add modded sandbox options: a link to a post on TIS Discord.]
*[https://discord.com/channels/136501320340209664/232196827577974784/887879308473933884 A tool for dumping distro table contents to console.txt: a lint to a post on TIS Discord with the code.]
*[https://discord.com/channels/136501320340209664/232196827577974784/931744932656451645 How to use read/write with files in mods, useful for server ini files: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/940523841027964948 A post on TIS discord with code to serialize lua table into json and vice versa.]
*[https://steamcommunity.com/sharedfiles/filedetails/?id=2474838710 A guide on how to change Zomboid's in-game music and sound effects.]
*[https://discord.com/channels/136501320340209664/232196827577974784/869049443117314128 Looking for Error messages in the console log, a short guide on TIS Discord.]
*[https://github.com/asledgehammer/Candle Candle - EmmyLua Support for PZ's Java API.]
*[https://github.com/pzstorm/capsid pzstorm/capsid - Project Zomboid mod development framework for Gradle. Apparently abandoned?]
*[https://www.youtube.com/watch?v=iv7N7gmowWU WordZed tutorial on YouTube.]
*[https://theindiestone.com/forums/index.php?/topic/28633-complete-vehicle-modding-tutorial/  Complete Vehicle Modding Tutorial on TIS forum.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Useful%20links.md Useful links.]
*[https://pzwiki.net/wiki/New_Tiles Making New Tiles for PZ.]
*[https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/ How To Mod The Loot Distribution System.]
*[https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md An up-to-date (41.78) reference to events and hooks.]
*[https://github.com/demiurgeQuantified/PZEventStubs PZEventStubs: Lua stubs for events and hooks.]
*[https://github.com/demiurgeQuantified/PZModdingGuides/blob/main/guides/SandboxOptions.md A reference for adding custom sandbox options.]
 
====Clothing modding resources====
*[https://steamcommunity.com/sharedfiles/filedetails/?id=3025955520/ Guide for adding new clothing items with modding for build 41.]
*[https://discord.com/channels/136501320340209664/232196827577974784/945412454521913385 A list of Blood Locations used for Clothing Modding; a post on TIS Discord.]
*[https://discord.com/channels/136501320340209664/869327724504842330/931152156805955625 A list of Mask IDs used for Clothing Modding; a post on TIS Discord.]
*[https://discord.com/channels/136501320340209664/869327724504842330/954782177067937832 A Graphic to explain the masking system for clothing in PZ; a post on TIS Discord.]
 
====Old and more specific additional modding resources====
*[https://github.com/Konijima/PZ-Community-API/blob/master/Contents/mods/CommunityAPI/media/lua/shared/CommunityAPI/IsoUtils.lua  isoRangeScan: This is an utility function meant for large scale scans of isoGridSquares around a given IsoObject. The scans are done fractally - that is to say from a center (or centers) outward to fill a larger area.]
* [https://theindiestone.com/forums/index.php?/topic/21923-itemzed-updated-11b/ ItemZed: for editing Item scripts and distribution files (out of date, needs to be updated to work properly with build 41)]
 
====Localization====
If you plan to support other languages in your mod, you should save the text file using the proper encoding format that corresponds to the language you're translating. If you don't, characters will not appear correctly. Language information can be found in media/lua/shared/Translate/%lang%/language.txt files.
If you plan to support other languages in your mod, you should save the text file using the proper encoding format that corresponds to the language you're translating. If you don't, characters will not appear correctly. Language information can be found in media/lua/shared/Translate/%lang%/language.txt files.


Line 297: Line 308:
|}
|}


==Mapping tutorials==
==Notes==
{{Main|Mapping}}
===A note regarding optimization and timestamps===
{| class="pztable-com sortable" style="width:50%;"
This numerical information in the console.txt output log is a timestamp, such as in "LOG  : General    , 1669904231941"
! style="width:60%;" | Tutorial
If you need to evaluate the runtime impact of code it is a good metric.
! style="width:20%;" | Author
 
! style="width:20%;" | Last updated
===A note regarding updating and/or changing mods===
Removing .txt and .lua files from a mod before updating them to the steam workshop may result in file mismatch errors etc. on account of steam not automatically removing said files from clients and/or servers.
One solution is manually deleting these files from the installation directories of the server and/or clients.
As well modders can avoid this issue by keeping those files, instead of removing them, but editing those files so they are empty instead of having any functional content. Including commented text explaining the reason for this in the files is also a good practice.
 
===A note regarding Mac, Linux and case sensitivity===
Note that, unlike Windows, Mac and Linux OS are case-sensitive regarding file and directory names.
Although people playing PZ on Linux is uncommon, it's far more common with server hosting services.
To avoid issues, make sure and follow the vanilla PZ capitalization conventions for file and directory names.
 
For example: with clothing mods fileguidtable.xml works for Windows and Mac, but will cause serious issue for Linux as it will be looking for "fileGuidTable.xml", as that is how the vanilla PZ file is capitalized. Although Client, Server, and Shared will work for the lua directories for non-Linux systems. it won't work for Linux; consequently use the vanilla capitalization, "client", "server" and "shared" for those.
 
==External resources==
{| class="pztable-com sortable" style="width: 50%;"
! style="width: 60%;" | Tutorial
! style="width: 20%;" | Author
! style="width: 20%;" | Last updated
|-
|-
| [https://theindiestone.com/forums/index.php?/topic/21951-the-one-stop-tilezed-mapping-shop/&tab=comments#comment-251715 The One Stop TileZed Mapping Shop]
| [https://github.com/FWolfe/Zomboid-Modding-Guide Project Zomboid Modding Guide] (WIP)
| RingoD123
| Fenris Wolf
| January 30, 2017
| January 22, 2023
|-
|-
| [https://theindiestone.com/forums/index.php?/topic/22576-how-to-combine-map-mods/&tab=comments#comment-257834 How to Combine Map Mods]
| [https://theindiestone.com/forums/index.php?/topic/61-robomats-modding-tutorials-updated-12112013/ RoboMat's Tutorials]
| RingoD123
| RoboMat
| June 11, 2017
| July 24, 2013
|-
|-
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&tab=comments#comment-73574 Full list of current Room Definitions]
| [https://www.projectzomboid.com/modtools/ModdingGuide2.rtf Java Scripting Guide (very out of date, only the item and recipe sections seems to be applicable to current builds)]
| RingoD123
| Lemmy101
| February 7, 2014
| July 24, 2013
|-
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&page=3&tab=comments#comment-257787 Making new room definitions]
| RingoD123
| June 10, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos]
| Thuztor
| April 20, 2015
|-
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos] <small>(Outdated)</small>
| Thuztor
| September 12, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/21932-project-zomboid-mapping-instructions-vegmap-to-testing-custom-map/&tab=comments#comment-251579 VegMap to Testing Custom Map]
| Cpt_Paradox
| January 28, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/23264-making-rooms-with-the-place-wall-tool-item-spawns-ortho-and-more/&tab=comments#comment-265065 Making rooms with the place wall tool, item spawns, ortho and more!]
| Cpt_Paradox
| November 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/23263-sliding-glass-doors-new-textures-heres-how/&tab=comments#comment-265063 Sliding Glass Doors, New Textures, Here's How!]
| Cpt_Paradox
| November 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/21943-how-to-make-a-map-start-to-finish-full-video-tutorial/&tab=comments#comment-251657 How to make a map Start to Finish Full Video Tutorial]
| BlackBeard
| January 30, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/22018-all-player-made-building-archives-verison-2-532019/&tab=comments#comment-252207 All player made Building Archives]
| BlackBeard
| May 31, 2019
|-
| [https://theindiestone.com/forums/index.php?/topic/8790-custom-texture-packs-and-tile-definitions/&tab=comments#comment-113526 Custom texture packs and tile definitions]
| EasyPickins
| June 5, 2014
|-
| [https://theindiestone.com/forums/index.php?/topic/22127-cards-tutorial-for-terrain-generation/&tab=comments#comment-252998 Card's Tutorial for Terrain Generation]
| Cardenaglo
| February 22, 2017
|-
| [https://theindiestone.com/forums/index.php?/topic/18084-video-tutorials-mapping-atox-warrior/&tab=comments#comment-221862 Video Tutorials mapping]
| Atoxwarrior
| June 26, 2016
|}
|}


====Mapping tools====
===Javadoc reference to Project Zomboid codebase===
*[https://theindiestone.com/forums/index.php?/topic/50425-latest-tilezed-worlded-and-tilesets-march-14-2022/ TileZed, WorldEd, and Tilesets] <small>(March 14, 2022)</small>
*[https://zomboid-javadoc.com/41.78/ Project Zomboid Java documentation v41.78 (Unofficial)]
*[https://theindiestone.com/forums/index.php?/topic/23816-latest-tilezed-worlded-and-tilesets-may-17-2018/&do=findComment&comment=270743 TileZed, WorldEd, and Tilesets] <small>(May 17, 2018)</small>
*[https://projectzomboid.com/modding/ Project Zomboid Java documentation v41.77]<!--Previous/Outdated: "https://theindiestone.com/zomboidjavadocs/"-->
*[https://zomboid-javadoc.com/41.65/ Project Zomboid Java documentation v41.65 (Unofficial)]
*[https://zomboid-javadoc.com/40.43/ Project Zomboid Java documentation v40.43 (Unofficial)]
*[https://zomboid-javadoc.com/39.67/ Project Zomboid Java documentation v39.67 (Unofficial)]
*[https://zomboid-javadoc.com/38.30/ Project Zomboid Java documentation v38.30 (Unofficial)]
 
===Typescript modding===
You can now use Typescript language to write your mods which are then compiled into lua. However it is not necessary to use Typescript to write mods.
*[https://github.com/asledgehammer/PipeWrench/wiki PipeWrench - Wiki]
*[https://github.com/asledgehammer/PipeWrench PipeWrench - Typing]
*[https://github.com/Konijima/pzpw PZPW - NodeJS Command-line Tool]


====File formats====
===Important additional modding resources===
*[[File formats|File formats documentation]]
*[https://discord.com/channels/136501320340209664/232196827577974784/901629291274575883 Setting up the mod.info file: a link to a post on TIS Discord explaining how.]
*[https://theindiestone.com/forums/index.php?/topic/9799-key-code-reference/ PZ Keycode references.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Items%20variables.md Variables to use when creating an item.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Make%20a%20custom%20skill%20or%20perk.md Guide for adding a new Skill/Perk, add XP and find all perks names.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20make%20a%20custom%20trait.md Guide for adding a custom trait.]


====Mapping resources====
===General additional modding resources===
*[https://www.pztiles.com/home PZ Tiles and a comprehensive selection of other mapping and tile making resources.]
*[https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003 How To Create an Animation.]
*[https://drive.google.com/drive/folders/12jQxlDlyC-fACV45oCWshZb60QHoQ6kf The build 41 base and vegetation maps for PZ.]
*[https://steamcommunity.com/sharedfiles/filedetails/?id=2721464487 Guide to make a hair mod.]
*[https://theindiestone.com/forums/index.php?/topic/25742-project-zomboid-basemap/ The build 40 base and vegetation maps for PZ.]
*[https://www.youtube.com/playlist?list=PLwV27NP3RkJl27tveCa9EMMvAdjmGXZsf A YouTube playlist with Blackbeard's modding tutorials.]
*[https://drive.google.com/file/d/1zvjxsjLi2KGwU7SVbLoH2m32UuSgCxcw/view?usp=sharing An app for replacing the zombie layers on cells.]
*[https://discord.com/channels/136501320340209664/279303619277488128/864229655867031572 Photoshop Masks used for making and editing tile sprites, a link to a post on TIS Discord with the file.]
*[https://drive.google.com/file/d/1PRsZfmE3Ov7U9Nc_mSBv62fMFROpIIct/view?usp=sharing An app for moving the cells in maps.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20use%20global%20modData.md Global Mod Data: How to use this powerful tool for tracking global mod data.]
*[https://discord.com/channels/136501320340209664/279303619277488128/946017802647658586 A more recent base map for PZ.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How%20to%20make%20a%20custom%20timed%20actions.md Guide to make a custom Timed Action.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Animation%20list.md A list of all the animation variables used in timed actions.]
*[https://github.com/Poltergeistzx/Project-Zomboid/blob/main/docs/TimedActions%20Flow%20Chart.pdf A flow chart for the Timed Actions]
*[https://github.com/Konijima/PZ-Community-API/tree/master/Contents/mods/CommunityAPI/media/lua/client/SpawnerAPI  SpawnerAPI: Allows for pending the spawns of vehicles, items, zombies in order to spawn things anywhere in the world. Upon loading the cell in question the item becomes spawned in.]
*[https://discord.com/channels/136501320340209664/232196827577974784/864843709900128278 Guide to how PZ loot distribution works on TIS Discord.]
*[https://discord.com/channels/136501320340209664/232196827577974784/899479292088569906 Spawning a tile from it's name: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/891769429543759883 How to spawn loot on specific zombie outfit corpses: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/890921284379246613 Item spawning examples that work: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/867969619749666866 An archive with files demonstrating how to add modded sandbox options: a link to a post on TIS Discord.]
*[https://discord.com/channels/136501320340209664/232196827577974784/887879308473933884 A tool for dumping distro table contents to console.txt: a lint to a post on TIS Discord with the code.]
*[https://discord.com/channels/136501320340209664/232196827577974784/931744932656451645 How to use read/write with files in mods, useful for server ini files: a link to a post on TIS Discord explaining how.]
*[https://discord.com/channels/136501320340209664/232196827577974784/940523841027964948 A post on TIS discord with code to serialize lua table into json and vice versa.]
*[https://steamcommunity.com/sharedfiles/filedetails/?id=2474838710 A guide on how to change Zomboid's in-game music and sound effects.]
*[https://discord.com/channels/136501320340209664/232196827577974784/869049443117314128 Looking for Error messages in the console log, a short guide on TIS Discord.]
*[https://github.com/asledgehammer/Candle Candle - EmmyLua Support for PZ's Java API.]
*[https://github.com/pzstorm/capsid pzstorm/capsid - Project Zomboid mod development framework for Gradle. Apparently abandoned?]
*[https://www.youtube.com/watch?v=iv7N7gmowWU WordZed tutorial on YouTube.]
*[https://theindiestone.com/forums/index.php?/topic/28633-complete-vehicle-modding-tutorial/  Complete Vehicle Modding Tutorial on TIS forum.]
*[https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Useful%20links.md Useful links.]
*[https://pzwiki.net/wiki/New_Tiles Making New Tiles for PZ.]
*[https://pzwiki.net/wiki/New_Tiles Making New Tiles for PZ.]
*[https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/ How To Mod The Loot Distribution System.]
*[https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md An up-to-date (41.78) reference to events and hooks.]
*[https://github.com/demiurgeQuantified/PZEventStubs PZEventStubs: Lua stubs for events and hooks.]
*[https://github.com/demiurgeQuantified/PZModdingGuides/blob/main/guides/SandboxOptions.md A reference for adding custom sandbox options.]


=New modding page, under construction=  
===Clothing modding resources===
This section contains a rework of the modding page. Some extra information may be here.
*[https://steamcommunity.com/sharedfiles/filedetails/?id=3025955520/ Guide for adding new clothing items with modding for build 41.]
{{Underconstruction}}{{Header|Modding|version=Version 41|incver=78}}
*[https://discord.com/channels/136501320340209664/232196827577974784/945412454521913385 A list of Blood Locations used for Clothing Modding; a post on TIS Discord.]
[[File:SpiffosWorkshop.png|link=https://steamcommunity.com/app/108600/workshop/|frame|right|Spiffo's Workshop is the home of [[Project Zomboid]] mods on [[Steam]].]]
*[https://discord.com/channels/136501320340209664/869327724504842330/931152156805955625 A list of Mask IDs used for Clothing Modding; a post on TIS Discord.]
=='''Terms & Conditions'''==
*[https://discord.com/channels/136501320340209664/869327724504842330/954782177067937832 A Graphic to explain the masking system for clothing in PZ; a post on TIS Discord.]
By playing Project Zomboid, you agree to the '''[https://projectzomboid.com/blog/support/terms-conditions/ Terms and Conditions]'''.


By modding, you also agree with the '''[https://projectzomboid.com/blog/modding-policy/ Modding Policy]'''.
===Old and more specific additional modding resources===
 
*[https://github.com/Konijima/PZ-Community-API/blob/master/Contents/mods/CommunityAPI/media/lua/shared/CommunityAPI/IsoUtils.lua  isoRangeScan: This is an utility function meant for large scale scans of isoGridSquares around a given IsoObject. The scans are done fractally - that is to say from a center (or centers) outward to fill a larger area.]
===Key restrictions===
*[https://theindiestone.com/forums/index.php?/topic/21923-itemzed-updated-11b/ ItemZed: for editing Item scripts and distribution files (out of date, needs to be updated to work properly with build 41)]
*The Indie Stone reserves the right to implement any features in the game irrespective of whether mods exist that accomplish the same goal.
*Modders are solely responsible for their mod, including but not limited to compliance with any hosting platforms (such as Steam Workshop). They are also responsible for obtaining third party consents for any third party materials in the mod. Legally, we have to ask that modders to ‘represent and warrant’ (i.e. promise legally) that their mod is their own original work and any third party contents are fully and properly licensed by the modder.
*Creation of mods is subject to our [https://projectzomboid.com/blog/modding-policy/ modding policy], which may be updated from time to time with any technical requirements regarding how mods must work.
*Project Zomboid modders are free to receive monetary/gift donations from the players who use their releases, and appreciate the time and effort put into them. However, having mods created exclusively for those who choose to donate (or separate ‘in-mod’ content and bonuses) is not allowed. Mod creators cannot sell modifications to Project Zomboid.
 
=='''Installing and using mods'''==
'''[[Installing mods]]''' - How to install mods for Steam or GoG version of the game
 
'''[[Using mods]]''' - How to enable and configure mods
 
'''[[Mod problems solution|Solution to the most common problems with mods]]''' - What to do if mods do not work well or break the game
 
<span style="font-size:120%;font-weight:bold;color:green;">Tip: </span> Join [https://discord.gg/theindiestone PZ Discord] for get access to '''#mod_support''' chat, where you can ask any question about using mods.
 
=='''Creation of mods'''==
===Introduction===
In modding for PZ, there are several main directions:
* '''Changing scripts''' - Scripts in the game describe the parameters of items, recipes, and vehicles. Making a mod that changes the values ​​of items, vehicles, a recipe, or adds a new item is not a difficult. This does not require programming knowledge; any text editor may be used. Scripts are in .txt files and have a specific structure.
* '''Writing Lua code''' - The main direction in PZ modding. Most mods contain Lua code. PZ is developed mainly in Java and Lua, so using Lua code in mods is closely related to the exploration of Java and Lua game code. When creating more complex mods, you will have to dive into the decompiled Java code of the game. We will cover the basics of the Lua language, but you should be familiar with the basics of programming. A general understanding of the syntax of the Java language is also desirable, as it may be necessary to explore the game code to figure out how some functions work.
* '''Creating 3D Models''' - At the moment, with the help of mods, you can add new models of vehicles, weapons, ordinary items, and clothes to the game. The game uses 2 model formats - .X and .FBX. For us to create mods with models, the .FBX format will be enough.
* '''Map Creation''' - Create locations, buildings, and general environments for the game
* '''Creating animations''' - Creating animations for the character. This includes creating an animation file and integrating it into the game.
* '''Creating textures, pictures and icons''' - This direction complements the others. Models will need textures, items will need icons, the interface will need certain images, and maps will need textures for new tiles (new objects to be placed on the map).
 
<span style="font-size:120%;font-weight:bold;color:green;">Tip: </span> Join [https://discord.gg/theindiestone PZ Discord] to access the '''#mod_development''' chat, where you can ask any question about creating Project Zomboid mods.
 
===Working tools===
*'''Text editors''' - Used to edit scripts and write code. Preferably use editors with Lua syntax highlighting - like [https://notepad-plus-plus.org Notepad++] or [https://code.visualstudio.com/ VS Code]
*'''3D Modeling''' - Used to work on 3D models. For example: [https://store.steampowered.com/app/365670/Blender Blender]
*'''Image Editor''' - Used to create icons, textures for items and tiles. For example: [https://www.gimp.org/ GIMP], [https://www.adobe.com/ru/products/photoshop.html Photoshop]
 
===Beginner level===
[[Mod structure]] - How the mod works and how to create a template for the mod
 
[[Folders structure|PZ folder structure and Zomboid folder]] - Description of files and folders that will be useful when developing mods
 
[[Debug mode|Starting the game in Debug mode]] - How to run the game in developer mode and use it
 
[[Scripts guide|Script syntax]] - Scripting guide (.txt files) for items, recipes and translations
 
[[Lua guide|Introduction to Lua]] - Lua Language Guide
 
[[Log and Error guide|Logging and error handling]] - How to use logs to get game/mod information and handle errors
 
[[Item modelling guide|Create a 3D model for the item]] - Create a model with a texture for the item
 
[[Lua Objects|Objects]] - PZ Objects, Variables and Functions
 
[[Lua Events|Events]] - PZ events and connection to them
 
[[Audio guide|Working with sounds and music]] - Adding and playing audio files
 
[[Loot spawn guide|Working with spawn tables]] - Modifying item spawn tables
 
[[Steam Workshop|Mod Upload to Steam Workshop]] - How to checkout and upload a mod to Steam Workshop
 
[[ModData guide|ModData]] - Working with mod data and storing data
 
'''[[Guide: mod "Hammer of Thor"|Creating the first mod]]''' - Guide about creating the mod "Hammer of Thor"
*Creating a template for mod
*Adding new items to the game
*Adding new recipes
*Adding items to item spawn tables
*Connecting to events (Lua)
*Adding sounds
*Adding translations for other languages
 
===Advanced level===
[[Tiles guide|Tiles]] - Tile guide
 
[[Transport guide|Vehicle]] - Transport guide
 
[[Animation guide|Animations]] - Animation guide
 
[[TimedActions guide|TimedActions]] - Timed Actions guide
 
[[UI guide|User Interface]] - User Interface guide
 
[[Occupations, Traits and Skills guide|Occupations, Traits and Skills]] - Guide about Occupations, Traits, and Skills
 
[[Testing Mods in Multiplayer|Testing Mods in Multiplayer]] - Guide about setting up the mod to work on the server
 
'''[[Guide: mod "WWII_Outfit"|Creating a Firearms and Armor Mod]]''' - Guide about creating a mod "WWII Outfit"
*Creating melee and ranged weapons
*Creating clothes and armor
*Adding and customizing items
'''[[Guide: mod "Sports car"|Creating a mod that adds a new vehicle]]''' - Guide about creating a mod "Sports car"
*Creating model and textures
*Adding and configuring vehicle
'''[[Guide: mod "Lake house"|Creating a mod that adds a new map]]''' - Guide about creating a mod "Lake house"
*Creating a template for map
*Creating new tiles
*Creating buildings
*Adding a map and tiles to the game
'''[[Guide: mod "Macarena"|Creating a mod that adds new animations]]''' - Guide about creating a mod "Macarena"
*Creating animation
*Adding animation to the game
'''[[Guide: mod "Key duplicates"|Creating a mod that extends the functionality]]''' - Guide about creating a mod "Key duplicates"
*Creating TimedActions
*Working with user interface
*Adding profession, perk and skill
'''[[Guide: mod "ATM"|Creating a mod with a client-server architecture]]''' - Guide about creating a mod "ATM"
*Working with client-server commands
*Working with global ModData
 
==Useful articles and links==
*[[Working with files|Files]] - Guide about working with files
*[[Mod and file load order|In-Game Mod Loading]] - Mod Load Order and Mod File Load Order
*[[Decompiling game code|Decompiling the game code]] - How to study the Java source code of the game

Revision as of 17:24, 21 October 2023

ModdingModding
Spiffo's Workshop is the home of Project Zomboid mods on Steam.

Terms & Conditions

By playing Project Zomboid, you agree to the Terms & Conditions.

By modding Project Zomboid, you also agree with the Modding Policy.

Key restrictions

  • The Indie Stone reserves the right to implement any features in the game irrespective of whether mods exist that accomplish the same goal.
  • Modders are solely responsible for their mod, including (but not limited to compliance with any hosting platforms (such as Steam Workshop). They are also responsible for obtaining third party consents for any third party materials in the mod. Legally, we have to ask that modders to ‘represent and warrant’ (i.e. promise legally) that their mod is their own original work and any third party contents are fully and properly licensed by the modder.
  • Creation of mods is subject to our modding policy, which may be updated from time to time with any technical requirements regarding how PZ mods must work.
  • Project Zomboid modders are free to receive monetary/gift donations from the players who use their releases, and appreciate the time and effort put into them. However, having mods created exclusively for those who choose to donate (or separate ‘in-mod’ content and bonuses) is not allowed. Mod creators cannot sell modifications to Project Zomboid.

Installing and using mods

Tip: join The Indie Stone Discord server for get access to #mod_support channel, where you can ask question about using mods.

To start a mod up, first make sure the mod is installed in the correct directory. Once you have done this, start up Project Zomboid. Once you get to the main menu, down at the bottom of the screen when you see menu options you will also find a menu option called MODS. Click on it, which will then lead you to the mod menu.

In there you should see the list of mods that you have installed. Double click on the mod you wish to start and a green tick should appear next to the mod.

Next thing to do is shut down Project Zomboid and start it up again. Once started your mod should now be ready to go. Instructions on using the mod are usually contained in README's or information in the thread.

Current mods

Main article: Mods

Creating mods

In modding for PZ, there are several main directions:

  • Changing scripts - scripts in the game describe the parameters of items, recipes, and vehicles. Making a mod that changes the values ​​of items, vehicles, a recipe, or adds a new item is not a difficult. This does not require programming knowledge; any text editor may be used. Scripts are in .txt files and have a specific structure.
  • Writing Lua code - the main direction in PZ modding. Most mods contain Lua code. PZ is developed mainly in Java and Lua, so using Lua code in mods is closely related to the exploration of Java and Lua game code. When creating more complex mods, you will have to dive into the decompiled Java code of the game. We will cover the basics of the Lua language, but you should be familiar with the basics of programming. A general understanding of the syntax of the Java language is also desirable, as it may be necessary to explore the game code to figure out how some functions work.
  • Creating 3D models - at the moment, with the help of mods, you can add new models of vehicles, weapons, ordinary items, and clothes to the game. The game uses 2 model formats - .X and .FBX. For us to create mods with models, the .FBX format will be enough.
  • Creating animations - Creating animations for the character. Includes creating an animation file and integrating it into the game.
  • Creating textures, pictures and icons - This direction complements the others. Models will need textures, items will need icons, the interface will need certain images, and maps will need textures for new tiles (new objects to be placed on the map).
  • Map creation - create locations, buildings, and general environments for the game. See #Mapping.
  • Translations - translating game to various languages, see #Translations.

Tip: Join The Indie Stone Discord server to access the #mod_development chat, where you can ask any question about creating Project Zomboid mods.

Working tools

  • Text editors - used to edit scripts and write code. Preferably use editors with Lua syntax highlighting - like Notepad++ or VS Code
  • Image editor - used to create icons, textures for items and tiles. For example: GIMP, Photoshop (paid)
  • 3D modeling - used to work on 3D models. For example: Blender

Modding tools

Mapping tools

Basic Lua language

Other resources

WhiskeyHalf.png
This article may be in need of improvement.
Editors are encouraged to add any missing information to the article, while verifying that the article's current content is correct.

Mapping

Main article: Mapping
Tutorial Author Last updated
The One Stop TileZed Mapping Shop RingoD123 January 30, 2017
How to Combine Map Mods RingoD123 June 11, 2017
Full list of current Room Definitions RingoD123 February 7, 2014
Making new room definitions RingoD123 June 10, 2017
Mapping Tutorial's and Videos Thuztor April 20, 2015
Mapping Tutorial's and Videos (Outdated) Thuztor September 12, 2017
VegMap to Testing Custom Map Cpt_Paradox January 28, 2017
Making rooms with the place wall tool, item spawns, ortho and more! Cpt_Paradox November 30, 2017
Sliding Glass Doors, New Textures, Here's How! Cpt_Paradox November 30, 2017
How to make a map Start to Finish Full Video Tutorial BlackBeard January 30, 2017
All player made Building Archives BlackBeard May 31, 2019
Custom texture packs and tile definitions EasyPickins June 5, 2014
Card's Tutorial for Terrain Generation Cardenaglo February 22, 2017
Video Tutorials mapping Atoxwarrior June 26, 2016

Mapping resources

Localization

If you plan to support other languages in your mod, you should save the text file using the proper encoding format that corresponds to the language you're translating. If you don't, characters will not appear correctly. Language information can be found in media/lua/shared/Translate/%lang%/language.txt files.

Code Language Encoding Category
AR Espanol (AR) - Argentina Spanish Cp1252 Western
CA Catalan ISO-8859-15 Western
CH Traditional Chinese UTF-8
CN Simplified Chinese UTF-8
CS Czech Cp1250 Central European
DA Danish Cp1252 Western
DE Deutsch - German Cp1252 Western
EN English UTF-8
ES Espanol (ES) - Spanish Cp1252 Western
FI Finnish Cp1252 Western
FR Francais - French Cp1252 Western
HU Hungarian Cp1250 Central European
ID Indonesia UTF-8
IT Italiano Cp1252 Western
JP Japanese UTF-8
KO Korean UTF-16
NL Nederlands - Dutch Cp1252 Western
NO Norsk - Norwegian Cp1252 Western
PH Tagalog - Filipino UTF-8
PL Polish Cp1250 Central European
PT Portuguese Cp1252 Western
PTBR Brazilian Portuguese Cp1252 Western
RO Romanian UTF-8
RU Russian Cp1251 Cyrilic
TH Thai UTF-8
TR Turkish Cp1254 Turkish
UA Ukrainian Cp1251 Cyrilic

Notes

A note regarding optimization and timestamps

This numerical information in the console.txt output log is a timestamp, such as in "LOG  : General , 1669904231941" If you need to evaluate the runtime impact of code it is a good metric.

A note regarding updating and/or changing mods

Removing .txt and .lua files from a mod before updating them to the steam workshop may result in file mismatch errors etc. on account of steam not automatically removing said files from clients and/or servers. One solution is manually deleting these files from the installation directories of the server and/or clients. As well modders can avoid this issue by keeping those files, instead of removing them, but editing those files so they are empty instead of having any functional content. Including commented text explaining the reason for this in the files is also a good practice.

A note regarding Mac, Linux and case sensitivity

Note that, unlike Windows, Mac and Linux OS are case-sensitive regarding file and directory names. Although people playing PZ on Linux is uncommon, it's far more common with server hosting services. To avoid issues, make sure and follow the vanilla PZ capitalization conventions for file and directory names.

For example: with clothing mods fileguidtable.xml works for Windows and Mac, but will cause serious issue for Linux as it will be looking for "fileGuidTable.xml", as that is how the vanilla PZ file is capitalized. Although Client, Server, and Shared will work for the lua directories for non-Linux systems. it won't work for Linux; consequently use the vanilla capitalization, "client", "server" and "shared" for those.

External resources

Tutorial Author Last updated
Project Zomboid Modding Guide (WIP) Fenris Wolf January 22, 2023
RoboMat's Tutorials RoboMat July 24, 2013
Java Scripting Guide (very out of date, only the item and recipe sections seems to be applicable to current builds) Lemmy101 July 24, 2013

Javadoc reference to Project Zomboid codebase

Typescript modding

You can now use Typescript language to write your mods which are then compiled into lua. However it is not necessary to use Typescript to write mods.

Important additional modding resources

General additional modding resources

Clothing modding resources

Old and more specific additional modding resources