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

来自雪舞天龙知识库
跳到导航跳到搜索
雪舞​(留言 | 贡献)
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明
 
Waylee​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
 
(未显示2个用户的5个中间版本)
第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;">TAddText(sceneId, msg)</pre>
<pre>TAddText(sceneId, msg)</pre>
 
服务端脚本中共出现 21 处调用,实参个数出现过:2 个(21 处)。
 
实现位于 <code>LuaFnTbl_MissionTable.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。
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(21 处)</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;">msg</code><br /><span style="color:#657078;"><code style="white-space:normal;overflow-wrap:anywhere;">string</code></span>
| <code>msg</code><br /><span class="lua-muted"><code>string</code></span>
| style="padding:8px;vertical-align:top;overflow-wrap:anywhere;" | 文字内容(字符串)。
| 文字内容(字符串)。<br /><span class="lua-muted">脚本中的实参:<code>missionInfo</code>(10 处)、<code>"你的江湖阅历太低,恐怕不能胜任,待".. tostring(limitLevel) .."级之</code>(2 处)、<code>strText</code>(2 处)</span>
|}
|}


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


<div style="margin-top:20px;padding-top:10px;border-top:1px solid #dbe3e6;color:#657078;font-size:12px;">核对依据:<code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_MissionTable.h</code> 第 127 行,服务端注册表第 130 行。调用格式与返回数量依据当前实现整理;游戏内效果、边界行为及未注明的业务枚举仍需实测。</div>
== 调用示例 ==
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
<pre>-- event/city/ecity_0103deliverweapon.lua
TAddText(sceneId, " 贵帮信誉甚好,不胜感谢。")
-- event/city/ecity_0202convoypet.lua
TAddText(sceneId, " 太好了,真是谢谢你哦。")
-- event/city/ecity_0202convoypet.lua
TAddText(sceneId, strText)</pre>


</div>
</div>

2026年10月27日 (二) 12:31的最新版本

首页 · 服务端接口 · 任务配置查询 · 调用约定

向扩展任务缓冲写入一条纯文本。

Lua 调用

TAddText(sceneId, msg)

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

实现位于 LuaFnTbl_MissionTable.h。

参数

序号 参数 / 类型 说明
1 sceneId
number
当前调用所在的场景 ID。
脚本中的实参:sceneId(21 处)
2 msg
string
文字内容(字符串)。
脚本中的实参:missionInfo(10 处)、"你的江湖阅历太低,恐怕不能胜任,待".. tostring(limitLevel) .."级之(2 处)、strText(2 处)

返回值

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

调用示例

以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:

-- event/city/ecity_0103deliverweapon.lua
TAddText(sceneId, " 贵帮信誉甚好,不胜感谢。")
-- event/city/ecity_0202convoypet.lua
TAddText(sceneId, " 太好了,真是谢谢你哦。")
-- event/city/ecity_0202convoypet.lua
TAddText(sceneId, strText)