Lua接口/服务端函数索引/载具与乘客:修订间差异

来自天龙知识库
跳到导航跳到搜索
雪舞​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
Waylee​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
 
第1行: 第1行:
__NOTOC__
__NOTOC__
<div class="lua-reference" style="max-width:1200px;margin:0 auto;line-height:1.8;color:#29343a;font-family:Arial,'Microsoft YaHei',sans-serif;letter-spacing:0;overflow-wrap:anywhere;">
<div class="lua-reference">
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端调用约定|调用约定]]
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端调用约定|调用约定]]


<div style="padding:14px 0;border-top:3px solid #287568;">载具与乘客:16 个接口,16 个调用名称,其中 12 个在当前脚本中有调用。</div>
<div class="lua-lead">载具与乘客:16 个接口,16 个调用名称,其中 12 个在当前脚本中有调用。</div>
{| class="wikitable" style="width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;"
{| class="wikitable"
! scope="col" style="text-align:left;background:#edf3f2;padding:8px;width:36%;" | 函数 / 别名
! scope="col" class="lua-w36" | 函数 / 别名
! scope="col" style="text-align:left;background:#edf3f2;padding:8px;" | 调用与用途
! scope="col" | 调用与用途
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusAddPassenger|LuaFnBusAddPassenger]]
| [[Lua接口/服务端/LuaFnBusAddPassenger|LuaFnBusAddPassenger]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusAddPassenger(sceneId, nBusObjID, nPassengerID)</code><br />把指定乘客加入载具。<br /><span style="color:#a08a6a;">脚本中未见调用</span>
| <code>LuaFnBusAddPassenger(sceneId, nBusObjID, nPassengerID)</code><br />把指定乘客加入载具。<br /><span class="lua-warn">脚本中未见调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusAddPassenger_Shuttle|LuaFnBusAddPassenger_Shuttle]]
| [[Lua接口/服务端/LuaFnBusAddPassenger_Shuttle|LuaFnBusAddPassenger_Shuttle]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusAddPassenger_Shuttle(sceneId, nBusObjID, nPassengerID, nNpcID, bOutputError)</code><br />检查停靠条件后,让指定乘客登上接驳载具。<br /><span style="color:#657078;">脚本中 6 处调用</span>
| <code>LuaFnBusAddPassenger_Shuttle(sceneId, nBusObjID, nPassengerID, nNpcID, bOutputError)</code><br />检查停靠条件后,让指定乘客登上接驳载具。<br /><span class="lua-muted">脚本中 6 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusAddPassengerList|LuaFnBusAddPassengerList]]
| [[Lua接口/服务端/LuaFnBusAddPassengerList|LuaFnBusAddPassengerList]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusAddPassengerList(sceneId, nBusObjID, nNpcID, bOutputError, nPassengerCount, ...)</code><br />检查停靠和容量条件后,批量让乘客登上载具,每次最多处理 8 名。<br /><span style="color:#657078;">脚本中 2 处调用</span>
| <code>LuaFnBusAddPassengerList(sceneId, nBusObjID, nNpcID, bOutputError, nPassengerCount, ...)</code><br />检查停靠和容量条件后,批量让乘客登上载具,每次最多处理 8 名。<br /><span class="lua-muted">脚本中 2 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusGetObjIDByGUID|LuaFnBusGetObjIDByGUID]]
| [[Lua接口/服务端/LuaFnBusGetObjIDByGUID|LuaFnBusGetObjIDByGUID]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusGetObjIDByGUID(sceneId, uGUID)</code><br />根据载具 GUID 查询其场景对象 ID。<br /><span style="color:#657078;">脚本中 6 处调用</span>
| <code>LuaFnBusGetObjIDByGUID(sceneId, uGUID)</code><br />根据载具 GUID 查询其场景对象 ID。<br /><span class="lua-muted">脚本中 6 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusRemoveAllPassenger|LuaFnBusRemoveAllPassenger]]
| [[Lua接口/服务端/LuaFnBusRemoveAllPassenger|LuaFnBusRemoveAllPassenger]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusRemoveAllPassenger(sceneId, nBusObjID)</code><br />让载具中的全部乘客下车。<br /><span style="color:#657078;">脚本中 2 处调用</span>
| <code>LuaFnBusRemoveAllPassenger(sceneId, nBusObjID)</code><br />让载具中的全部乘客下车。<br /><span class="lua-muted">脚本中 2 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusRemovePassenger|LuaFnBusRemovePassenger]]
| [[Lua接口/服务端/LuaFnBusRemovePassenger|LuaFnBusRemovePassenger]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusRemovePassenger(sceneId, nBusObjID, nPassengerID)</code><br />让指定乘客离开载具。<br /><span style="color:#a08a6a;">脚本中未见调用</span>
| <code>LuaFnBusRemovePassenger(sceneId, nBusObjID, nPassengerID)</code><br />让指定乘客离开载具。<br /><span class="lua-warn">脚本中未见调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnBusStart|LuaFnBusStart]]
| [[Lua接口/服务端/LuaFnBusStart|LuaFnBusStart]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnBusStart(sceneId, nBusObjID)</code><br />启动载具的巡逻路径。<br /><span style="color:#657078;">脚本中 2 处调用</span>
| <code>LuaFnBusStart(sceneId, nBusObjID)</code><br />启动载具的巡逻路径。<br /><span class="lua-muted">脚本中 2 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnCreateBus|LuaFnCreateBus]]
| [[Lua接口/服务端/LuaFnCreateBus|LuaFnCreateBus]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnCreateBus(sceneId, nBusDataID, pos, pos4, fDir)</code><br />在指定场景坐标创建载具,返回载具对象 ID。<br /><span style="color:#a08a6a;">脚本中未见调用</span>
| <code>LuaFnCreateBus(sceneId, nBusDataID, pos, pos4, fDir)</code><br />在指定场景坐标创建载具,返回载具对象 ID。<br /><span class="lua-warn">脚本中未见调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnCreateBusByPatrolPathId|LuaFnCreateBusByPatrolPathId]]
| [[Lua接口/服务端/LuaFnCreateBusByPatrolPathId|LuaFnCreateBusByPatrolPathId]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnCreateBusByPatrolPathId(sceneId, nBusDataID, nPatrolPathID, bAthwart)</code><br />按巡逻路径创建载具,返回载具对象 ID。<br /><span style="color:#657078;">脚本中 2 处调用</span>
| <code>LuaFnCreateBusByPatrolPathId(sceneId, nBusDataID, nPatrolPathID, bAthwart)</code><br />按巡逻路径创建载具,返回载具对象 ID。<br /><span class="lua-muted">脚本中 2 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnDeleteBus|LuaFnDeleteBus]]
| [[Lua接口/服务端/LuaFnDeleteBus|LuaFnDeleteBus]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnDeleteBus(sceneId, nBusObjID)</code><br />删除指定载具。<br /><span style="color:#657078;">脚本中 2 处调用</span>
| <code>LuaFnDeleteBus(sceneId, nBusObjID)</code><br />删除指定载具。<br /><span class="lua-muted">脚本中 2 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnGetBusPassengerCount|LuaFnGetBusPassengerCount]]
| [[Lua接口/服务端/LuaFnGetBusPassengerCount|LuaFnGetBusPassengerCount]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnGetBusPassengerCount(sceneId, nBusObjID)</code><br />读取载具当前乘客人数。<br /><span style="color:#657078;">脚本中 3 处调用</span>
| <code>LuaFnGetBusPassengerCount(sceneId, nBusObjID)</code><br />读取载具当前乘客人数。<br /><span class="lua-muted">脚本中 3 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnGetBusPassengerIDByIndex|LuaFnGetBusPassengerIDByIndex]]
| [[Lua接口/服务端/LuaFnGetBusPassengerIDByIndex|LuaFnGetBusPassengerIDByIndex]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnGetBusPassengerIDByIndex(sceneId, nBusObjID, nIndex)</code><br />按乘客索引读取其场景对象 ID。<br /><span style="color:#657078;">脚本中 3 处调用</span>
| <code>LuaFnGetBusPassengerIDByIndex(sceneId, nBusObjID, nIndex)</code><br />按乘客索引读取其场景对象 ID。<br /><span class="lua-muted">脚本中 3 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnGetBusPassengerIDIsInBus|LuaFnGetBusPassengerIDIsInBus]]
| [[Lua接口/服务端/LuaFnGetBusPassengerIDIsInBus|LuaFnGetBusPassengerIDIsInBus]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnGetBusPassengerIDIsInBus(sceneId, selfId)</code><br />判断当前玩家是否处于载具中。<br /><span style="color:#657078;">脚本中 1 处调用</span>
| <code>LuaFnGetBusPassengerIDIsInBus(sceneId, selfId)</code><br />判断当前玩家是否处于载具中。<br /><span class="lua-muted">脚本中 1 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnGetBusScriptParam|LuaFnGetBusScriptParam]]
| [[Lua接口/服务端/LuaFnGetBusScriptParam|LuaFnGetBusScriptParam]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnGetBusScriptParam(sceneId, nBusObjID, nIndex)</code><br />读取载具的脚本数值参数。<br /><span style="color:#657078;">脚本中 12 处调用</span>
| <code>LuaFnGetBusScriptParam(sceneId, nBusObjID, nIndex)</code><br />读取载具的脚本数值参数。<br /><span class="lua-muted">脚本中 12 处调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnIsInBus|LuaFnIsInBus]]
| [[Lua接口/服务端/LuaFnIsInBus|LuaFnIsInBus]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnIsInBus(sceneId, selfId, nTargetID)</code><br />判断指定目标玩家是否处于载具中。<br /><span style="color:#a08a6a;">脚本中未见调用</span>
| <code>LuaFnIsInBus(sceneId, selfId, nTargetID)</code><br />判断指定目标玩家是否处于载具中。<br /><span class="lua-warn">脚本中未见调用</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | [[Lua接口/服务端/LuaFnSetBusScriptParam|LuaFnSetBusScriptParam]]
| [[Lua接口/服务端/LuaFnSetBusScriptParam|LuaFnSetBusScriptParam]]
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)</code><br />设置载具的脚本数值参数。<br /><span style="color:#657078;">脚本中 30 处调用</span>
| <code>LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)</code><br />设置载具的脚本数值参数。<br /><span class="lua-muted">脚本中 30 处调用</span>
|}
|}
</div>
</div>

2026年9月19日 (六) 16:59的最新版本

首页 · 服务端接口 · 调用约定

载具与乘客:16 个接口,16 个调用名称,其中 12 个在当前脚本中有调用。
函数 / 别名 调用与用途
LuaFnBusAddPassenger LuaFnBusAddPassenger(sceneId, nBusObjID, nPassengerID)
把指定乘客加入载具。
脚本中未见调用
LuaFnBusAddPassenger_Shuttle LuaFnBusAddPassenger_Shuttle(sceneId, nBusObjID, nPassengerID, nNpcID, bOutputError)
检查停靠条件后,让指定乘客登上接驳载具。
脚本中 6 处调用
LuaFnBusAddPassengerList LuaFnBusAddPassengerList(sceneId, nBusObjID, nNpcID, bOutputError, nPassengerCount, ...)
检查停靠和容量条件后,批量让乘客登上载具,每次最多处理 8 名。
脚本中 2 处调用
LuaFnBusGetObjIDByGUID LuaFnBusGetObjIDByGUID(sceneId, uGUID)
根据载具 GUID 查询其场景对象 ID。
脚本中 6 处调用
LuaFnBusRemoveAllPassenger LuaFnBusRemoveAllPassenger(sceneId, nBusObjID)
让载具中的全部乘客下车。
脚本中 2 处调用
LuaFnBusRemovePassenger LuaFnBusRemovePassenger(sceneId, nBusObjID, nPassengerID)
让指定乘客离开载具。
脚本中未见调用
LuaFnBusStart LuaFnBusStart(sceneId, nBusObjID)
启动载具的巡逻路径。
脚本中 2 处调用
LuaFnCreateBus LuaFnCreateBus(sceneId, nBusDataID, pos, pos4, fDir)
在指定场景坐标创建载具,返回载具对象 ID。
脚本中未见调用
LuaFnCreateBusByPatrolPathId LuaFnCreateBusByPatrolPathId(sceneId, nBusDataID, nPatrolPathID, bAthwart)
按巡逻路径创建载具,返回载具对象 ID。
脚本中 2 处调用
LuaFnDeleteBus LuaFnDeleteBus(sceneId, nBusObjID)
删除指定载具。
脚本中 2 处调用
LuaFnGetBusPassengerCount LuaFnGetBusPassengerCount(sceneId, nBusObjID)
读取载具当前乘客人数。
脚本中 3 处调用
LuaFnGetBusPassengerIDByIndex LuaFnGetBusPassengerIDByIndex(sceneId, nBusObjID, nIndex)
按乘客索引读取其场景对象 ID。
脚本中 3 处调用
LuaFnGetBusPassengerIDIsInBus LuaFnGetBusPassengerIDIsInBus(sceneId, selfId)
判断当前玩家是否处于载具中。
脚本中 1 处调用
LuaFnGetBusScriptParam LuaFnGetBusScriptParam(sceneId, nBusObjID, nIndex)
读取载具的脚本数值参数。
脚本中 12 处调用
LuaFnIsInBus LuaFnIsInBus(sceneId, selfId, nTargetID)
判断指定目标玩家是否处于载具中。
脚本中未见调用
LuaFnSetBusScriptParam LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)
设置载具的脚本数值参数。
脚本中 30 处调用