英白拉多:罗马
ParaWikis
502 Bad Gateway
502 Bad Gateway
openresty
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
资助我们
×
欢迎访问英白拉多:罗马百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“Script Values”的源代码
←
Script Values
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{Version|Timeless}} Script values are functions that calculate a value, based on a number of conditions. Script values are not stored anywhere, they are temporary and exist only when a script calls them. However, they ''can'' be [[GUI modding#Displaying a variable or script value|displayed in UI]], which seems to calculates them on every frame. They are placed in <code>common/script_values</code>, in a .txt file. A basic script value (also "svalue"), looks like this: <pre> my_value = { value = country_population multiply = 10 add = 20 } </pre> To use an svalue in a script, simply write its name, like this <code>add_treasury = my_value</code> The [[Scopes|scope]] of an svalue depends on where from script it is called. If you are in a country scope, the svalue will also be in a country scope, meaning it will expect country triggers and effects. The svalue above cannot be called for a territory or character, for example. Svalue accepts effects, and a function like <code>add</code> can be used inside them to change the svalue. Important: make sure you are using an effect and not a trigger for this. <code>Every_</code> or <code>random_</code> functions are effects, while <code>any_</code> is a trigger. Example: <pre> cities_in_state = { value = 0 every_state_province = { limit = { has_province_rank = city } add = 1 } } </pre> We can have multipe effects and if statements: <pre> slaves_needed = { value = 20 if = { limit = { has_city_status = no } add = -5 } if = { limit = { terrain = farmland } add = -2 } } </pre> Script values can call each other. They can use values from variables (with var:variable_name) and variables can be set to them, to save a value permanently. Changes to script values reload instantly if you started the game in debug_mode, but some triggers may break after a reload, like <code>terrain</code> or <code>pop_type</code>. Restart the game if a script value doesn't seem to work properly while its syntax looks to be correct. {{Modding navbox}} [[Category:模组制作]] [[en:Script_Values]]
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:Modding navbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
Script Values
。
×
登录
密码
记住登录
加入英白拉多:罗马百科
忘记密码?
其他方式登录