单位引用
单位引用(Unit Reference)是铁锈战争1.15新加入的单位选择器,可引用符合条件的单位。
查询
| 标记 | getAsMarker()
getOffsetRelative() getOffsetAbsolute() createMarker() |
| 局内 | thisActionTarget
eventSource |
| 全局 | attachment()
transporting() attacking lastDamagedBy parent activeWaypointTarget nearestUnit() globalSearchForFirstUnit() |
| 存储 | customTarget1
customTarget2 |
| 其他 | nullUnit |
标记
局内
局内只能在行动内使用,可用alsoTriggerAction或alsoQueueAction延长“寿命”,你也可以用内存将其存储。thisActionTarget在不同情况下所指代的单位不同,与eventSource不同,只与autoTriggerOnEvent绑定,触发的事件不同所指代的单位也不同。
| fireXTurretAtGround | 指向的位置 |
| alsoTriggerAction | 与原行动的thisActionTarget相同 |
| onShoot_triggerActions | 炮塔射击的单位 |
| takeResources_triggerActionIfAnyCollected | 提取到的单位 |
| takeResources_triggerActionForEach | 与上同理 |
| addWaypoint_triggerActionIfMatched | 添加路径的位置(攻击则为被攻击的单位) |
全局
铁锈战争提供了一些常见情况可能用到的单位选择器,且所以节都能使用,与局内相对。