Lua接口/服务端/TGetDuologue:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第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">按对白索引返回 StorytellingDuologue.txt 中的完整文本。</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>TGetDuologue(sceneId, duologueIndex)</pre> | ||
服务端脚本中共出现 1 处调用,实参个数出现过:2 个(1 处)。 | 服务端脚本中共出现 1 处调用,实参个数出现过:2 个(1 处)。 | ||
实现位于 <code | 实现位于 <code>LuaFnTbl_MissionTable.h</code> 第 651 行,注册表第 161 行。 | ||
== 参数 == | == 参数 == | ||
{| 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></span> | |||
|- | |- | ||
| 2 | |||
| <code>duologueIndex</code><br /><span class="lua-muted"><code>number</code></span> | |||
| 对话配置索引。<br /><span class="lua-muted">脚本中的实参:<code>duologueList[random( getn(duologueList) )]</code></span> | |||
|} | |} | ||
== 返回值 == | == 返回值 == | ||
返回 1 个值。返回类型包括 <code | 返回 1 个值。返回类型包括 <code>string</code>、<code>number</code>。明确的固定返回组合包括 <code>-1</code>。 | ||
== 脚本中的调用 == | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 1 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | 以下是服务端脚本里的真实调用点,按实参形态去重后列出 1 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | ||
<pre | <pre>-- event/EventScript/mod_event.lua | ||
TGetDuologue(sceneId, duologueList[random( getn(duologueList) )])</pre> | TGetDuologue(sceneId, duologueList[random( getn(duologueList) )])</pre> | ||
</div> | </div> | ||
2026年9月19日 (六) 16:54的版本
按对白索引返回 StorytellingDuologue.txt 中的完整文本。
Lua 调用
TGetDuologue(sceneId, duologueIndex)
服务端脚本中共出现 1 处调用,实参个数出现过:2 个(1 处)。
实现位于 LuaFnTbl_MissionTable.h 第 651 行,注册表第 161 行。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId
|
| 2 | duologueIndexnumber
|
对话配置索引。 脚本中的实参: duologueList[random( getn(duologueList) )]
|
返回值
返回 1 个值。返回类型包括 string、number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 1 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/EventScript/mod_event.lua TGetDuologue(sceneId, duologueList[random( getn(duologueList) )])