跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
帮助
RustedWarfare Wiki
搜索
搜索
创建账号
登录
个人工具
创建账号
登录
查看“单位引用”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
链接
RustedWiki QQ群
←
单位引用
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{欢迎编辑}} '''单位引用'''(Unit Reference)是铁锈战争[[1.15]]新加入的单位选择器,可引用符合条件的单位。 ==查询== {| class="wikitable" |+单位引用 |标记 |getAsMarker() getOffsetRelative() getOffsetAbsolute() createMarker() |- |局内 |thisActionTarget eventSource |- |全局 |attachment() transporting() attacking lastDamagedBy parent activeWaypointTarget nearestUnit() globalSearchForFirstUnit() |- |存储 |customTarget1 customTarget2 |- |其他 |nullUnit |} ==标记== ==局内== 局内只能在行动内使用,可用<code>alsoTriggerAction</code>或<code>alsoQueueAction</code>延长“寿命”,你也可以用内存将其存储。<code>thisActionTarget</code>在不同情况下所指代的单位不同,与<code>eventSource</code>不同,后者只与<code>autoTriggerOnEvent</code>绑定,触发的事件不同所指代的单位也不同。 ===thisActionIndex的用法=== <code>thisActionIndex</code>,<code>index</code>为其缩略形式。 ...待补充 ===对应的情况=== {| class="wikitable" |+thisActionTarget用处 |fireXTurretAtGround |指向的位置 |- |alsoTriggerAction |与原行动的thisActionTarget相同 |- |onShoot_triggerActions |炮塔射击的单位 |- |takeResources_triggerActionIfAnyCollected |提取到的单位 |- |takeResources_triggerActionForEach |与上同理 |- |addWaypoint_triggerActionIfMatched |添加路径的位置(攻击则为被攻击的单位) |} {| 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") showMessageToAllPlayers: 来自%{eventSource}的攻击! </pre>}} ==全局== 铁锈战争提供了一些常见情况可能用到的单位选择器,且所以节都能使用,与'''局内'''相对。 ===选填参数部分=== <p>附属:<code>attachment([slot], [withTag])</code></p> <p>运输:<code>transporting([slot])</code></p> <p>最近单位:<code>nearestUnit([withinRange], [withTag], [relation])</code></p> <p>搜索首个单位<code>globalSearchForFirstUnit([withTag], [relation])</code></p> ====参数都为选填,默认情况就很有趣了。==== *附属 不填参数则返回行数最高的单位。 *运输 不填参数则返回最近运输的单位。 *最近单位 不填参数则返回范围约为500内的单位。 *搜索首个单位 不填参数则返回该地图最小id的单位。 ===无参数部分=== 这些单位引用的特点很明显,都是指向具体的某个单位。 <code>attacking</code>为<code>activeWaypointTarget</code>为攻击时套上单位的快捷引用方式。<code>lastDamagedBy</code>在事件来源为tookDamage时的快捷引用方式。<code>parent</code>在单位自身为他人附属时可使用。 ==存储== ==其他==
本页使用的模板:
模板:折叠
(
查看源代码
)
返回
单位引用
。
开关有限宽度模式