Engine
engine.iprint
Shared
Prints a human-readable representation of any value on engine's console
Syntax
local status = engine.iprint(value, show_hidden = false, depth_limit = 0)Parameters
| Type | Name | Description |
|---|---|---|
any | value | Value to print on console |
bool | show_hidden | Determines inspection depth: • When true - includes hidden elements such as metatables in the output• When false - displays only visible table contents |
int | depth_limit | Maximum nesting depth to display (0 = unlimited) |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, or false on failure |
Examples
local t = {a = 1, b = 2, c = 3}
engine.iprint(t)
--[[
Output:
{
a: 1
b: 2
c: 3
}
]]local colors = {"red", "green", "blue"}
engine.iprint(colors)
--[[
Output:
{
1: 'red'
2: 'green'
3: 'blue'
}
]]local deep = {a = {b = {c = {d = 1}}}}
engine.iprint(deep, false, 2) --Shows only 2 levels deeplocal config = {width = 800, height = 600}
engine.iprint(config) --Quick way to see table contents--Print string
engine.iprint("hello world") --'hello world'
--Print number
engine.iprint(42) --42local t = {x = 10}
setmetatable(t, {__tostring = function() return "custom" end})
engine.iprint(t, true) --Shows metatable when show_hidden = truelocal t = {x = 1, y = 2} --Better than tostring for tables
engine.print(tostring(t)) --'table: 0x...'
engine.iprint(t) --Readable format