Lua接口/服务端/LuaFnSetBusScriptParam:修订间差异

来自天龙知识库
跳到导航跳到搜索
雪舞​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
Waylee​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
 
(未显示同一用户的2个中间版本)
第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接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/载具与乘客|载具与乘客]] · [[Lua接口/服务端调用约定|调用约定]]


<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">设置载具的脚本数值参数。</div>
<div class="lua-lead lua-rule">设置载具的脚本数值参数。</div>


== Lua 调用 ==
== Lua 调用 ==
<pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)</pre>
<pre>LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)</pre>


服务端脚本中共出现 30 处调用,实参个数出现过:4 个(30 处)。
服务端脚本中共出现 30 处调用,实参个数出现过:4 个(30 处)。


实现位于 <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_Bus.h</code> 第 326 行,注册表第 1205 行。
实现位于 <code>LuaFnTbl_Bus.h</code>。


== 参数 ==
== 参数 ==
{| 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:11%;" | 序号
! scope="col" class="lua-w11" | 序号
! 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;" | 1
| 1
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">sceneId</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span>
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 当前调用所在的场景 ID。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">sceneId</code>(30 处)</span>
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(30 处)</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 2
| 2
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">nBusObjID</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span>
| <code>nBusObjID</code><br /><span class="lua-muted"><code>number</code></span>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 载具的场景对象 ID。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">busId</code>(30 处)</span>
| 载具的场景对象 ID。<br /><span class="lua-muted">脚本中的实参:<code>busId</code>(30 处)</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 3
| 3
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">nIndex</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span>
| <code>nIndex</code><br /><span class="lua-muted"><code>number</code></span>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 条目索引。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">x800200_g_scriptParamIndex_lihua</code>(3 处)、<code style="white-space:normal;overflow-wrap:anywhere;">x800200_g_scriptParamIndex_xibao</code>(3 处)、<code style="white-space:normal;overflow-wrap:anywhere;">x800201_g_scriptParamIndex_lihua</code>(3 处)</span>
| 条目索引。<br /><span class="lua-muted">脚本中的实参:<code>x800200_g_scriptParamIndex_lihua</code>(3 处)、<code>x800200_g_scriptParamIndex_xibao</code>(3 处)、<code>x800201_g_scriptParamIndex_lihua</code>(3 处)</span>
|-
|-
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 4
| 4
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | <code style="white-space:normal;overflow-wrap:anywhere;">nValue</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">number</code></span>
| <code>nValue</code><br /><span class="lua-muted"><code>number</code></span>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 要写入的数值。<br /><span style="color:#657078;">脚本中的实参:<code style="white-space:normal;overflow-wrap:anywhere;">0</code>(12 处)、<code style="white-space:normal;overflow-wrap:anywhere;">saveLihuaTime</code>(3 处)、<code style="white-space:normal;overflow-wrap:anywhere;">saveXibaoTime</code>(3 处)</span>
| 要写入的数值。<br /><span class="lua-muted">脚本中的实参:<code>0</code>(12 处)、<code>saveLihuaTime</code>(3 处)、<code>saveXibaoTime</code>(3 处)</span>
|}
|}


第40行: 第40行:
== 脚本中的调用 ==
== 脚本中的调用 ==
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
<pre style="white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7;padding:12px;background:#f5f7f8;border:1px solid #dbe3e6;">-- event/bus/marry_huajiao_01.lua
<pre>-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_xibao, 0)
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_xibao, 0)



2026年9月20日 (日) 00:16的最新版本

首页 · 服务端接口 · 载具与乘客 · 调用约定

设置载具的脚本数值参数。

Lua 调用

LuaFnSetBusScriptParam(sceneId, nBusObjID, nIndex, nValue)

服务端脚本中共出现 30 处调用,实参个数出现过:4 个(30 处)。

实现位于 LuaFnTbl_Bus.h。

参数

序号 参数 / 类型 说明
1 sceneId
number
当前调用所在的场景 ID。
脚本中的实参:sceneId(30 处)
2 nBusObjID
number
载具的场景对象 ID。
脚本中的实参:busId(30 处)
3 nIndex
number
条目索引。
脚本中的实参:x800200_g_scriptParamIndex_lihua(3 处)、x800200_g_scriptParamIndex_xibao(3 处)、x800201_g_scriptParamIndex_lihua(3 处)
4 nValue
number
要写入的数值。
脚本中的实参:0(12 处)、saveLihuaTime(3 处)、saveXibaoTime(3 处)

返回值

无返回值。赋值接收时得到 nil;这与返回数字 0 不同。

脚本中的调用

以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_xibao, 0)

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_xibao_TI, x800200_g_timeInterval_xibao)

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_lihua, 0)

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_lihua_TI, x800200_g_timeInterval_lihua)

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_xibao, saveXibaoTime)

-- event/bus/marry_huajiao_01.lua
LuaFnSetBusScriptParam(sceneId, busId, x800200_g_scriptParamIndex_lihua, saveLihuaTime)

-- event/bus/marry_huajiao_02.lua
LuaFnSetBusScriptParam(sceneId, busId, x800201_g_scriptParamIndex_xibao, 0)

-- event/bus/marry_huajiao_02.lua
LuaFnSetBusScriptParam(sceneId, busId, x800201_g_scriptParamIndex_xibao_TI, x800201_g_timeInterval_xibao)