单位引用:修订间差异
→全局
(→全局) 标签:移动版编辑 移动版网页编辑 |
|||
| (未显示另一用户的1个中间版本) | |||
| 第57行: | 第57行: | ||
===thisActionIndex的用法=== | ===thisActionIndex的用法=== | ||
<code>thisActionIndex</code>能在遍历过程中同时知道每个元素的位置信息,<code>index</code>为其缩略形式。受<code>alsoTriggerActionRepeat</code>与<code>takeResources_triggerActionForEach</code>影响。值为int(整数)类型,从0开始,用于遍历数组。 | <code>thisActionIndex</code>能在遍历过程中同时知道每个元素的位置信息,<code>index</code>为其缩略形式。受<code>alsoTriggerActionRepeat</code>与<code>takeResources_triggerActionForEach</code>影响。值为int(整数)类型,从0开始,用于遍历数组。 | ||
eg: | <pre>eg: | ||
[hiddenAction_1] | |||
alsoTriggerAction:2 | alsoTriggerAction:2 | ||
alsoTriggerActionRepeat:memory.array.size | alsoTriggerActionRepeat:memory.array.size | ||
[hiddenAction_2] | [hiddenAction_2] | ||
setUnitMemory:array[index]=select(memory.array[index]==0,0,memory.array[index]-1)</ | setUnitMemory:array[index]=select(memory.array[index]==0,0,memory.array[index]-1)</pre> | ||
===对应的情况=== | ===对应的情况=== | ||
| 第126行: | 第127行: | ||
<p>附属:<code>attachment([slot], [withTag])</code></p> | <p>附属:<code>attachment([slot], [withTag])</code></p> | ||
<p>运输:<code>transporting([slot])</code></p> | <p>运输:<code>transporting([slot])</code></p> | ||
<p>最近单位:<code>nearestUnit([withinRange], [withTag], [relation])</code></p> | <p>最近单位:<code>nearestUnit([withinRange], [withTag], [relation], [incompleteBuildings], [withoutTag])</code></p> | ||
<p>搜索首个单位<code>globalSearchForFirstUnit([withTag], [relation])</code></p> | <p>搜索首个单位<code>globalSearchForFirstUnit([withTag], [relation], [incompleteBuildings])</code></p> | ||
====参数都为选填,默认情况就很有趣了。==== | ====参数都为选填,默认情况就很有趣了。==== | ||