欢迎光临散文网 会员登陆 & 注册

钢铁雄心4开发日志 | 10/20 模组制作改动

2021-10-28 10:47 作者:牧有汉化  | 我要投稿

牧游社 牧有汉化翻译


HoI4 Dev Diary - Modding Changes

Archangel85, Oberbefehlshaber, Content Design, HoI4


Hello, and welcome back to another Dev Diary for No Step back and 1.11 Barbarossa. Today we will be pulling back the veil a bit and show you how modders can affect and use the new features coming in 1.11.

大家吼哇,欢迎阅读新一篇绝不后退NSB与1.11版本号“巴巴罗萨Barbarossa”的开发日志。今天咱不整虚的,让Mod制作者们瞅瞅如何调整和利用1.11版本号的新功能。


For those of you who do not get unreasonably excited by hearing about new script commands and changes to databases, the long and short of it is this: We made some fundamental changes to the way the game handles some things, which will probably require your favorite mods to spend some time updating. On the flip side, those changes also allow for some exciting possibilities down the line. If you came here hoping for a release date, we must ask you for just a little more patience. We promise the announcement is very close - but not today.

如果是对数据库变化与新脚本指令没有特殊感情的读者,这篇文章总结来说就是:我们为游戏处理某些内容的方式进行了基础性调整,所以大家最中意的Mod可能得花点时间更新。另一方面,这些改动也为未来开发提供了一些机遇。如果你是为了发布日期而来,那就请耐心稍等等。我们保证它就快来了,但不是今天。



Characters

人物


Probably the biggest change is in how we handle people on the backend (or ponies, for that matter - we do not discriminate). In the current live version, the game has no real concept of a person as a distinct thing. It only knows about country leaders, military leaders, political and military advisors, and operatives. Cases where a country leader could also be a general had to be handled manually, leading to lots of exciting bugs when the country leader was removed but the general was forgotten about and other such cases.

改动最大的可能是在后台处理人物(或小马,没有任何差别对待的意思)的方式了。在当前版本里,游戏没有真正意义上的人物概念。它只知道国家领袖、指挥官、政治或军事顾问和特工。同时还担任将领的国家领袖必须得由后台手动处理,也就导致了很多刺激的bug:比如国家领袖被公审了但他这个将领却没事,以及其他类似情况。


We have overhauled that side of the game from the ground up with the introduction of characters. This should dramatically reduce the amount of potential zombie generals shambling around, which I am sure the non-zombie population will greatly appreciate.

我们在方面进行了全面重制,并引入了人物概念。这应该能显著降低僵尸将领的数量,相信非僵尸人群会心怀感恩。


Characters are defined in the common/character folder, and their definitions look like this:

人物定义脚本位于common/character文件夹中,其定义如下所示:



Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc. Due to technical concerns, Operatives remain their own thing. On the character level itself, things like name and gender are handled. This also means that character names can now be localised and you can refer to a character by ID instead of by name (this helps a lot with character names that have non-english characters in them - turns out this broke some triggers and effects).

每个人物都定义成装有不同可担当职务的容器,比如将领(corps_commander)、顾问、国家领袖等。出于技术考量,特工仍然保持原样。在人物层级方面,主要处理的是姓名和性别等内容。也就是说终于能对人名进行本地化了,而指代某人物可以通过其ID代码进行(这对很多名字里有非英文字符的人物大有帮助——因为他们的名字往往会导致某些触发器和效果出问题)。



This also means that if a character is removed from play - say, through a purge - they are automatically removed from all roles that they could have, which makes such systems a lot easier to do script-side. It also means that if we wanted to allow Zhukov to become a country leader, we could simply add a country leader role for him in the character file, like this:

也就是说,如果游戏中某个人物被移除了(比如清洗掉了),他们可担当的各类职务也会移除该人物,让这种机制在脚本编码层面更容易进行。如果我们想让朱可夫成为国家领袖,可以直接在人物文件中给他加一个国家领袖职能,像这样:



Or we could also add the role later on, via focus, event, decision... like we do here with Beriya:

或者我们也可后续添加职能,通过国策、事件、决议……就像这儿的贝利亚同志:



That means there is a lot less confusion and duplication of effort necessary when putting a character into a new role, since stuff like portraits, name etc. are already handled. A broken portrait only needs to be fixed in one place instead of five etc.

由于肖像、姓名等已经统一处理了,这样人物新增职能时,可以大幅减少代码带来的混乱与重复运作。比如肖像的错误只需修正一处即可,不必跑五个位置挨个修正。


Once defined, characters are recruited in the country history file in order to be added to the game. As you can see in the first screenshot, you can use visible triggers for unit leaders to ensure they are not shown if you don’t want them to be.

人物在定义后,会在国家的history文件中招募进游戏。如图一所示,你可以给部队将领使用可视触发器,以此确保他们不会显示。


Characters that can potentially become country leaders are made into country leaders using the promote_character effect, like so:

有可能成为国家领袖的人物,可以使用promotion_character效果来把他们设置成国家领袖,像这样:



This is a clear departure from the practice in the live version of the game, where you would create a new country leader in that effect. The old script with create_country_leader and other such effects should still be working, but obviously you don’t get any of the advantages of the unified character system.

这与当前版本的运作方式显然不同,现在游戏里是用promotion_character效果创造一个新的国家领袖。带有create_country_leader和其它此类效果的旧脚本应该还能继续运作,但肯定享受不到整体人物系统的好处。


So let's talk about some more things you can do with it!

咱们聊聊新内容能做的更多事情!


You can set and check character flags for nefarious purposes:

你可以出于各类奇异目的,设置和检定人物flag:



You can change the traits of advisors without having to make a whole new advisor:

你可以改变顾问的特质,而不必新建一个:



You can check if a character is a certain type of character:

你可以检定一个人物是否为特定类别角色:



You can save the character as a variable to refer to them later, such as spamming debug messages in the console!

你可以把一个人物保存为变量以便稍后引用,例如在控制台中发送一大堆测试信息!





tank designer

坦克设计器


Next, let's talk a bit about how the tank designer works on the backend. It shares a lot of concepts with the ship designer, such as modules and module slots. It does, however, work a little differently in some other, important aspects.

接着咱们来聊聊坦克设计器的后端运作。它和舰船设计器概念上甚是相通,例如模块和模块槽位。但它在另外某些重要层面的运作方式却略有不同。


While the system pretends that there are only a handful of chassis (light, medium, heavy, super-heavy, amphibious, modern), this is not technically true. Instead, the system maintains a whole host of other, dynamically created chassis. This allows us to make sure that tank designs with the tank destroyer role actually go into tank destroyer battalions etc.

虽然说整个系统会假设只有几种坦克底盘(轻型、中型、重型、超重型、两栖和现代),但严格来说并非如此。实际上,这个系统还涵盖了一大堆动态创建的底盘,以此来保证设计出来的坦克歼击车实际配给了坦歼营等情况。


However, these dynamic chassis are still generated from the base chassis, so any changes to them will carry over.

不过呢,这些动态底盘仍然源自于基础底盘,所以后者的任何改动都会延续到前者。


The roles are enabled and disabled on individual modules:

这些职能可以在单个模块上启用或者禁用:



For the unlock of new module categories, you can then use this on a module to unlock that category:

若要解锁新的模块类别,你可以用这个来进行:







Railways

铁路


Railways function a little differently from other buildings. While they are technically province buildings like forts, they are in reality closer to a building that connects two provinces. A railway line is effectively a series of two-province connections, and the lowest one in the chain determines the level of the railroad connection between two supply hubs.

铁路和其他建筑相比就略有不同了。虽然它们确实和堡垒相似,都是省份建筑,但是铁路的概念更像是连接两个省份的建筑。一条铁路实际上是一串“两个省份的连接”。而这串“两个省份的连接”中最低值决定了两个补给枢纽之间的铁路等级。


To make it easier to change and maintain the historical railway setup, we have added an option to draw railways into the nudger tool, which you can access by using the nudge command in the console.

为了更轻松地改变和维护历史铁路设定,我们在nudger工具里添加了一个绘制铁路路线的选项,如有需要,在控制台输入NUDGE命令即可。



The railway setup is in the supply menu in the nudger, and you can easily add new railway lines to the existing setup in this way. It took me about a week and a half to do the entire 1936 setup, including tracking down reference maps (with a lot of help from some of our testers).

铁路设定在nudger工具的补给菜单里。你可以轻松地在现有的铁路网内添加新的铁路线。我花了大概一个半星期来制作了整个1936年的铁路设置,包括查了一大堆参考地图(测试人员帮大忙了)


If you want to add railways through script, you have the build_railway effect. It gives you a lot of options, with the most basic one being to lay out the path one province at a time:

如果想通过脚本来添加铁路路线,你需要有build_railway这个效果。这可以给你很多选择,其中最基本的是逐个省份建造线路:



This is obviously a little cumbersome for longer railways, especially if you don’t really care about the exact path. For that, you have the option to define a start and an end province:

当然这对长距离铁路来说有点繁琐,尤其是不太注重铁路具体路径的时候。为此,你可以直接选定铁路的起始和终点省份。



The game will then automatically generate a path from one end to the other using advanced neural network-based self-learning algorithms that use blockchain (read: I have no idea how it works but this sounds impressive).

然后,游戏将使用基于高级神经网络的区块链自学算法自动生成一条从一端到另一端的路线(注释:我也不知道这咋运作的,但听起来好强大)。


If finding the province is too much work, or if you want to be somewhat dynamic, you can even use start and end states (also note that you can specify what level of connection should be built):

如果你感觉从省份级别绘制铁路路线的工作量太大,或者说你想整点不一样的活,你甚至可以直接选定起始地区和终点地区(注意,你可以特定想建造哪种级别的铁路路线)。



Note that you can't mix these, so you can't define a starting province and a target state for example.

不过注要意,以上两类不能混在一起。比如不能给一条铁路选定起始省份和终点地区。


There are also corresponding triggers like can_build_railway and has_railway_connection:

这里也有相应的代码,比方说can_build_railway和has_railway_connection:



The first checks if a railway can be built between two locations, while the other checks if one such connection already exists.

第一个命令可以检查这两个地点之间能不能建造铁路,另一个用来检查是否已经有了这样的铁路连接。


Finally, there is has_railway_level, which checks if the specified state has a railway line in it with the specified level:

最终,has_railway_level这条代码,可以检查指定的地区是否有某个等级的铁路。





Miscellaneous new effects, triggers, modifiers

各种新的效果、触发器和修正


In addition to the things described above, we have added a number of useful things that some of you might find useful:

除了刚刚说的一大堆东西之外,我们还加入了一些你可能觉得有用的小玩意。


Building_cost_factor: a new modifier that affects the construction cost of buildings. This takes the buildings from the 00_buildings file, so it should work with mods that add more buildings.
Building_cost_factor:新的影响建筑物建造花费的因数。这个因数影响到在00_building文件中的建筑物,所以说即使有别的增加建筑物的模组,它也能正常运作。

Core_state scope list, allowing you to run effects and triggers on a country’s core states:
Core_state作用域列表。这个可以保证你可以在一个国家的核心领土上运行效果和触发机制。

Add_equipment_to_stockpile effect can now take a variant name to ensure that you add the right kind of equipment.
Add_equipment_to_stockpile效果现在可以用采用变种名称,以保证你添加了正确种类的装备。



That's all for today, I hope you enjoyed these little insights and we are all excited about what crazy things you will do with the new tools at your disposal.

这就是这次日志的所有内容了,希望大家中意这些小玩意。很期待能看到各位用这些新工具能整出什么活。



翻译:月蚀 人间面包

校对:zzztotoso 三等文官猹中堂


欢迎关注UP主和主播小牧Phenix

欢迎关注牧游社微信公众号和知乎专栏!微信公众号改版为信息流,欢迎【置顶订阅】不迷路,即时获得推送消息!

B站在关注分组中设置为【特别关注】,将会在私信内及时收到视频和专栏投稿的推送!

欢迎加入牧有汉化,致力于为玩家社群提供优质内容!组员急切募集中!测试群组822400145!    

钢铁雄心4开发日志 | 10/20 模组制作改动的评论 (共 条)

分享到微博请遵守国家法律