小 (RemixMe移动页面Game rules modding至游戏规则模组制作) |
小 (文本替换 - 替换“Category:Modding”为“Category:模组制作”) |
||
第45行: | 第45行: | ||
Some vanilla rules are not used from scripting and modify hardcoded behavior, similar to [[defines]], which is not possible for mods. | Some vanilla rules are not used from scripting and modify hardcoded behavior, similar to [[defines]], which is not possible for mods. | ||
[[Category: | [[Category: 模组制作]] | ||
{{ModdingNavbox}} | {{ModdingNavbox}} |
2020年5月24日 (日) 02:58的版本
Game rules are enumerated global values, that can only be modified at game start.
In their simplest form (on/off), they are similar to boolean global flags, but can get more complex (fewer/default/more).
The benefit of game rules is that they have a nice dedicated UI to manage the options at the start of a game, so there's less modding needed than using decisions.
Definition
Rules are defined in folder common/game_rules/
.
The format is:
<rule_name> = { name = LOCALIZATION_KEY_FOR_RULE_NAME group = LOCALIZATION_KEY_FOR_RULE_GROUP option = { name = <option1_name> text = LOCALIZATION_KEY_FOR_OPTION1_NAME desc = LOCALIZATION_KEY_FOR_OPTION1_DESC } option = { name = <option2_name> achievements = no #Optional text = LOCALIZATION_KEY_FOR_OPTION2_NAME desc = LOCALIZATION_KEY_FOR_OPTION2_DESC } }
Notes:
- The first option is the default one at game start.
- If certain rule only makes sense to appear with a DLC, it can use
dlc = "The Reaper's Due"
. - Each option can have
achievements = yes/no
. This doesn't make sense to be used for mods, as they already disable achievements by changing the checksum. - The same is true for
alt_start_achievements = yes/no
, which determines whether the option disables achievements when using alternate starts (shattered/randomised world). Defaults to yes even ifachievements = no
. - You can create custom rule group, for example
group = "RULE_GROUP_MY_MOD"
. - Parameter "achievements = no" adds to LOCALIZATION_KEY_FOR_OPTION_DESC a red text " This option turns off achievements." (localisation key "RULE_ACHIEVEMENTS_WARNINGS" in ReapersDue.csv).
- If you want a rule to have a different default value when using alternate starts, use
alt_start_default = <option_name>
.
Usage
Selected option of a rule can be compared from scripting via the condition has_game_rule = { name = <rule_name> value = <option_name> }
.
Some vanilla rules are not used from scripting and modify hardcoded behavior, similar to defines, which is not possible for mods.
模组制作
历史 | 角色 • 家族 • 省份 • 头衔 • 剧本 |
脚本 | 指令 • 条件 • 作用域 • 修正 • 事件 • 决议 |
常规 | 定义 • 游戏规则 • 另类开局 • 宗教 • 文化 • 政体 • 特质 • 血脉 • 科技 • 法律 • 建筑 • 宣战理由 • 朝贡国 • 单位 • 目标 • 疾病 • 死亡 • 荣誉头衔 • 社团 • 宝物 • 地图外政权 • 内阁成员 • 贸易路线 • 继承 • 奇观 • 称号 |
图像/音效/本地化 | 地图 • 图形 • 盾徽 • 肖像 • 界面 • 小地图 • 音乐 • 本地化 |
其他 | 故障排除 • 验证器 • 控制台指令 • 编辑游戏存档 • Steam创意工坊 • EU4转档器模组制作 |