去掉 E 后缀(E begone)
移除新款 L、XL 飞船名称中的 E 后缀,隐藏旧款飞船蓝图,并将 Faulty Logic 中废弃的 Odysseus Vanguard 替换为新模型。适用于新存档;中途安装可能不会更新已有蓝图或废弃飞船。兼容 VRO。
为 X4: Foundations 提供管理跳跃门与加速器的游戏内 API,支持创建、连接、断开连接、销毁和标记对象,并提供异步回调。需要 Mod Support APIs 1.93 或更高版本。
为 X4: Foundations 提供管理跳跃门与加速器的游戏内 API,支持创建、连接或断开连接,以及销毁跳跃门和加速器。
可通过 Steam 客户端安装:Gate Manage API
也可通过 Nexus Mods 安装:Gate Manage API
本 API 供其他脚本或模组调用。使用时向 md.Gate_Manage_API.Request cue 传入参数表;若要取得命令结果,应在参数表中提供回调函数。命令完成后,回调函数会收到结果表。
可创建一个 cue,在 md.Gate_Manage_API.Reloaded 发出信号时执行:
<cue name="YouOnReloaded" instantiate="true">
<conditions>
<event_cue_signalled cue="md.Gate_Manage_API.Reloaded" />
</conditions>
<actions>
<debug_text text="'Gate_Manage_API: Reloaded'" chance="100" filter="general" />
...
</actions>
</cue>
<cue name="...">
<actions>
...
<set_value name="$args"
exact="table[
$command = 'destroy_gate',
$gate = @$gate,
$callback = Your_Capture_Results,
]" />
<signal_cue_instantly cue="md.Gate_Manage_API.Request" param="$args" />
...
</actions>
</cue>
<cue name="Your_Capture_Results" instantiate="true">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
...
<set_value name="$result" exact="@event.param" />
<debug_text text="'Command %s completed with result %s (%s)'.[@$result.$command, @$result.$result, @$result.$info]" chance="100" filter="general" />
...
</actions>
</cue>
所有命令都会返回包含输入参数及下列标准字段的结果表:
$result:字符串,值为 success 或 error。$info:字符串,提供补充信息,尤其是错误信息。$detail:字符串,提供更详细的信息,尤其是错误信息;可选,可能不存在。build_gate在指定星区的位置和朝向创建跳跃门或加速器,可选定对象所有者。
$command:字符串,必须为 build_gate。$sector:星区对象,必填。$macroId:字符串,必填;要创建的跳跃门或加速器宏 ID。$ownerId:字符串,可选,默认值为 ownerless;也可使用字符串 null 表示无所有者。$offset:表,必填;星区内的位置偏移,单位为米,格式为 table[$x = ..., $y = ..., $z = ...]。$rotation:表,可选;朝向格式为 table[$yaw = ..., $pitch = ..., $roll = ...],角度使用普通数字,单位为度。不要使用 MD 单位后缀:$yaw = 90 表示 90 度,而 $yaw = 90deg 会被当作弧度,导致传送门几乎没有旋转。未提供 $rotation 时使用地图朝向。不能传入 MD 的位置或旋转值,必须使用普通表。$getRotationFromMap:布尔值,可选,默认 false。设为 true 时,根据星区地图数据确定朝向,并忽略 $rotation。$callback:函数;接收结果的回调函数。成功时,结果表会在输入参数和标准字段之外包含:
$gate:创建的跳跃门或加速器对象;仅成功时存在。connect_gates连接两个跳跃门或加速器,使其之间可以即时旅行。
$command:字符串,必须为 connect_gates。$gateSource:跳跃门或加速器对象,必填;连接的起点。$gateTarget:跳跃门或加速器对象,必填;连接的目标。$callback:回调函数。disconnect_gates断开两个已连接的跳跃门或加速器。
$command:字符串,必须为 disconnect_gates。$gateSource:跳跃门或加速器对象,必填;要断开的第一个对象。$gateTarget:跳跃门或加速器对象,必填;要断开的第二个对象。$callback:回调函数。destroy_gate销毁现有跳跃门或加速器。
$command:字符串,必须为 destroy_gate。$gate:跳跃门或加速器对象,必填。$callback:回调函数。结果表还会包含:
$name:被销毁对象的名称。$sector:被销毁对象所在的星区对象。mark_gate在地图上标记跳跃门或加速器,以便辨认。
$command:字符串,必须为 mark_gate。$gate:要标记的跳跃门或加速器对象,必填。$callback:回调函数。unmark_gate移除地图上此前对跳跃门或加速器所做的标记。
$command:字符串,必须为 unmark_gate。$gate:要取消标记的跳跃门或加速器对象,必填。$callback:回调函数。get_macro_tables获取可用的跳跃门与加速器宏表。
$command:字符串,必须为 get_macro_tables。$callback:回调函数。结果表还会包含:
$gatesTable:可用跳跃门宏的表列表。$acceleratorsTable:可用加速器宏的表列表。列表中的每个表包含:
$name:宏名称。$macroId:宏 ID。$icon:关联图标。$isAccelerator:布尔值,表示该宏是否为加速器。由于游戏 Lua 引擎的限制,目前只能通过图标字段辨别宏类型:mapob_transorbital_accelerator 表示加速器,mapob_jumpgate 表示跳跃门。若其他模组新增使用不同图标的跳跃门或加速器,本 API 将无法正确识别其类型。
据作者说明,目前只有一个模组使用此 API:自 1.16 版起的 Gate Manager。
作者:Chem O`Dun。
build_gate 忽略提供的 $rotation、无论 $getRotationFromMap 是否为 false 都始终使用地图朝向的问题;感谢 Bamfon 报告并提出修复方案。$offset 和 $rotation 必须使用普通表,API 实际接受的也是普通表。$rotation 在所有情况下均为可选;未提供时使用地图朝向。Provides an in‑game API for managing Jump Gates and Accelerators in X4: Foundations. The API supports creating, connecting or disconnecting, and destroying gates and accelerators.
1.93 and upper is required.前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:x4foundations:1856 -->