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 be printed 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 | Returns true on successful execution, or false on failure |
Examples
--Print simple table
local t = {a = 1, b = 2, c = 3}
engine.iprint(t)
--Output:
--{
-- a: 1
-- b: 2
-- c: 3
--}--Print array
local colors = {"red", "green", "blue"}
engine.iprint(colors)
--Output:
--{
-- 1: "red"
-- 2: "green"
-- 3: "blue"
--}--Print with depth limit
local deep = {a = {b = {c = {d = 1}}}}
engine.iprint(deep, false, 2)
--Shows only 2 levels deep--Debug variable
local 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) --42--Print with metatable visible
local t = {x = 10}
setmetatable(t, {__tostring = function() return "custom" end})
engine.iprint(t, true)
--Shows metatable when show_hidden = true--Print empty table
local empty = {}
engine.iprint(empty) --{}--Better than tostring for tables
local t = {x = 1, y = 2}
engine.print(tostring(t)) --table: 0x...
engine.iprint(t) --Readable format