Lua接口/服务端/TAddNumText:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/任务配置查询|任务配置查询]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/任务配置查询|任务配置查询]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">向扩展任务缓冲写入编号、状态、索引、发布脚本和文本。</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>TAddNumText(sceneId, id, msg, state, index, issueScript)</pre> | ||
服务端脚本中共出现 33 处调用,实参个数出现过:5 个(16 处)、6 个(17 处)。 | |||
实现位于 <code>LuaFnTbl_MissionTable.h</code>。 | |||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(33 处)</span> | ||
|- | |- | ||
| 2 | |||
| <code>id</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 条目或业务编号。<br /><span class="lua-muted">脚本中的实参:<code>missionIndex</code>(16 处)、<code>x600026_g_ScriptId</code>(2 处)、<code>x229000_g_ScriptId</code></span> | ||
|- | |- | ||
| 3 | |||
| <code>msg</code><br /><span class="lua-muted"><code>string</code></span> | |||
| | | 文字内容(字符串)。<br /><span class="lua-muted">脚本中的实参:<code>missionName</code>(16 处)、<code>"送我去衙门"</code>、<code>"大劫大难"</code></span> | ||
|- | |- | ||
| 4 | |||
| <code>state</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 状态数值。<br /><span class="lua-muted">脚本中的实参:<code>4</code>(14 处)、<code>2</code>(8 处)、<code>1</code>(6 处)</span> | ||
|- | |- | ||
| 5 | |||
| <code>index</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 条目索引。<br /><span class="lua-muted">脚本中的实参:<code>-1</code>(29 处)、<code>1</code>(2 处)、<code>2</code></span> | ||
|- | |- | ||
| 6 | |||
| <code>issueScript</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 关联脚本编号。<br /><span class="lua-muted">脚本中的实参:<code>x600026_g_ScriptId</code>(2 处)、<code>x229000_g_ScriptId</code>、<code>x229001_g_ScriptId</code></span> | ||
|} | |} | ||
== 返回值 == | == 返回值 == | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
== 脚本中的调用 == | |||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre>-- 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)</pre> | |||
== 注意事项 == | == 注意事项 == | ||
* 接口会根据实参数量处理部分分支;省略参数前需确认对应调用场景。 | * 接口会根据实参数量处理部分分支;省略参数前需确认对应调用场景。 | ||
</div> | </div> | ||
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)
注意事项
- 接口会根据实参数量处理部分分支;省略参数前需确认对应调用场景。