--- title: X4 types, results and methods summary: Lua, LuaJIT FFI, identifiers and MD: values accepted and returned by code. 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"] --- ## Types Types and methods refer to Lua 5.1 / LuaJIT and X4 layers, rather than other games. XML attribute types have a [separate XSD schema reference](wiki:schema-types). - [string - Strings](wiki:type-string) - [number - Numbers](wiki:type-number) - [boolean - Booleans](wiki:type-boolean) - [table - Tables and methods](wiki:type-table) - [function - Functions and callbacks](wiki:type-function) - [nil - Missing values](wiki:type-nil) - [cdata - C values and FFI](wiki:type-cdata) - [userdata - Opaque objects](wiki:type-userdata) - [thread - Coroutines](wiki:type-thread) - [ids - X4 identifiers](wiki:type-ids) - [md-values - Mission Director values](wiki:type-md-values) - [results - any, unknown, none and multiple results](wiki:type-results)