王国风云2
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问王国风云2百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“游戏规则模组制作”的源代码
←
游戏规则模组制作
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|2.6}} '''[[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 [[flag]]s, 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 <code>common/game_rules/</code>. The format is: <pre> <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 } } </pre> 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 <code>dlc = "The Reaper's Due"</code>. *Each option can have <code>achievements = yes/no</code>. This doesn't make sense to be used for mods, as they already disable achievements by changing the [[checksum]]. *The same is true for <code>alt_start_achievements = yes/no</code>, which determines whether the option disables achievements when using alternate starts (shattered/randomised world). Defaults to yes even if <code>achievements = no</code>. *You can create custom rule group, for example <code>group = "RULE_GROUP_MY_MOD"</code>. *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 <code>alt_start_default = <option_name></code>. ==Usage== Selected option of a rule can be compared from scripting via the condition <code>has_game_rule = { name = <rule_name> value = <option_name> }</code>. Some vanilla rules are not used from scripting and modify hardcoded behavior, similar to [[defines]], which is not possible for mods. [[Category:Modding]] {{ModdingNavbox}}
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:ModdingNavbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
游戏规则模组制作
。
×
登录
密码
记住登录
加入王国风云2百科
忘记密码?
其他方式登录