Lua接口/服务端/TAddNumText:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的1个中间版本) | |||
| 第10行: | 第10行: | ||
服务端脚本中共出现 33 处调用,实参个数出现过:5 个(16 处)、6 个(17 处)。 | 服务端脚本中共出现 33 处调用,实参个数出现过:5 个(16 处)、6 个(17 处)。 | ||
实现位于 <code>LuaFnTbl_MissionTable.h</code> | 实现位于 <code>LuaFnTbl_MissionTable.h</code>。 | ||
== 参数 == | == 参数 == | ||
| 第28行: | 第28行: | ||
| 3 | | 3 | ||
| <code>msg</code><br /><span class="lua-muted"><code>string</code></span> | | <code>msg</code><br /><span class="lua-muted"><code>string</code></span> | ||
| 文字内容(字符串)。<br /><span class="lua-muted">脚本中的实参:<code>missionName</code>(16 处)、<code>" | | 文字内容(字符串)。<br /><span class="lua-muted">脚本中的实参:<code>missionName</code>(16 处)、<code>"送我去衙门"</code>、<code>"大劫大难"</code></span> | ||
|- | |- | ||
| 4 | | 4 | ||
2026年9月20日 (日) 00:11的最新版本
向扩展任务缓冲写入编号、状态、索引、发布脚本和文本。
Lua 调用
TAddNumText(sceneId, id, msg, state, index, issueScript)
服务端脚本中共出现 33 处调用,实参个数出现过:5 个(16 处)、6 个(17 处)。
实现位于 LuaFnTbl_MissionTable.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(33 处)
|
| 2 | idnumber
|
条目或业务编号。 脚本中的实参: missionIndex(16 处)、x600026_g_ScriptId(2 处)、x229000_g_ScriptId
|
| 3 | msgstring
|
文字内容(字符串)。 脚本中的实参: missionName(16 处)、"送我去衙门"、"大劫大难"
|
| 4 | statenumber
|
状态数值。 脚本中的实参: 4(14 处)、2(8 处)、1(6 处)
|
| 5 | indexnumber
|
条目索引。 脚本中的实参: -1(29 处)、1(2 处)、2
|
| 6 | issueScriptnumber
|
关联脚本编号。 脚本中的实参: x600026_g_ScriptId(2 处)、x229000_g_ScriptId、x229001_g_ScriptId
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/city/ecity_0503savefamily.lua TAddNumText(sceneId, x600026_g_ScriptId, "大劫大难", 10, 1, x600026_g_ScriptId) -- event/city/ecity_0503savefamily.lua TAddNumText(sceneId, x600026_g_ScriptId, "请随在下杀出重围", 10, 2, x600026_g_ScriptId) -- event/city/ecity_0602military.lua TAddNumText(sceneId, x600032_g_ScriptId, x600032_g_MissionName, 2, -1, x600032_g_ScriptId) -- event/city/ecity_0603military.lua TAddNumText(sceneId, x600033_g_ScriptId, x600033_g_MissionName, 2, -1, x600033_g_ScriptId) -- event/city/ecity_0604military.lua TAddNumText(sceneId, x600034_g_ScriptId, "送我去衙门", 10, -1, x600034_g_ScriptId) -- event/city/ecity_07011chucktroublemaker.lua TAddNumText(sceneId, x600037_g_ScriptId, "进入市集", 10, 1, x600037_g_ScriptId) -- event/EventScript/event_enterarea.lua TAddNumText(sceneId, missionIndex, missionName, 2, -1) -- event/EventScript/event_enterarea.lua TAddNumText(sceneId, missionIndex, missionName, 1, -1)
注意事项
- 接口会根据实参数量处理部分分支;省略参数前需确认对应调用场景。