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

来自天龙知识库
跳到导航跳到搜索
雪舞​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
雪舞​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
第4行: 第4行:


<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">请求 World 将玩家传送到指定城市场景坐标。</div>
<div style="padding:14px 0;border-top:3px solid #287568;border-bottom:1px solid #dbe3e6;">请求 World 将玩家传送到指定城市场景坐标。</div>
<div style="margin:10px 0;padding:10px 12px;border-left:3px solid #9a7940;background:#faf7f0;font-size:13px;color:#5f5136;">本页由服务端绑定源码与随包脚本自动整理:用途、参数位置与返回数量取实现体,<b>未在游戏内执行验证</b>。调用点取自 4244 个服务端脚本中的 216 处真实调用。</div>


== Lua 调用 ==
== Lua 调用 ==
第11行: 第9行:


服务端脚本中共出现 216 处调用,实参个数出现过:5 个(216 处)。
服务端脚本中共出现 216 处调用,实参个数出现过:5 个(216 处)。
实现位于 <code style="white-space:normal;overflow-wrap:anywhere;">LuaFnTbl_City.h</code> 第 1186 行,注册表第 1003 行。


== 参数 ==
== 参数 ==
第70行: 第70行:
== 注意事项 ==
== 注意事项 ==
* 调用对象必须是当前场景中的有效玩家。
* 调用对象必须是当前场景中的有效玩家。
<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_City.h</code> 第 1186 行,服务端注册表第 1003 行。调用格式与返回数量依据当前实现整理;脚本调用点取自 4244 个随包脚本(共 535888 行、命中 85384 处调用),未经运行验证。游戏内效果、边界行为及未注明的业务枚举仍需实测。</div>


</div>
</div>

2026年9月19日 (六) 13:27的版本

首页 · 服务端接口 · 帮会城市 · 调用约定

请求 World 将玩家传送到指定城市场景坐标。

Lua 调用

CityMoveToScene(sceneId, selfId, targetSceneId, posX, posZ)

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

实现位于 LuaFnTbl_City.h 第 1186 行,注册表第 1003 行。

参数

序号 参数 / 类型 说明
1 sceneId
number
当前调用所在的场景 ID。
脚本中的实参:sceneId(216 处)
2 selfId
number
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。
脚本中的实参:selfId(216 处)
3 targetSceneId
number
目标场景编号。
脚本中的实参:x018030_g_city0、x018030_g_city1、x018030_g_city2
4 posX
number
场景平面 X 坐标。
脚本中的实参:99(216 处)
5 posZ
number
场景平面 Z 坐标。
脚本中的实参:152(216 处)

返回值

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

脚本中的调用

以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。

-- obj/cangshan/ocangshan_chuansong_1.lua
CityMoveToScene(sceneId, selfId, x025030_g_city0, 99, 152)

-- obj/cangshan/ocangshan_chuansong_1.lua
CityMoveToScene(sceneId, selfId, x025030_g_city1, 99, 152)

-- obj/cangshan/ocangshan_chuansong_1.lua
CityMoveToScene(sceneId, selfId, x025030_g_city2, 99, 152)

-- obj/cangshan/ocangshan_chuansong_1.lua
CityMoveToScene(sceneId, selfId, x025030_g_city3, 99, 152)

-- obj/cangshan/ocangshan_chuansong_2.lua
CityMoveToScene(sceneId, selfId, x025031_g_city0, 99, 152)

-- obj/cangshan/ocangshan_chuansong_2.lua
CityMoveToScene(sceneId, selfId, x025031_g_city1, 99, 152)

-- obj/cangshan/ocangshan_chuansong_2.lua
CityMoveToScene(sceneId, selfId, x025031_g_city2, 99, 152)

-- obj/cangshan/ocangshan_chuansong_2.lua
CityMoveToScene(sceneId, selfId, x025031_g_city3, 99, 152)

注意事项

  • 调用对象必须是当前场景中的有效玩家。