自定义翻修
这是一个框架,允许模组作者通过单个 Content Patcher 模组,为农舍以外的任意游戏地点制作翻修内容。翻修项目会加入罗宾商店的翻修菜单。
以下是使用 debug renovate 的测试:
[youtube]IUVDVqm2XXo[/youtube]
上面演示的翻修模组可作为模板下载:模板下载。
制作翻修内容
一个 CP 翻修模组至少需要 content.json 文件,以及包含翻修图块的地图文件。
以下是 content.json 示例:
{
"Format": "1.23.0",
"Changes": [
{
"Action": "EditData",
"Target": "Strings/Locations",
"Entries": {
"Greenhouse_Renovation_Plots": "Greenhouse Tree Plots/Gives the greenhouse some tree plots./Select an area for the renovation.",
"Greenhouse_Renovation_Plots_Remove": "Remove Greenhouse Plots/Remove extra tree plots from the greenhouse./Select an area for the renovation."
}
},
{
"Action": "Load",
"Target": "Maps/Greenhouse_Renovation",
"FromFile": "assets/Greenhouse_Renovation.tmx"
},
{
"Action": "EditData",
"Target": "CustomRenovations",
"Entries": {
"greenhouse_renovation": {
"gameLocation": "Greenhouse",
"mapPath": "Greenhouse_Renovation"
}
}
},
{
"Action": "EditData",
"Target": "Data/HomeRenovations",
"Entries": {
"greenhouse_renovation": {
"TextStrings": "Strings\\Locations:Greenhouse_Renovation_Plots",
"AnimationType": "destroy",
"CheckForObstructions": true,
"Requirements": [
{
"Type": "Mod",
"Key": "GameLocation",
"Value": "Greenhouse"
},
{
"Type": "Mail",
"Key": "greenhouse_renovation",
"Value": "0"
}
],
"RenovateActions": [
{
"Type": "Mail",
"Key": "greenhouse_renovation",
"Value": "1"
}
],
"RectGroups": [
{
"Rects": [
{ "X": 4, "Y": 7, "Width": 12, "Height": 3 },
{ "X": 4, "Y": 20, "Width": 12, "Height": 3 },
{ "X": 1, "Y": 9, "Width": 3, "Height": 12 },
{ "X": 16, "Y": 9, "Width": 3, "Height": 12 }
]
}
],
"SpecialRect": null
},
"greenhouse_unrenovation": {
"TextStrings": "Strings\\Locations:Greenhouse_Renovation_Plots_Remove",
"AnimationType": "destroy",
"CheckForObstructions": true,
"Requirements": [
{
"Type": "Mod",
"Key": "GameLocation",
"Value": "Greenhouse"
},
{
"Type": "Mail",
"Key": "greenhouse_renovation",
"Value": "1"
}
],
"RenovateActions": [
{
"Type": "Mail",
"Key": "greenhouse_renovation",
"Value": "0"
}
],
"RectGroups": [
{
"Rects": [
{ "X": 4, "Y": 7, "Width": 12, "Height": 3 },
{ "X": 4, "Y": 20, "Width": 12, "Height": 3 },
{ "X": 1, "Y": 9, "Width": 3, "Height": 12 },
{ "X": 16, "Y": 9, "Width": 3, "Height": 12 }
]
}
],
"SpecialRect": null
}
}
}
]
}
上例添加了两个翻修项目:一个在温室周围增加树木种植区,另一个移除这些区域。
Strings/Locations 条目用于添加界面文本;其键名应与 Data/HomeRenovations 条目的 TextStrings 值相符。
CustomRenovations 是所有 CP 翻修内容包用来向本模组登记翻修项目的路径。mapPath 是 Maps 文件夹下地图的名称(通常由上例所示的 Load 条目提供)。gameLocation 是要应用翻修的游戏地点名称,区分大小写。此对象也可以提供 sourceRect 和 destRect 矩形,但作者不确定它们是否有实际作用。
Data/HomeRenovations 条目遵循该数据文件的语法,但可以像上例一样添加一个原版游戏会忽略的新需求。类型应为 Mod,键应为 GameLocation,值则是要应用翻修的游戏地点名称(区分大小写)。
技术信息
需要 SMAPI 和 Content Patcher,并使用 Harmony。
兼容 Mod Updater,支持自动更新。
源代码:GitHub。
如需反馈、寻求帮助或协助测试作者的模组,可访问作者的 Discord 服务器。
来源与文件
- 原作者:aedenthorn
- 原项目:Custom Renovations
- 文件:Renovations(ID:45373)
来源列出的依赖与关系
- 作者列出的前置:SMAPI - Stardew Modding API
- 作者列出的前置:Content Patcher
前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:stardewvalley:9687 -->
