单位引用:修订间差异
→局内:补充局内
(创建页面,内容为“'''单位引用'''(Unit Reference)是铁锈战争1.15新加入的单位选择器,可引用符合条件的单位。 ==查询== {| class="wikitable" |+单位引用 |标记 |getAsMarker() getOffsetRelative() getOffsetAbsolute() createMarker() |- |局内 |thisActionTarget eventSource |- |全局 |attachment() transporting() attacking lastDamagedBy parent activeWaypointTarget nearestUnit() globalSearchForFirstUnit() |- |存储 |customTarget1 customTarget2…”) 标签:移动版编辑 移动版网页编辑 |
(→局内:补充局内) 标签:移动版编辑 移动版网页编辑 |
||
| 第33行: | 第33行: | ||
==标记== | ==标记== | ||
==局内== | ==局内== | ||
局内只能在行动内使用,可用<code>alsoTriggerAction</code>或<code>alsoQueueAction</code>延长“寿命”,你也可以用内存将其存储。<code>thisActionTarget</code>在不同情况下所指代的单位不同,与<code>eventSource</code> | 局内只能在行动内使用,可用<code>alsoTriggerAction</code>或<code>alsoQueueAction</code>延长“寿命”,你也可以用内存将其存储。<code>thisActionTarget</code>在不同情况下所指代的单位不同,与<code>eventSource</code>不同,后者只与<code>autoTriggerOnEvent</code>绑定,触发的事件不同所指代的单位也不同。 | ||
===thisActionIndex的用法=== | |||
<code>thisActionIndex</code>,<code>index</code>为其缩略形式。 | |||
...待补充 | |||
{| class="wikitable" | {| class="wikitable" | ||
|+thisActionTarget用处 | |+thisActionTarget用处 | ||
| 第54行: | 第58行: | ||
|添加路径的位置(攻击则为被攻击的单位) | |添加路径的位置(攻击则为被攻击的单位) | ||
|} | |} | ||
{| class="wikitable" | |||
|+eventSource用处 | |||
|tookDamage | |||
|攻击你的单位 | |||
|- | |||
|killedAnyUnit | |||
|杀死的单位 | |||
|- | |||
|transportingNewUnit | |||
|新装载的单位 | |||
|- | |||
|transportUnloadedOrRemovedUnit | |||
|刚卸载的单位 | |||
|- | |||
|queuedUnitFinished | |||
|刚生产的单位 | |||
|- | |||
|touchTargetSuccess | |||
|碰到的单位(需配合路径点) | |||
|} | |||
{{折叠|thisActionTarget与eventSource的例子|<pre> | |||
[turret_super] | |||
onShoot_triggerActions: idol | |||
[hiddenAction_idol] | |||
showMessageToAllPlayers: %{thisActionTarget}的笑容。 | |||
[hiddenAction_tookDmg] | |||
autoTriggerOnEvent: tookDamge(withTag="APCR") | |||
setUnitMemory: 来自%{eventSource}的攻击! | |||
</pre>}} | |||
==全局== | ==全局== | ||
铁锈战争提供了一些常见情况可能用到的单位选择器,且所以节都能使用,与[[局内]]相对。 | 铁锈战争提供了一些常见情况可能用到的单位选择器,且所以节都能使用,与[[局内]]相对。 | ||
==存储== | ==存储== | ||
==其他== | ==其他== | ||