Lua接口/服务端/AddNumText:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第10行: | 第10行: | ||
<pre>AddNumText(sceneId, id, msg, state, index, issueScript)</pre> | <pre>AddNumText(sceneId, id, msg, state, index, issueScript)</pre> | ||
服务端脚本中共出现 | 服务端脚本中共出现 3314 处调用,实参个数出现过:3 个(37 处)、4 个(5 处)、5 个(3272 处)。 | ||
实现位于 <code>LuaFnTbl_Mission.h</code>。 | 实现位于 <code>LuaFnTbl_Mission.h</code>。 | ||
| 第22行: | 第22行: | ||
| 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>(3314 处)</span> | ||
|- | |- | ||
| 2 | | 2 | ||
| 第34行: | 第34行: | ||
| 4 | | 4 | ||
| <code>state</code><br /><span class="lua-muted"><code>number</code></span> | | <code>state</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 可选;任务或对话状态,默认 -1。<br /><span class="lua-muted">脚本中的实参:<code>6</code> | | 可选;任务或对话状态,默认 -1。<br /><span class="lua-muted">脚本中的实参:<code>6</code>(780 处)、<code>9</code>(527 处)、<code>11</code>(458 处)</span> | ||
|- | |- | ||
| 5 | | 5 | ||
| <code>index</code><br /><span class="lua-muted"><code>number</code></span> | | <code>index</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 可选;业务索引,默认 -1。<br /><span class="lua-muted">脚本中的实参:<code>-1</code> | | 可选;业务索引,默认 -1。<br /><span class="lua-muted">脚本中的实参:<code>-1</code>(578 处)、<code>1</code>(350 处)、<code>0</code>(286 处)</span> | ||
|- | |- | ||
| 6 | | 6 | ||
2026年10月26日 (一) 13:42的版本
向当前对话中追加带编号的文字选项,可指定任务状态、业务索引和关联脚本。
同一接口的其他调用名称:AddEventList。
Lua 调用
AddNumText(sceneId, id, msg, state, index, issueScript)
服务端脚本中共出现 3314 处调用,实参个数出现过:3 个(37 处)、4 个(5 处)、5 个(3272 处)。
实现位于 LuaFnTbl_Mission.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(3314 处)
|
| 2 | idnumber
|
选项编号。 脚本中的实参: x210209_g_ScriptId(41 处)、x000034_g_ScriptId(32 处)、x181003_g_scriptId(29 处)
|
| 3 | msgstring
|
提示内容 脚本中的实参: V_ZHONGZHI_NAME[j](105 处)、"确定"(86 处)、"城市1 "..strCity0Name(54 处)
|
| 4 | statenumber
|
可选;任务或对话状态,默认 -1。 脚本中的实参: 6(780 处)、9(527 处)、11(458 处)
|
| 5 | indexnumber
|
可选;业务索引,默认 -1。 脚本中的实参: -1(578 处)、1(350 处)、0(286 处)
|
| 6 | issueScriptnumber
|
可选;关联脚本编号,默认无效 ID。 |
返回值
根据执行分支,返回数量可能为 0、1 个(0 个表示无返回值)。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- city0_building0.lua AddNumText(sceneId, x805007_g_scriptId, "神秘商店", 7, 8) -- city0_building0.lua AddNumText(sceneId, x805007_g_scriptId, "委托打造", 6, 9) -- city0_building0.lua AddNumText(sceneId, x805007_g_scriptId, "武具坊介绍", 11, 7) -- city0_building11.lua AddNumText(sceneId, x805018_g_scriptId, "购买烹饪食谱", 7, 6) -- city0_building11.lua AddNumText(sceneId, x805018_g_scriptId, "酒肆介绍", 11, 7) -- city0_building12.lua AddNumText(sceneId, x805019_g_scriptId, "厢房介绍", 8, 1) -- city0_building12.lua AddNumText(sceneId, x805019_g_scriptId, "炼制珍兽舍利子", 6, 2) -- city0_building12.lua AddNumText(sceneId, x805019_g_scriptId, "关于珍兽快速升级", 11, 3)
注意事项
- 第 4、5、6 个参数可省略,默认依次为 -1、-1、INVALID_ID。
- 需要先调用 BeginEvent,最后使用 DispatchEventList 等派发接口显示。
- 脚本中有只传 3 个实参的调用,少于实现体读取的 6 个位置;缺省位置按引擎对缺失值的转换处理(通常为 0),不能直接当作有效数据。