--- title: ids - X4 标识符 summary: UniverseID、ComponentID、Lua 组件引用和 UI 句柄不能互换。表示方式由 API 层决定。不要用指针地址代替 ID,也不要在转换为 number 时丢失 64 位 ID 的精度。 section: reference kind: guide status: reference updated: 2026-10-26 tags: ["API","X4"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/","https://www.lua.org/manual/5.1/manual.html","https://luajit.org/ext_ffi_api.html"] --- ## 含义 UniverseID、ComponentID、Lua 组件引用和 UI 句柄不能互换。表示方式由 API 层决定。不要用指针地址代替 ID,也不要在转换为 number 时丢失 64 位 ID 的精度。 ## 示例 ```lua -- Keep the representation required by the receiving API. -- Convert only through a documented engine conversion. ``` **运行效果:** 评论解释了一个规则; 这段段没有打印或写日志信息. 显示的值是示例的预期结果. ## 方法与相关调用 [API 参考](wiki:api-index).