Modding/zh-hans: Difference between revisions

From PZwiki
< ModdingModding/zh-hans
(Created page with "{{languages}} == '''License Info''' == '''By purchasing Project Zomboid, you are permitted to:''' *Change the base files in any way you like, provided that those changes do no...")
 
m (Automated Formatting for Infobox and Section Headers)
 
(39 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{languages}}
{{DISPLAYTITLE:模组开发}}
{{Header|Modding}}
{{Translate}}
[[File:SpiffosWorkshop.png|link=https://steamcommunity.com/app/108600/workshop/|frame|right|Spiffo的创意工坊是[[Steam]]上《僵尸毁灭工程》模组的首页。]]


== '''License Info''' ==
=='''条款及细则'''==
通过游玩《僵尸毁灭工程》,您同意遵守'''[https://projectzomboid.com/blog/support/terms-conditions/ 条款及细则]'''。


'''By purchasing Project Zomboid, you are permitted to:'''
通过使用《僵尸毁灭工程》模组,您同意遵守'''[https://projectzomboid.com/blog/modding-policy/ 模组政策]'''


*Change the base files in any way you like, provided that those changes do not result in the game being playable without purchasing.
===重要限制===
*Distribute the files in any way as you like, providing the files you distribute are not useable by themselves, or accompanied with freely available downloadable files, to play the game without purchasing.
*The Indie Stone保留在游戏中实现任何功能的权利,无论是否存在达到相同目标的模组。
*Use art, music, video footage or intellectual property of Project Zomboid for creative purposes in any way you like, providing the end result is related in some way to Project Zomboid, states Project Zomboid as its influence and origin, and is for non-commercial use only.
*模组作者对他们的模组负有全部责任,包括(但不限于)遵守任何托管平台(例如Steam创意工坊)的规定。他们还有责任获得模组中第三方材料的第三方许可。从法律上讲,我们必须要求模组作者“声明并保证”(即法律上承诺)他们的模组是他们自己的原创作品,以及任何第三方内容都已经得到了模组作者的完整且合法的许可。
*模组的创建受我们的[https://projectzomboid.com/blog/modding-policy/ 模组政策]约束,该政策可能会不时更新,以适应僵毁模组能够运行的任何技术要求。
*《僵尸毁灭工程》的模组作者可以自由地接受来自玩家的金钱或礼物捐赠,以此来感谢他们所投入的时间和精力。但是,专门为那些选择捐赠(或提供“模组内”额外内容和奖励)创建的模组是不允许的,模组作者不能出售对《僵尸毁灭工程》的修改。


'''You are not permitted to:'''
==安装和使用模组==
*[[Installing mods|安装模组]] - 如何为[[Steam]]或[[GOG]]版本的游戏安装模组。
*[[Using mods|使用模组]] - 如何启用和配置模组。
*[[Mod problems solution|模组问题解决方案]] - 如果模组无法正常运行或使游戏崩溃,该怎么办。
*[[Testing mods in multiplayer|在多人模式中测试模组]] - 关于在服务器上配置模组的指南。
<span style="font-size: 120%; font-weight: bold; color: green;">提示:</span> 加入 [https://discord.gg/theindiestone The Indie Stone Discord 服务器]访问'''#mod_support'''频道, 在那里您可以询问关于使用模组相关的问题。


*Modify the demo in any way beyond cosmetic graphical/sound/musical changes.
要启用一个模组,首先要确保模组安装在正确的目录中。完成后,启动《僵尸毁灭工程》。当您进入主菜单时,在屏幕底部的菜单选项中,您还会看到一个叫“模组”的菜单选项。点击它,就会进入模组菜单。
*Modify the base files to include malicious code.


== Scripting tutorials for 2.9 versions ==
在那里,您应该能看到您已经安装的模组的列表。双击您想要启用的模组,然后模组旁边会出现一个绿色的勾。
*[http://pz-mods.net/guide/event-reference/ Event References]
*[http://www.theindiestone.com/community/viewtopic.php%3ff=34&t=14783.html Making a Rain Collector]
*[http://www.theindiestone.com/community/viewtopic.php%3ff=34&t=13811.html Adding Professions (outdated)]


== Current Mods ==
接下来要做的是关闭《僵尸毁灭工程》并重新启动它。一旦启动,您的模组就应该可以使用了。使用模组的说明通常包含在README文件或者帖子中。
*[http://theindiestone.com/forums/index.php/forum/47-completed-mods/ Completed Mods]
*[http://theindiestone.com/forums/index.php/forum/52-wip-mods/ Work in Progress Mods]
*[http://xeno-mods.com/ Unofficial PZ Mod Repository]
*[http://pz-mods.net/ Another mod repository]


==Modding tools for 2.9 versions==
==当前模组==
No tools have been released yet. As character graphics and map file formats have changed significantly, none of the old tools can be used to mod the current version.
{{Main|Mods}}
*[https://steamcommunity.com/app/108600/workshop/ Spiffo的创意工坊]
*[https://theindiestone.com/forums/index.php?/forum/58-mods/ 已完成的模组]
*[https://theindiestone.com/forums/index.php?/forum/59-wip/ 开发中的模组]


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


;Costume-Ed v1.0 "Released July 28 2011"
<span style="font-size: 120%; font-weight: bold; color: green;">提示:</span> 加入[https://discord.gg/theindiestone The Indie Stone Discord服务器]访问'''#mod_development'''频道, 在那里您可以询问有关创建《僵尸毁灭工程》模组的任何问题。
:Costume Editor
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=3036.html


;Iso-Ed v0.9ish
===相关工具===
:Floor Tile Modding Tool
*'''文本编辑器''' - 用于编辑脚本和编写代码。最好使用支持Lua语法高亮的编辑器,比如[https://notepad-plus-plus.org Notepad++]或者[https://code.visualstudio.com/ VS Code]。
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=6454.html
*'''图像编辑器''' - 用于创建图标、物品和地块纹理。例如[https://www.gimp.org/ GIMP]。
*'''3D建模''' - 用于制作3D模型。例如[https://store.steampowered.com/app/365670/Blender Blender]。
*最新的[https://theindiestone.com/forums/index.php?/topic/59675-latest-tilezed-worlded-and-tilesets-september-8-2022/ TileZed, WorldEd, and tilesets] – TileZed也可以从[https://github.com/timbaker/tiled GitHub上的源代码]下载和编译,或者如果你在Steam上拥有游戏,可以作为[https://steamdb.info/app/380880/ 《僵尸毁灭工程》模组工具]来安装(目前仅支持Windows版本)。


====Mapping Tools====
====模组工具====
*[https://github.com/Konijima/PZ-Libraries 在IDEA IntelliJ中反编译和设置自动完成/智能提示]
*[https://www.guidgenerator.com/ 免费在线GUID生成器: 用于制作模组服装和套装的GUID。]


Please refer to [[Mapping]] for more a more detailed explanation of the processes involved in editing and creating maps in Project Zomboid.
===资源===
*[[Lua]] - 使用 Lua 语言的介绍和指南。
**[[Lua Functions|Lua函数]]
**[[Lua Events|Lua事件]]
**[[Lua Objects|Lua对象]]
*[[Debug mode|调试模式]] - 解释如何在调试(开发者)模式下运行游戏以及如何使用它。
*[[Startup parameters|启动参数]] - 使用启动参数来启动游戏。
*[[Mod structure|模组结构]] - 解释模组是如何工作的,以及如何为它创建模板。
*[[Folders structure|文件夹结构]] - 文件和文件夹的说明,这些文件和文件夹在开发模组时会很有用。
*[[File formats|文件格式]] - 文件格式的文档。
*[[Tile properties|地块属性]] - [[tile|地块]]属性的解释。
*[[Room definitions|房间定义]] - 房间定义的解释,主要用于物资分配。
*[[Vehicle zones|车辆区域]] - 车辆区域的解释。
*[[Procedural distributions]] – list of procedural distributions.
*[[Game time|游戏时间]] - 关于游戏中时间如何工作的解释和GameTime类。
*[[Decompiling game code|反编译游戏代码]] - 指导如何学习游戏的Java源代码。
*[[Adding new tiles|添加新的地块]] - 指导制作新的地块。
*[[Scripts guide|脚本指南]] - 物品、配方和翻译的脚本指南(.txt文件)。
*[[List of Tiledefs in use by mods|模组中使用的TileDefs列表]]


;Mapping Tools
==Mapping==
:Link Also contains 300x300 blank map.
{{Main|Mapping}}
:http://theindiestone.com/community/viewtopic.php%3ff=27&t=7406.html"
{| class="wikitable theme-blue sortable" style="width: 50%;"
 
! style="width: 60%;" | Tutorial
;TileZed Map Editor fantastic version of Tiled "Created by EasyPickins"
! style="width: 20%;" | Author
:Map Editor
! style="width: 20%;" | Last updated
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=7521.html
 
====Modding Tools (PZ 0.1.5)====
 
;PZ Mod Tools 0.1.5d + character pieces
:Slightly updated mod tools
:Comes with some other nifty tools
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=4200.html
 
==Mapping Tutorials==
 
;Badgerflaps - Mapping Tutorial (0.1.5 specific)
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=3961.html
 
;[[New_Tiles|Creating New Tiles for use in PZ 0.2.0 +]]
 
;matsydoodles - Custom Textures (Floors/Walls/Furniture etc) (0.1.5 specific)
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=4608.html
 
==Java Scripting==
Java scripting refers to the modding tools originally used to create item and story mods.
 
;Lemmy101's Modding Guide
:http://www.projectzomboid.com/modtools/ModdingGuide2.rtf
 
;Lemmy101's Java object inheritance and you
:http://theindiestone.com/community/viewtopic.php%3ff=27&t=6593.html
 
; Ontogenesis - My First Story Mod
:http://theindiestone.com/community/viewtopic.php%3ff=34&t=4459.html
 
==Lua Tutorials==
 
'''Basic Lua Language:'''
 
;[[Lua_Intro|An Introduction to Lua]]
;[[Variables_Assignments_Datatypes|Variables, Assignments and Datatypes]]
:::[[Task_One_Solutions|'''Test Yourself Solutions''']]
;[[Arithmetic_Operators|Arithmetic Operators]]
;[[Relational_and_Boolean_Operators|Relational and Boolean Operators]]
;[[Concatenation_and_Length_Operators|Concatentation and Length Operators]]
;[[If_Statements_and_Functions|If Statements and Functions]]
;[[Loops|Loops]]
;[[Local_and_Global_Variables|Local and Global Variables]]
;[[Tables|Tables]]
;[[Looping_Through_Tables|Looping Through Tables]]
 
 
;Javadoc reference to Project Zomboid codebase
:http://theindiestone.com/community/viewtopic.php%3Ff=34&t=5639.html‎
 
;Ontogenesis - My First Lua Mod
:http://xeno-mods.com/post/12/my-first-lua-mod-part-one
:http://xeno-mods.com/post/13/my-first-lua-mod-part-two
:http://xeno-mods.com/post/14/my-first-lua-mod-part-three
 
== Specifics ==
 
=== List of Item Parameters ===
Much of this information was supplied by forum member InnocentSam.<ref> http://theindiestone.com/community/viewtopic.php%3ff=27&t=3654.html </ref>
{| class="wikitable"
!style="background:#dbdbdb;"|Parameter Name
!style="background:#dbdbdb;"|Effect / Description
!style="background:#dbdbdb;"|Example
|-
|-
!colspan=3|General
| [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
|-
|-
|Type
| [https://theindiestone.com/forums/index.php?/topic/22576-how-to-combine-map-mods/&tab=comments#comment-257834 How to Combine Map Mods]
|Item-type, describes how the item behaves. Includes 'Food', 'Weapon', 'Drainable', 'Literature', 'Clothing' and 'Normal'.
| RingoD123
|Food ([[steak]])
| June 11, 2017
|-
|-
|Display Name
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&tab=comments#comment-73574 Full list of current Room Definitions]
|The item's name as it appears displayed to the player.
| RingoD123
|Axe ([[axe]])
| February 7, 2014
|-
|-
|Icon
| [https://theindiestone.com/forums/index.php?/topic/5461-full-list-of-current-room-definitions/&page=3&tab=comments#comment-257787 Making new room definitions]
|The item's icon as it appears displayed to the player. This parameter looks inside "media/texturepacks/ui.txt" and will call any sprite with the prefix "Item_".
| RingoD123
|Molotov ([[molotov cocktail]])
| June 10, 2017
|-
|-
|Weight
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos]
|Item's weight, used for encumbrance.
| Thuztor
|0.1 ([[painkillers]])
| April 20, 2015
|-
|-
|OtherHandRequire
| [https://theindiestone.com/forums/index.php?/topic/14109-thuztors-mapping-tutorial-videos/&tab=comments#comment-176301 Mapping Tutorial's and Videos] <small>(Outdated)</small>
|Requires a specified item to be held by the player in their second quick-slot before the item may be used.
| Thuztor
|Lighter ([[molotov cocktail]])
| September 12, 2017
|-
|-
|CanBarricade
| [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]
|Whether the item may be used like the hammer to barricade doors and windows.
| Cpt_Paradox
|Boolean (false or true)
| January 28, 2017
|-
|-
|Count
| [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!]
|The number of items which may ever be used in the game world.
| Cpt_Paradox
|8 ([[Ripped Sheet]])
| November 30, 2017
|-
|-
|UseWhileEquipped
| [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!]
|Whether the item is used over time while it is equipped.
| Cpt_Paradox
|Boolean (false or true)
| November 30, 2017
|-
|-
|UseDelta
| [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]
|Numerical value associated with how quickly the item drains.
| BlackBeard
|0.0009 ([[torch]])
| January 30, 2017
|-
|-
|ReplaceOnUse
| [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]
|Name of the item which replaces the current item after use.
| BlackBeard
|Pot ([[pot of soup]])
| May 31, 2019
|-
|-
!colspan=3|Consumables
| [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
|-
|-
|IsCookable
| [https://theindiestone.com/forums/index.php?/topic/22127-cards-tutorial-for-terrain-generation/&tab=comments#comment-252998 Card's Tutorial for Terrain Generation]
|Whether the item can be cooked.
| Cardenaglo
|Boolean (false or true)
| February 22, 2017
|-
|-
|MinutesToCook
| [https://theindiestone.com/forums/index.php?/topic/18084-video-tutorials-mapping-atox-warrior/&tab=comments#comment-221862 Video Tutorials mapping]
|How many in-game minutes the item must be in an oven for it to cook.
| Atoxwarrior
|50 ([[pot of soup]])
| June 26, 2016
|}
 
====Mapping resources====
*[https://www.pztiles.com/home PZ Tiles and a comprehensive selection of other mapping and tile making resources.]
*[https://drive.google.com/drive/folders/12jQxlDlyC-fACV45oCWshZb60QHoQ6kf The build 41 base and vegetation maps for PZ.]
*[https://theindiestone.com/forums/index.php?/topic/25742-project-zomboid-basemap/ The build 40 base and vegetation maps for PZ.]
*[https://drive.google.com/file/d/1zvjxsjLi2KGwU7SVbLoH2m32UuSgCxcw/view?usp=sharing An app for replacing the zombie layers on cells.]
*[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.]
 
==本地化==
如果您打算在模组中支持其他语言,则应使用与您正在翻译的语言相对应的正确编码格式保存文本文件。否则,字符将无法正确显示。语言信息可以在<code>media/lua/shared/Translate/%lang%/language.txt</code>文件中找到。
{| class="wikitable theme-blue sortable"
|- style="font-weight: bold;"
! 代码
! 语言
! 编码
! 分类
|-
|-
|MinutesToBurn
| AR
|Length of time the item must be in an oven for it to be burnt. Usually double the value of 'MinutesToCook'.
| 阿根廷西班牙语
|150 ([[steak]])
| Cp1252
| Western
|-
|-
|HungerChange
| CA
|Value applied to player's current hunger points. Positive increases hunger.
| 加泰隆语
|<nowiki>-</nowiki>20 ([[crisps]])
| ISO-8859-15
| Western
|-
|-
|DaysFresh
| CH
|How many days it takes for a food item to begin rotting.
| 繁体中文
|2 ([[steak]])
| UTF-8
|
|-
|-
|DaysTotallyRotten
| CN
|How many days it takes for a food item to become entirely rotten.
| 简体中文
|7 ([[carrots]])
| UTF-8
|
|-
|-
|DangerousUncooked
| CS
|Whether the food item will negatively affect the player in an uncooked state.
| 捷克语
|Boolean (false or true)
| Cp1250
|Central European
|-
|-
|RequireInHandOrInventory
| DA
|Requires a specified item to be inside the player's inventory before the item may be used.
| 丹麦语
|CanOpener ([[canned soup]])
| Cp1252
| Western
|-
|-
|Alcoholic
| DE
|Whether the item effects the player in a similar way to [[Whiskey]].
| 德语
|Boolean (false or true)
| Cp1252
| Western
|-
|-
|UseSelf
| EN
|Whether the item is consumed after use.
| 英语
|Boolean (false or true)
| UTF-8
|
|-
|-
!colspan=3|Weapons
| ES
| 西班牙语
| Cp1252
| Western
|-
|-
|MinAngle
| FI
|The angle that the weapon attacks, a value aprox. to 1 is going to need more accuracy with mouse than one nearer to -1.
| 芬兰语
|0.88 ([[shotgun]])
| Cp1252
| Western
|-
|-
|MinDamage
| FR
|Minimum damage the weapon will inflict.
| 法语
|0.7 ([[baseball bat]])
| Cp1252
| Western
|-
|-
|MaxDamage
| HU
|Maximum damage the weapon may ever inflict.
| 匈牙利语
|1.0 ([[baseball bat]])
| Cp1250
| Central European
|-
|-
|MaxRange
| ID
|Maximum range the weapon is effective.
| 印度尼西亚语
|1.5 ([[spiked baseball bat]])
| UTF-8
|
|-
|-
|MaxHitCount
| IT
|Maximum amount of enemies the weapon will hit at one time.
| 意大利语
|1 ([[hammer]])
| Cp1252
| Western
|-
|-
|PhysicsObject
| JP
|Physics object used as a projectile.
| 日语
|MolotovCocktail ([[molotov cocktail]])
| UTF-8
|
|-
|-
|SwingAnim
| KO
|Name of animation which is ran when the weapon is fired/swung.
| 韩语
|Bat ([[baseball bat]])
| UTF-16
|
|-
|-
|WeaponSprite
| NL
|Name of sprite, the image used to display the weapon.
| 荷兰语
|axe ([[axe]])
| Cp1252
| Western
|-
|-
|DoorDamage
| NO
|Damage inflicted by the item on doors.
| 挪威语
|10 ([[spiked baseball bat]])
| Cp1252
| Western
|-
|-
|MinimumSwingTime
| PH
|The time that takes between each swing.
| 菲律宾语
|15 ([[baseball bat]])
| UTF-8
|
|-
|-
|SwingAmountBeforeImpact
| PL
|Requires more research.
| 波兰语
|0.2 ([[spiked baseball bat]])
| Cp1250
| Central European
|-
|-
|PushBackMod
| PT
|Distance that enemies are pushed back.
| 葡萄牙语
|4.5 ([[Wooden Plank|wood planks]])
| Cp1252
| Western
|-
|-
|KnockBackOnNoDeath
| PTBR
|Whether enemies are pushed back if they are not killed.
| 巴西葡萄牙语
|Boolean (false or true)
| Cp1252
| Western
|-
|-
|SplatNumber
| RO
|Blood effects used when an enemy is injured by the weapon.
| 罗马尼亚语
|5 ([[shotgun]])
| UTF-8
|
|-
|-
|SplatBloodOnNoDeath
| RU
|Whether an enemy injured by the weapon will bleed if they are not killed
| 俄语
|Boolean (false or true)
| Cp1251
| Cyrilic
|-
|-
|ImpactSound
| TH
|Name of sound used on impact.
| 泰语
|splat1 ([[axe]])
| UTF-8
|
|-
|-
|SwingSound
| TR
|Name of sound used when firing/swinging weapon.
| 土耳其语
|shotgun ([[shotgun]])
| Cp1254
| Turkish
|-
|-
|SoundVolume
| UA
|Defines the volume of a chosen sound.
| 乌克兰语
|40 ([[shotgun]])
| Cp1251
|-
| Cyrilic
|SoundRadius
|}
|Radius in which the sound may be heard in the game world from it's point of origin.
 
|50 ([[shotgun]])
==Notes==
|-
===A note regarding optimization and timestamps===
|ToHitModifier
This numerical information in the console.txt output log is a timestamp, such as in "LOG  : General    , 1669904231941"
|Requires more research.
If you need to evaluate the runtime impact of code it is a good metric.
|1.5 ([[shotgun]])
 
|-
===A note regarding updating and/or changing mods===
|NPCSoundBoost
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.
|Amount that a sound is boosted when the weapon is fired by an NPC (Not player).
One solution is manually deleting these files from the installation directories of the server and/or clients.
|1.5 ([[shotgun]])
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.
|-
 
|RangeFalloff
===A note regarding Mac, Linux and case sensitivity===
|Requires more research.
Note that, unlike Windows, Mac and Linux OS are case-sensitive regarding file and directory names.
|Boolean (false or true)
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.
|UseEndurance
 
|Whether the weapon causes exhaustion.
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.
|Boolean (false or true)
 
|-
==See also==
|ShareDamage
*[[Mods]]
|Requires more research.
*[[Talk:Modding]] – for some raw guides to extracting images. The text needs to be cleaned up.
|Boolean (false or true)
 
|-
==External resources==
|AmmoType
{| class="wikitable theme-blue sortable" style="width: 50%;"
|Item required to fire the weapon.
! style="width: 60%;" | Tutorial
|ShotgunShells ([[shotgun]])
! style="width: 20%;" | Author
|-
! style="width: 20%;" | Last updated
!colspan=3|Clothing
|-
|Palettes
|Defines the clothing item's colors.
|Trousers_Blue/Trousers_Brown/Trousers_Grey/Trousers_White ([[trousers]])
|-
|-
|PalettesStart
| [https://github.com/FWolfe/Zomboid-Modding-Guide Project Zomboid Modding Guide] (WIP)
|Defines the clothing item's palette prefix.
| Fenris Wolf
|Shirt_ ([[sweater]])
| January 22, 2023
|-
|-
|BodyLocation
| [https://theindiestone.com/forums/index.php?/topic/61-robomats-modding-tutorials-updated-12112013/ RoboMat's Tutorials]
|Where the clothing item is worn.
| RoboMat
|Bottoms ([[trousers]])
| July 24, 2013
|-
|-
|SpriteName
| [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)]
|Defines the sprite displayed on the player.
| Lemmy101
|Shoes1 ([[shoes]])
| July 24, 2013
|-
!colspan=3|Literature
|-
|StressChange
|Value applied to player's current stress points. Positive makes the player become more stressed.
|<nowiki>-</nowiki>10 ([[newspaper]])
|-
|BoredomChange
|Value applied to player's current boredom points. Positive increases player's boredom.
|<nowiki>-</nowiki>50 ([[book]])
|}
|}


==References==
===Javadoc reference to Project Zomboid codebase===
*[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)]
 
===TypeScript模组===
您现在可以使用TypeScript语言来编写您的模组,然后编译成Lua。但是,使用TypeScript来编写模组并不是必须的。
*[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]
 
===Important additional modding 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://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.]
 
===General additional modding resources===
*[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://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.]
*[https://github.com/demiurgeQuantified/PZModdingGuides/blob/main/guides/GameTime.md GameTime and deltas: An explanation of time deltas and their applications in modding.]
*[https://github.com/demiurgeQuantified/PZModdingGuides/blob/main/guides/ScriptFunctions.md Documentation on functions linked to item/recipe/vehicle scripts.]
 
===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.]


<references/>
===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)]


[[Category:Modding]]
{{Template:Navbox modding}}

Latest revision as of 08:20, 7 March 2024

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