Transport Fever 2

Transport Fever 2

Capacity Adjuster
此主题已被锁定
doug 2023 年 9 月 19 日 下午 6:44
Selecting 0.25 causes the game to crash
An array of parameter of n parameter choices will return values between 0 and n-1.
LUA arrays are indexed from 1 to n.
So, when the user selects 0.25 as the scale factor, the parameter value is zero and scaleFactors[params.factor] returns a nil value.
You will want scaleFactors[params.factor + 1]

Also, you will want to note in the description that this mod should be loaded after all mods that add cargo types or that otherwise change the cargoes that vehicles carry. Otherwise, your mod will not modify the cargo capacities that are added to vehicles by those other mods.
< >
正在显示第 1 - 2 条,共 2 条留言
doug 2023 年 9 月 19 日 下午 7:01 
On further reflection, I don't think the load order will matter. Most, if not all, industry mods copy capacity values from existing compartments.
McModder  [开发者] 2023 年 9 月 20 日 上午 2:29 
About array indexes: Yep, I forgot to check it :/
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50