钢铁雄心4
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问钢铁雄心4百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
注意:请勿在本站上传违反中华人民共和国法律的相关项目及文本,包括但不限于涉及违法犯罪、历史虚无主义、侮辱先烈、暴力色情等,一经发现将立刻锁定证据并上报网警。
欢迎所有对百科感兴趣的同学加入钢4编辑群:
1137478871
。
阅读
查看源代码
查看历史
讨论
查看“Arrays”的源代码
←
Arrays
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|1.9}} 数组(Arrays)通常是储存数据的文件。在《钢铁雄心Ⅳ》中,数组可以存储定值数据和变值数据。 数组可以在游戏中出现一些效果,可以触发它们来检查它们。有些特殊的功能允许重复将同一个数组或者其中的部分数据用于其他的效果。 == 效果 == {{SVersion|1.9}} === 添加数组 === {{SVersion|1.9}} <pre>add_to_array = { array = <name> value = <value> index = <index> } </pre> 创建一个数组并写入内容。 <name>可以是你想触发的效果的名称 <value>是你要添加到数组的数据。它可以是定值数字(i.e. 1 or var:my_num) 或者一个范围 (i.e. GER or var:my_scope).这可以自己选择,如果不包括,那么可以把作用范围写入<value> <index>是表示这个<value>应被插入这个数组的位置。一般情况下会被插入这个数组的末端,否则这个数据会被移动来容纳新的<value> 一个比较短的表达式: <code>add_to_array = { <name> = <value> }</code> === 从数组移除 === {{SVersion|1.9}} <pre>remove_from_array = { array = <name> value = <value> index = <index> } </pre> <name>是你要从中移除数据的数组。 <value>是你想从这个数组中移除的值 如果有的话t). <index>是你想从这个数组中移除的索引(index) (如果有的话). 如果没有确定<value>或<index>,那么最末尾的那个就会被移除 一个较短的表达式: <code>remove_from_array = { <name> = <value> }</code> === 清除数组 === {{SVersion|1.9}} <pre>clear_array = <name></pre> 清除指定数组中的所有数据 === 调整数组 === {{SVersion|1.9}} <pre>resize_array = { array = <name> value = <value> size = <int> } </pre> 调整指定的数组 <value>是写入这个数组的值。如果没有指定一个值,那么会自动设为0 The size attribute specifies the new size of the array, removing elements if shrinking the array, or adding new elements with the specified value if expanding it. A short form can be used: <code>resize_array = { <name> = <size> }</code> === while_loop_effect === {{SVersion|1.9}} <pre>while_loop_effect = { break = <string> limit = { <triggers> } <effects> } </pre> Runs the effect as long as a trigger is true. The break attribute specifies a temp variable that can be set to non-0 to break the loop, ending iteration. By default this is <code>break</code>. Effects can be used within the loop to perform operations with the data within an array. === for_each_loop === {{SVersion|1.9}} <pre>for_each_loop = { array = <name> value = <string> index = <string> break = <string> <effects> } </pre> Runs a loop for each element of the specified array. The value attribute specifies a temp variable that stores the current value whilst iterating over the loop. By default this is <code>v</code>. The index attribute specifies a temp variable that stores the current index whilst iterating over the loop. By default this is <code>i</code>. The break attribute specifies a temp variable that can be set to non-0 to break the loop, ending iteration. By default this is <code>break</code>. Effects can be used within the loop to perform operations with the data within an array. === for_each_scope_loop === {{SVersion|1.9}} <pre>for_each_scope_loop = { array = <name> break = <string> <effects> } </pre> Runs a loop for each element of the specified array and changes the current scope to the current element in each iteration. The break attribute specifies a temp variable that can be set to non-0 to break the loop, ending iteration. By default this is <code>break</code>. Effects can be used within the loop to perform operations with the data within an array. === random_scope_in_array === {{SVersion|1.9}} <pre>random_scope_in_array = { array = <name> break = <string> limit = { <triggers> } <effects> } </pre> Runs a loop for each element of the specified array and changes the current scope to a random scope (out of the scopes within the array) that meet the triggers specified. The break attribute specifies a temp variable that can be set to non-0 to break the loop, ending iteration. By default this is <code>break</code>. Effects can be used within the loop to perform operations with the data within an array. === add_to_temp_array === {{SVersion|1.9}} Same as <code>add_to_array</code> but for temporary arrays that expire once execution of the script is finished. === remove_from_temp_array === {{SVersion|1.9}} Same as <code>remove_from_array</code> but for temporary arrays that expire once execution of the script is finished. === clear_temp_array === {{SVersion|1.9}} Same as <code>clear_array </code> but for temporary arrays that expire once execution of the script is finished. === resize_temp_array === {{SVersion|1.9}} Same as <code>resize_array</code> but for temporary arrays that expire once execution of the script is finished. == Triggers == {{SVersion|1.9}} === is_in_array === {{SVersion|1.9}} <pre>is_in_array = { array = <name> value = <value> } </pre> Checks if the specified value is in the specified array. === any_of === {{SVersion|1.9}} <pre>any_of = { array = <name> value = <string> index = <string> <triggers> } </pre> Runs a loop on the specified array and checks the triggers against the current element. If any return true, the whole check returns true, otherwise returns false. === all_of === {{SVersion|1.9}} <pre>all_of = { array = <name> value = <string> index = <string> <triggers> } </pre> Runs a loop on the specified array and checks the triggers against the current element. If any return false, the whole check returns false, otherwise returns true. === any_of_scopes === {{SVersion|1.9}} <pre> any_of_scopes = { array = <name> <triggers> } </pre> Runs a loop on the specified array and checks the triggers against the current element scope. If any return true, the whole check returns true, otherwise returns false. === all_of_scopes === {{SVersion|1.9}} <pre> all_of_scopes = { array = <name> <triggers> } </pre> Runs a loop on the specified array and checks the triggers against the current element scope. If any return false, the whole check returns false, otherwise returns true. == Examples == {{SVersion|1.9}} {{Modding navbox}} [[Category:Modding]]
本页使用的模板:
Template:Ambox
(
查看源代码
)
Template:Ambox/core
(
查看源代码
)
Template:Clear
(
查看源代码
)
Template:Modding navbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Ruby
(
查看源代码
)
Template:SVersion
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
Arrays
。
×
登录
密码
记住登录
加入钢铁雄心4百科
忘记密码?
其他方式登录