模组开发

From PZwiki
< ModdingModding/zh-hans
模组开发模组开发
Translation icon.png
此页面/章节需要翻译。
我们鼓励编者尽其所能翻译此页面。
Spiffo的创意工坊是Steam上《僵尸毁灭工程》模组的首页。

条款及细则

通过游玩《僵尸毁灭工程》,您同意遵守条款及细则

通过使用《僵尸毁灭工程》模组,您同意遵守模组政策

重要限制

  • The Indie Stone保留在游戏中实现任何功能的权利,无论是否存在达到相同目标的模组。
  • 模组作者对他们的模组负有全部责任,包括(但不限于)遵守任何托管平台(例如Steam创意工坊)的规定。他们还有责任获得模组中第三方材料的第三方许可。从法律上讲,我们必须要求模组作者“声明并保证”(即法律上承诺)他们的模组是他们自己的原创作品,以及任何第三方内容都已经得到了模组作者的完整且合法的许可。
  • 模组的创建受我们的模组政策约束,该政策可能会不时更新,以适应僵毁模组能够运行的任何技术要求。
  • 《僵尸毁灭工程》的模组作者可以自由地接受来自玩家的金钱或礼物捐赠,以此来感谢他们所投入的时间和精力。但是,专门为那些选择捐赠(或提供“模组内”额外内容和奖励)创建的模组是不允许的,模组作者不能出售对《僵尸毁灭工程》的修改。

安装和使用模组

提示: 加入 The Indie Stone Discord 服务器访问#mod_support频道, 在那里您可以询问关于使用模组相关的问题。

要启用一个模组,首先要确保模组安装在正确的目录中。完成后,启动《僵尸毁灭工程》。当您进入主菜单时,在屏幕底部的菜单选项中,您还会看到一个叫“模组”的菜单选项。点击它,就会进入模组菜单。

在那里,您应该能看到您已经安装的模组的列表。双击您想要启用的模组,然后模组旁边会出现一个绿色的勾。

接下来要做的是关闭《僵尸毁灭工程》并重新启动它。一旦启动,您的模组就应该可以使用了。使用模组的说明通常包含在README文件或者帖子中。

当前模组

主要文章: Mods/zh-hans

创建模组

在为僵毁制作模组时,有几个主要的方向:

  • 修改脚本 - 游戏中的脚本描述了物品、配方和车辆的参数。制作一个修改物品、车辆、配方的数值或添加新物品的模组并不是一件困难的任务。这不需要编程知识,任何文本编辑器都可以使用。脚本是.txt文件,有特定的结构。
  • 编写Lua代码 - 僵毁模组的主要方向。大多数模组都包含Lua代码。僵毁主要用Java和Lua开发,所以模组中使用Lua代码与探索Java和Lua游戏代码密切相关。当创建更复杂的模组时,您将不得不深入到游戏的反编译Java代码中。我们将介绍Lua语言的基础知识,但您应该熟悉编程的基础知识。对Java语言的语法有一般的了解也是可取的,因为可能需要探索游戏代码来弄清楚一些函数的工作原理。
  • 创建3D模型 - 目前,借助模组,您可以向游戏中添加新的车辆、武器、普通物品和衣服的模型。游戏使用两种模型格式:.X和.FBX。对于我们来说,创建带有模型的模组,.FBX格式就足够了。
  • 创建动画 - 为角色创建动画。包括创建动画文件和将其集成到游戏中。
  • 创建纹理、图片和图标 - 这个方向是对其他方向的补充。模型需要纹理,物品需要图标,界面需要一些图片,地图需要新的地块纹理(要放置在地图上的新对象)。
  • 地图创建 - 为游戏创建位置、建筑和一般环境。参见#Mapping
  • 翻译 - 将游戏翻译成多种语言,参加#本地化

提示: 加入The Indie Stone Discord服务器访问#mod_development频道, 在那里您可以询问有关创建《僵尸毁灭工程》模组的任何问题。

相关工具

模组工具

资源

Mapping

主要文章: Mapping/zh-hans
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

本地化

如果您打算在模组中支持其他语言,则应使用与您正在翻译的语言相对应的正确编码格式保存文本文件。否则,字符将无法正确显示。语言信息可以在media/lua/shared/Translate/%lang%/language.txt文件中找到。

代码 语言 编码 分类
AR 阿根廷西班牙语 Cp1252 Western
CA 加泰隆语 ISO-8859-15 Western
CH 繁体中文 UTF-8
CN 简体中文 UTF-8
CS 捷克语 Cp1250 Central European
DA 丹麦语 Cp1252 Western
DE 德语 Cp1252 Western
EN 英语 UTF-8
ES 西班牙语 Cp1252 Western
FI 芬兰语 Cp1252 Western
FR 法语 Cp1252 Western
HU 匈牙利语 Cp1250 Central European
ID 印度尼西亚语 UTF-8
IT 意大利语 Cp1252 Western
JP 日语 UTF-8
KO 韩语 UTF-16
NL 荷兰语 Cp1252 Western
NO 挪威语 Cp1252 Western
PH 菲律宾语 UTF-8
PL 波兰语 Cp1250 Central European
PT 葡萄牙语 Cp1252 Western
PTBR 巴西葡萄牙语 Cp1252 Western
RO 罗马尼亚语 UTF-8
RU 俄语 Cp1251 Cyrilic
TH 泰语 UTF-8
TR 土耳其语 Cp1254 Turkish
UA 乌克兰语 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.

See also

  • Mods
  • Talk:Modding – for some raw guides to extracting images. The text needs to be cleaned up.

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模组

您现在可以使用TypeScript语言来编写您的模组,然后编译成Lua。但是,使用TypeScript来编写模组并不是必须的。

Important additional modding resources

General additional modding resources

Clothing modding resources

Old and more specific additional modding resources