Lua接口/服务端/BeginEvent:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的5个中间版本) | |||
| 第8行: | 第8行: | ||
<pre>BeginEvent(sceneId)</pre> | <pre>BeginEvent(sceneId)</pre> | ||
服务端脚本中共出现 | 服务端脚本中共出现 6736 处调用,实参个数出现过:1 个(6734 处)、2 个(2 处)。 | ||
实现位于 <code>LuaFnTbl_Mission.h</code> | 实现位于 <code>LuaFnTbl_Mission.h</code>。 | ||
== 参数 == | == 参数 == | ||
| 第20行: | 第20行: | ||
| 1 | | 1 | ||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | | <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code> | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(6731 处)、<code>s</code>(5 处)</span> | ||
|} | |} | ||
| 第26行: | 第26行: | ||
无返回值。 | 无返回值。 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre>-- city0_building0.lua | <pre>-- city0_building0.lua | ||
BeginEvent(sceneId) | BeginEvent(sceneId) | ||
-- event/fuben/efuben_shaxing.lua | |||
BeginEvent(s) | |||
-- event/huodong/Collect_Signature.lua | -- event/huodong/Collect_Signature.lua | ||
BeginEvent(sceneId, selfId)</pre> | BeginEvent(sceneId, selfId)</pre> | ||
2026年10月27日 (二) 12:31的最新版本
清空当前场景的对话内容,开始构造一组新的 NPC 对话。
Lua 调用
BeginEvent(sceneId)
服务端脚本中共出现 6736 处调用,实参个数出现过:1 个(6734 处)、2 个(2 处)。
实现位于 LuaFnTbl_Mission.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(6731 处)、s(5 处)
|
返回值
无返回值。
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- city0_building0.lua BeginEvent(sceneId) -- event/fuben/efuben_shaxing.lua BeginEvent(s) -- event/huodong/Collect_Signature.lua BeginEvent(sceneId, selfId)
注意事项
- 开始新对话会清空本场景前一次尚未派发的对话内容。
- 完整流程见 NPC 对话示例。
- 脚本中有传入 2 个实参的调用,多于实现体读取的 1 个位置;多出的实参不会生效,如果需要其作用应改用别的接口。