十字军之王3开发日志#87 | 1/25 皇家模组

牧游社 牧有汉化翻译
CK3 Dev Diary #87: Royal Modding
blackninja9939, Experienced Programmer
Hello everyone and welcome to the 87th CK3 Dev Diary!
大家好,欢迎来到第87期CK3开发日志!
I'm Matthew, one of the Programmers on the CK3 team, and today I am going to talk to you about a variety of improvements and changes we've done to modding for the 1.5 patch which will be accompanying the Royal Court Expansion.
我是Matthew,是CK3团队的程序员之一,今天我要跟大家讲讲我们在1.5版本号补丁中与皇家宫廷同步的各种模组方面的改进和变化。
We've added a variety of mod support in 1.5 so I’m not gonna cover everything, but I will give a few big ticket items that will let mods do a lot more fun custom things as well a few smaller fun ones. I've also attached the output of script_docs on 1.5 at the end so modders curious about the new triggers and effects in game can get a bit of a sneak peek for the release.
我们在1.5版本号中加入了大量Mod支持,所以我没法涵盖全部内容,但我会介绍一些能让Mod自定义更多有趣内容的大改动,还有一些有趣的小改动。我还在最后附上了1.5版本号的script_docs输出文件,让那些对游戏新机制效果感到好奇的Modder们先睹为快。

The Royal Court
皇家宫廷
Of course the Royal Court itself is open to mods, it is all defined in the gfx/court_scene folder though the majority of the complex scene_settings itself is best built using the in-game editor that we are shipping with the court scene. It lets you position and change objects and switch between different settings much faster than trying to edit them all by hand.
当然,皇家宫廷本身也对MOD开放,均定义于gfx/court_scene文件夹中,不过大多数复杂场景设置最好用和宫廷场景一起发布的游戏内编辑器来构建。它可以允许定位编辑对象并切换不同设置,这比手动编辑要快得多。
Trust me, cause I remember the time whilst the editor was work in progress and doing changes by hand crushed my soul.
相信我,因为我记得当初做编辑工作的时候,手动修改快搞死我了。

I am not going to go into a huge amount of detail on the royal court modding because it is actually pretty straightforward with the editor, you position things and pick the assets you need for a configuration and then it just puts things there.
我不会详细介绍皇家宫廷的修改,因为它是很直观的编辑器,你只要定位物品、挑选所需配置,它就能把东西放好。
One aspect I will go into a bit more info on quickly is the character positioning, because the rest of the positioning is set within the editor but the characters are not positioned individually because of course not every court has the King of England to reference.
还有个方面我得尽快介绍,那就是人物位置,因为其他位置都可以在编辑器内设置,但人物不能单独定位,因为不是每个宫廷都能索引到一个英格兰国王。
Instead the character positions are given a set of valid roles, and you pick a position where someone who has one of those roles may go. For example the two guards you see in the back are two positioned instances of the guard and knight role, which has a variety of rules of who it should pick.
相反,人物位置被设定对一系列角色可用,你可以选择一个具有角色身份的人物放到这个位置上。比如说你看到后面有两个卫兵,这两个位置是对守卫和骑士角色可用的,这两个角色由各种规则来选择。
If you have a bodyguard or champion court position appointed for example then it tries to use them as a special guard, but if you do not then it will fallback to picking any of your knights instead. You can also have some more special roles such as if you have a court jester or poet appointed then they can show up in your court too.
如果你任命了一个保镖或者冠军的宫廷职务,那么就会使用他们作为特殊卫兵。如果你没任命,那就会退而求其次,选择其他任意骑士。你也可以弄一些更加特殊的角色,比如任命宫廷小丑或者诗人,他们也会出现在宫廷中。

Characters can not show up in multiple different roles and it is a "greedy" picking of first come first served in who is taken up, but you can write some fairly complex rules to decide who can go where as well as what animations they can choose from!
人物不能出现在多个不同位置,位置会“贪婪”地依次挑选人选,但你可以编写一些复杂规则来决定谁能去哪,以及他们可以选择什么样的动画。

Same-Sex Marriage
同性婚姻
Coming with 1.5 is support for same-Sex marriage, not only just in mods either but as a new game rule alongside the Same-Sex relations game rule so you can use it in un-modded games too. We've updated a variety of AI logic and interactions and content to take that into account when playing.
1.5版本号会支持同性婚姻,不是仅在Mod中支持,而是有了全新的同性关系游戏规则,所以你也可以在无Mod的原版游戏中使用它。为了将其加入游戏,我们已更新各种AI逻辑、互动和内容。

Mods are of course able to implement this into their different worlds without it having to be a game rule, it can be based on different cultures or anything in the game world at all.
Mod当然不需要游戏规则也能在自己的世界里实现这一点,它可以基于不同的文化或者游戏中任意什么东西。
This is something that we're very happy to be able to put into the game and have support in the game rules for unmodded games too, it is something that a lot of the team and community wanted and we are glad it is finally going to be shipped in 1.5.
我们很高兴能将其放入游戏,而且通过游戏规则来在原版中支持同性婚姻,这是很多团队和社区想要的东西,我们很高兴能在1.5版本将它放出来。

Scripted Widgets
脚本化小浮窗
CK3 is one of our most moddable games yet, not just in terms of the content that can be added but the system's mods can script. And our new UI system is the most open we’ve had in terms of what custom UIs mods can add and edit, but one issue it had was letting you add brand new things entirely and keeping compatibility nicely.
CK3是我们目前Mod支持性最好的游戏之一,不仅是在可添加内容方面,还可以通过脚本编写系统Mod。我们的新UI系统在添加编辑自定义UI类的MOD方面最为开放,但它有个问题就是怎么添加全新的东西还能保持良好兼容。
In 1.5 there is a new system called "scripted widgets", what they allow for in essence is a mod to define their own brand new windows in the gui files and then add an entry into the gui/scripted_widgets folder with the name of their gui file and the main window.
1.5版本号有个新系统名为“脚本小浮窗”,可以让Mod在gui文件中自定义全新窗口,然后在gui/scripted_widgets文件夹中添加条目,包括其gui文件和主窗口名称。
For example:
例如:
gui/test_custom_widget.gui = my_first_cool_test_widget
gui/test_custom_widget.gui = my_second_cool_test_widget
Then with that simple line of script their window will appear in the game in the same way any of the windows we support in code do. Now of course there are some limitations, the windows do not have any special data context like a code one does but it can access anything that is set globally or on the local player character which covers more than enough cases normally.
然后通过这行简单的脚本,窗口就能以我们代码中支持的任何方式出现在游戏中。当然现在还有些限制,这些窗口不像代码中那样有什么特殊数据内容,但它可以访问任何全局或本地玩家人物可以访问的内容,这就足以应对许多情况了。

This may not sound hugely impactful, but it means that mods going forward can easily create large systems which can then more easily be compatible with other mods that add systems or if they feel brave enough even with larger Total Conversions if they do not cross over in incompatible design choices.
这听起来好像没多大影响,但它意味着将来的Mod更容易创建大型系统,也更容易跟其他新增系统的Mod兼容。如果胆子够大,只要没有不兼容的设计冲突,甚至能实现更大的全面改动。
I am really excited to see the new UIs that mods end up making for their gameplay systems and getting to try a few different mods together. Hopefully their windows have a bit more functionality and effort put into it than my testing one…
我很兴奋地看到有的Mod为他们的游戏系统设计新的UI并且准备尝试运行一些不同的Mod。希望他们的窗口能比我现在的测试窗口有更多的功能和成果……

Value Breakdowns
数值分解
Another bit of UI functionality that mods could not nicely mimic is getting breakdowns of their numbers in the same way we break down a value like your prestige income or how much piety it's gonna cost to start that war in their own UI.
Mod还不能很好地模拟的其他一些UI功能就是分解数值。像我们官方一样分解声望收入来源或者发动战争的虔诚花费来源数值在他们自己的UI中很难实现。
In 1.5 we've added the GetScriptValueBreakdown UI function which lets you specify the name of the script_value you want to break down and the scope context to do it on and it gives you the exact same data as if we'd natively done it from code.
在1.5版本号中,我们添加了GetScriptValueBreakdown UI函数,该函数允许你指定要分解的脚本值script_value的名称和作用域上下文,它给你的数值和从代码生成的是完全一样的。
For example in my custom widget I've made the button tooltip give a breakdown of the cost if I were to increase my crown authority entirely separate from the usually needed button to evaluate that cost in the realms UI.
打个比方,在我的自定义浮窗中,我已经让按钮的提示框给出我想提高王权所需花费的数值分解,这和通常应用的领地UI的按钮是完全独立的。

We hope this will let mods better explain their own custom values in a more clear way, be that something like your mana in a fantasy mod or custom score for a special event chain.
我们希望这能让Mod都可以更清晰地阐释他们的自定义数值。比如那些奇幻Mod里的法力值或者特殊事件链里的自定义得分。

Events and Localization
事件和本地化
To make life easier for our modders and designers to work with events we’ve added and reworked a few debug buttons in the event window.
为了让我们的Mod制作者和设计者更容易处理游戏内的事件内容,我们在事件窗口中添加并修改了一些调试按钮。
Now every event has these five icons in the top right corner.
现在每个事件都有这五个图标在右上角。

In order they let you:
他们依顺序可以让你:
Regenerate the event contents, useful if you've changed something that cannot hot reload.
重新生成事件内容。如果您修改了无法重新热加载的内容,这将非常有用。
Toggle the data system globally, this makes most everything in square brackets show exactly what you typed instead of localizing to some output, this is available via the console commands too
全局切换数据系统。这使得方括号中的绝大部分内容都显示您键入的内容而不是本地化内容,这也可以通过控制台命令来实现。
Copy the event text to your clipboard
复制事件文本至剪切板。
Shows you the trigger evaluation that had to be true for you to get this event
显示触发器的评估。该评估必须为真才能得到事件。
Debug info about the current scope context and how keys used to build the description
显示调试信息,关于当前作用域内容和键值如何构建起事件的描述。
We've found that having easy access to these makes it a lot simpler to debug events and iterate on content.
我们发现,轻松访问这些内容使得调试事件和迭代内容变得简单得多。
Though do be warned that toggling off the data system can give you some truly cursed looking windows since now instead of seeing the number 4 you see the joyous underlying constructs such as this monstrosity of a window:
但是请注意,切换数据系统会给你一些看起来像真被诅咒了一样的窗口,因为现在你看到的不是数字4,而是欢脱的底层结构,比如这个怪诞的窗口:

In a more mechanical improvement we've also added a boilerplate reduction for having events on a cooldown, instead of needing to manually check and juggle flags and variables yourself you can now specify a cooldown on the event in days/weeks/months/years as some value and it will automatically handle applying a flag that will clear after that time blocking the event from being fired on a character.
在一个与机制更相关的改进中,我们做了一个模板的缩减优化。对于一个有冷却时间的事件,你不再需要自己动手检查和处理标志与变量,你现在可以指定一个以日/周/月/年为单位的冷却时间,在该时间它将自动移除一个应用在人物上用以阻止事件触发的标志。

Console Commands
控制台命令
We have added a variety of new console commands in 1.5 to help make creating and testing mods a bit easier, and instead of explaining them myself I am just gonna cheat and rip their change log entries out!
我们在1.5版本号中增加了各种新的控制台命令,这都让创建和测试Mod变得更加容易。但我想偷个懒,就直接把改动日志的条目贴下来吧!
- Added console command "bypass_requirements" (alias "bypass") that lets you do decisions, interactions, schemes, laws, and title creation despite the requirements not being met
- 添加了控制台命令“bypass_requirements”(别名“bypass”),允许您在不满足条件的情况下进行决议、互动、计谋、法律和创建头衔
- Added console command "instasiege"
- 添加了控制台命令“instasiege”
- Added console command "save_every" and startup parameter "-save_every=x". These will make a save every x years, and ensure they do not get overwritten by normal autosaves
- 增加了控制台命令“save_every”和启动参数“-save_every=x”。这些将每x年保存一次,并确保它们不会被正常的自动保存所覆盖
- Added console command AI.try_send_decision
- 增加了控制台命令AI.try_send_decision
- Added console command AI.try_send_interaction
- 增加了控制台命令AI.try_send_interaction
- Added console command Ironman.ToggleIgnore. When ignored, saves will act as if they're not ironman, including that when you hit save it'll result in a non-ironman save. This can be toggled during gameplay
- 增加了控制台命令Ironman.ToggleIgnore。当忽略铁人模式时,存档都将像非铁人模式一样,你点击保存将生成一个非铁人存档。这可以在游戏过程中进行切换。
- Added console command ToggleShowAllKillers
- 增加了控制台命令ToggleShowAllKillers
- Added console command complete_schemes, guaranteed_scheme_success/failure, and guaranteed_scheme_secrecy_success/failure. The success/secrecy ones only affect the player
- 添加了控制台命令complete_schemes、guaranteed _ scheme _ success/failure和guaranteed _ scheme _ secretary _ success/failure。只会影响玩家。
- Added console command set_date
- 添加了控制台命令set_date
- Added console command show_regions_in_tooltip
- 添加了控制台命令show_regions_in_tooltip
- Added console command toggle_keys_on_map
- 增加了控制台命令toggle_keys_on_map
- Added console commands "yesmen_instant" (AKA "ymi") and "instant_responses". The yesmen button in the console can now be right-clicked to run "yesmen_instant"
- 增加了控制台命令“yesmen_instant”(又名“ymi”)和“instant _ responses”。现在可以右键单击控制台中的yesmen按钮来运行“yesmen_instant”
The bypass and save_every commands have been especially helpful in setting up scenarios to test scripts and make sure it works exactly as you had intended in your mods. As are the forcing the AI to try out an interaction instead of waiting for them to do it of their own free will.
bypass和save_every命令在设置测试脚本的场景时特别有用,并确保它完全按照你在Mod中的预期工作。迫使人工智能去尝试一种交互,而不是等待他们自己的自由意志去做。

Modifiers Everywhere
随处可见的修正项
In 1.5 we've made some improvements to modifiers so if you use an invalid modifier type somewhere it will error and let you know its not going to work.
在1.5版本号中,我们对修正项做了一些改进。现在如果你在某个地方使用了无效的修正项类型会报错。
Which has been very useful as in 1.5 we've greatly expanded upon modifier support in buildings, now buildings can not only apply modifiers to you in general but they can also apply specific modifiers based on culture parameters which are applied by traditions. These can be used in the modifiers affecting the character, province, county and duchy_capital_county modifiers.
这是非常有用的,因为在1.5版本号中,我们已经大大扩展了建筑对修正项的支持。现在建筑不仅可以提供一般的修正项,还能基于由文化传统决定的文化参数提供特定的修正项。这些都可以作用在影响人物、省份、伯爵领和公爵领的修正项上。
In addition there is a province_terrain_modifier which can apply a modifier based optionally on: terrain type, being coastal, being by a river, and by culture parameter. So traditions can really matter in your mods and let cultures play in vastly different ways.
此外,还有一个省份地形修正项,它可以根据地形类型、是否沿海、是否沿河和文化参数来应用修正。所以文化传统在你的Mod中真的很重要,让文化以完全不同的方式发挥作用吧。


Clock's a ticking
时间在流逝
Release day is coming soon and we're very excited to see what mods are going to do with Royal Court, especially with the court scene itself which we hope in the future to see some fantastic 3D scenes especially from fantasy mods.
发布日即将来临,我们非常期待皇家宫廷Royal Court能和Mod擦出怎样的火花。特别是宫廷场景,我们尤其期待能在未来看到奇幻Mod里瑰丽的3D场景。
I'm gonna get back to the last minute release period scramble, thank you for reading and I hope you're looking forward to Royal Court's release and the great mods we're gonna be able to see in the future too!
我将继续在发布日期前赶工到最后一刻,感谢你的阅读,我也非常期待皇家宫廷Royal Court的发布和未来将看到的优秀Mod。
翻译:居里先生 索
校对:三等文官猹中堂
欢迎关注UP主和主播小牧Phenix!
欢迎关注牧游社微信公众号和知乎专栏!微信公众号改版为信息流,欢迎【置顶订阅】不迷路,即时获得推送消息!
B站在关注分组中设置为【特别关注】,将会在私信内及时收到视频和专栏投稿的推送!
欢迎加入牧有汉化,致力于为玩家社群提供优质内容!组员急切募集中!测试群组822400145!
本作品英文原文著作权属Paradox interactive AB所有,中文译文著作权属牧有汉化所有。