Lua接口/服务端/LuaFnGetCopyScene HumanObjId:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的2个中间版本) | |||
| 第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>LuaFnGetCopyScene_HumanObjId(sceneId, uIndex)</pre> | ||
服务端脚本中共出现 336 处调用,实参个数出现过:2 个(336 处)。 | 服务端脚本中共出现 336 处调用,实参个数出现过:2 个(336 处)。 | ||
实现位于 <code | 实现位于 <code>LuaFnTbl_Scene.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>(336 处)</span> | |||
|- | |- | ||
| 2 | |||
| <code>uIndex</code><br /><span class="lua-muted"><code>number</code></span> | |||
| 索引,uint 最大可以到32<br /><span class="lua-muted">脚本中的实参:<code>i</code>(319 处)、<code>0</code>(11 处)、<code>rPlayerIndex</code>(2 处)</span> | |||
|} | |} | ||
== 返回值 == | == 返回值 == | ||
返回 1 个值。返回类型包括 <code | 返回 1 个值。返回类型包括 <code>number</code>。明确的固定返回组合包括 <code>-1</code>。 | ||
== 脚本中的调用 == | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 7 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | 以下是服务端脚本里的真实调用点,按实参形态去重后列出 7 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | ||
<pre | <pre>-- event/challenge/edali_challenge.lua | ||
LuaFnGetCopyScene_HumanObjId(sceneId, i) | LuaFnGetCopyScene_HumanObjId(sceneId, i) | ||
2026年9月20日 (日) 00:14的最新版本
读取场景参数信息
Lua 调用
LuaFnGetCopyScene_HumanObjId(sceneId, uIndex)
服务端脚本中共出现 336 处调用,实参个数出现过:2 个(336 处)。
实现位于 LuaFnTbl_Scene.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(336 处)
|
| 2 | uIndexnumber
|
索引,uint 最大可以到32 脚本中的实参: i(319 处)、0(11 处)、rPlayerIndex(2 处)
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 7 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/challenge/edali_challenge.lua LuaFnGetCopyScene_HumanObjId(sceneId, i) -- event/city/ecity_0602military.lua LuaFnGetCopyScene_HumanObjId(sceneId, 0) -- event/fuben/efuben_1_zhenlong_huodong.lua LuaFnGetCopyScene_HumanObjId(sceneId, k) -- event/huodong/GodOfFire_Lighten.lua LuaFnGetCopyScene_HumanObjId(sceneId, j) -- event/yanziwu/yanziwu_1.lua LuaFnGetCopyScene_HumanObjId(sceneId, nRand) -- obj/city/protect_guild_monster_shangui.lua LuaFnGetCopyScene_HumanObjId(sceneId, rPlayerIndex) -- obj/city/protect_guild_monster_shanshen.lua LuaFnGetCopyScene_HumanObjId(sceneId, ind)