Skip to content

Engine natives ​

Installed into the client's Lua state by the injected engine. They exist only once the player is in the world, so guard on Nyx.Engine before calling them.

GUIDs are hex strings, never numbers: they are 64-bit and a Lua number is a double, so a numeric GUID would lose precision silently.

40 entry points, 35 documented.

Circle ​

lua
Nyx.Engine.Circle(x, y, radius, r, g, b, a)

Screen-space circle.

draw.cpp

Clear ​

lua
Nyx.Engine.Clear()

Drops every queued shape. Drawings persist until replaced.

draw.cpp

Line ​

lua
Nyx.Engine.Line(x1, y1, x2, y2, r, g, b, a)

Screen-space line in render pixels from the top-left. Prefer Nyx.Draw.Line.

draw.cpp

Rect ​

lua
Nyx.Engine.Rect(x, y, w, h, r, g, b, a, filled)

Screen-space rectangle. filled is 1 or 0.

draw.cpp

WorldCircle ​

lua
Nyx.Engine.WorldCircle(x, y, z, radius, r, g, b, a)

Horizontal ring at a world position. radius is in yards.

draw.cpp

WorldLine ​

lua
Nyx.Engine.WorldLine(x1, y1, z1, x2, y2, z2, r, g, b, a)

Line between two world positions, projected with the client camera.

draw.cpp

camdump ​

lua
Nyx.Engine.camdump([count]) -> array of floats straight from the camera struct, for

finding which field actually holds the field of view.

object_manager.cpp

camera ​

lua
Nyx.Engine.camera() -> table describing the client camera, plus the two runtime

checks that stand in for a static proof of its struct layout: it must sit near the player, and its 3x3 must be orthonormal.

object_manager.cpp

count ​

lua
Nyx.Engine.count() -> number

How many objects the client currently has in memory. Varies as things enter and leave visibility, which is how you know it is reading live data.

object_manager.cpp

dump ​

lua
Nyx.Engine.dump(guid, offset, count [, "object"]) -> array of 32-bit words.

Reads the descriptor block by default, or the object itself with "object". This is the tool for finding fields nobody has confirmed yet: snapshot, change something in game, snapshot again, and diff. It is how the fields above stopped being guesses, and it is deliberately generic so the next unknown does not need an engine change to chase.

object_manager.cpp

esp ​

lua
esp

UNDOCUMENTED

This exists but has no comment in the source yet.

engine

espcaps ​

lua
espcaps

UNDOCUMENTED

This exists but has no comment in the source yet.

engine

espedit ​

lua
espedit

UNDOCUMENTED

This exists but has no comment in the source yet.

engine

espmark ​

lua
espmark

UNDOCUMENTED

This exists but has no comment in the source yet.

engine

first ​

lua
Nyx.Engine.first() -> "guid/type"

The first object in the manager list, for checking the walk is alive.

object_manager.cpp

fovcal ​

lua
Nyx.Engine.fovcal(x, y, z, screenX, screenY) -> fovFromVertical, fovFromHorizontal

Given a world point and where it ACTUALLY appears on screen, solve for the field of view that would put it there. Two independent solutions fall out, one from each screen axis; they should agree, and agreeing is what says the answer is real rather than a fudge factor.

object_manager.cpp

guid ​

lua
Nyx.Engine.guid() -> hex string

The local player GUID. Falls back to the object manager, because the static global reads 0 on this client.

object_manager.cpp

key ​

lua
Nyx.Engine.key(vk) -> boolean or nil

true/false when the game window has focus (physically down / up). nil when the window does NOT have focus -- deliberately a third state, not false, because Lua cannot otherwise tell "unfocused" apart from "key was released": GetAsyncKeyState is global to the session, so without the focus test a bound key would fire while the player is alt-tabbed into another application, but collapsing that case to false made the edge detector in Menu/Input.lua see a spurious fresh press when focus returned with the key still physically held (alt-tab back while holding INSERT re-toggled the menu). nil carries the information false cannot: Poll() freezes its edge state on nil instead of treating it as a release.

This POLLS; it cannot consume the keypress. A key that is also bound in-game triggers both actions. That is why the default binding is INSERT, which 3.3.5a leaves unbound. See Menu/Input.lua for the Lua side (edge detection, the nil-freeze, the chat-focus guard, and the name-to-vk table) and script_hook.h for why this is a poll read by Lua rather than the engine calling into Lua.

object_manager.cpp

log ​

lua
Nyx.Engine.log(text)

Appends a line to nyx.log. Chat is not always available (loading screens, early login), the log always is.

object_manager.cpp

los ​

lua
Nyx.Engine.los(x1,y1,z1, x2,y2,z2 [, flags]) -> clear, hitX, hitY, hitZ, fraction

clear is true when nothing blocks the ray. The hit point and the fraction along the ray are returned too, which is what makes this usable for more than yes/no - ground height under a point, for instance.

object_manager.cpp

markWorldReady ​

lua
Nyx.Engine.markWorldReady()

Tells the engine the world is up. The bridge calls this itself; a script has no reason to.

object_manager.cpp

lua
menuCommit

Internal engine native used by the scoped plugin runtime to publish a validated menu snapshot. Authors must use plugin.menu:RegisterPage instead.

menu_bridge.cpp

lua
menuDrop

Internal engine native used by the runtime to release a plugin menu owner. It is not an author API.

menu_bridge.cpp

lua
menuEvents

Internal engine native used by the runtime to poll menu events. It is not an author API.

menu_bridge.cpp

lua
Nyx.Engine.menuShell() -> kind, value, or nil when nothing is pending

One intent per call, oldest first. Shell furniture -- the header's profile selector, the control panel -- raises these; see menu_shell.h for why they are not on the per-owner event wire.

object_manager.cpp

lua
Nyx.Engine.menuTheme(document) -> true, or nil + reason

Publishes the FrameXML menu's own theme tokens to the native renderer so the two implementations paint from one palette -- including an operator's menu.appearance.accent_color, which the renderer could not otherwise see. See menu_theme.h for the document's shape and why it is not carried on the versioned menu wire.

A rejected document leaves the last good theme published: a Lua typo must not repaint a working menu in fallback grey.

object_manager.cpp

lua
Nyx.Engine.menuWindow() -> width, height, reset, or nil when nothing changed

The native menu window's geometry on its way back to Lua, so menu.window.width/height persist the way Menu/Window.lua persists them. Nil on the overwhelming majority of ticks: this is polled every frame and only answers when the operator actually finished a resize or right-clicked the grip. See menu_window.h for why this is not on the event wire.

object_manager.cpp

mgrguid ​

lua
Nyx.Engine.mgrguid() -> hex string

The local player GUID as the object manager reports it. Should equal Nyx.Engine.guid().

object_manager.cpp

overlay ​

lua
Nyx.Engine.overlay(visible) -> boolean

Shows or hides the native ImGui proof window and returns its resulting visibility. Passing no value leaves the current state unchanged.

object_manager.cpp

plugins ​

lua
Nyx.Engine.plugins() -> { folder, ... }

Returns plugin folders that contain manifest.lua, sorted without regard to case for deterministic discovery. This only discovers candidates; Nyx.Plugins validates each manifest and contains plugin failures in Lua.

object_manager.cpp

readfile ​

lua
Nyx.Engine.readfile(path) -> source or nil, reason

Reads one Lua source file below the active External root. Both slash styles are accepted, but absolute paths, drive-qualified paths, parent-directory segments, and non-.lua files are refused before the filesystem is touched.

object_manager.cpp

reload ​

lua
Nyx.Engine.reload() — re-read the framework from disk after the current script call

returns. The whole point is editing a rotation without restarting the client.

object_manager.cpp

scan ​

lua
Nyx.Engine.scan(value) -> array of descriptor offsets whose 32-bit contents equal

value. Called with a number the client's own Lua API produced, it turns a guessed field offset into a checked one.

object_manager.cpp

setfov ​

lua
Nyx.Engine.setfov(radians) - override the vertical field of view used for

projection. 0 restores the camera's own field.

object_manager.cpp

target ​

lua
target

UNDOCUMENTED

This exists but has no comment in the source yet.

engine

unit ​

lua
Nyx.Engine.unit([guid]) -> table, or nil when the object is not in memory. Omitting

the guid returns the local player.

object_manager.cpp

units ​

lua
Nyx.Engine.units() -> array of unit tables, every unit and player the client has in

memory. Bounded so a capital city cannot produce an unbounded table.

object_manager.cpp

viewvec ​

lua
Nyx.Engine.viewvec(x, y, z) -> forward, right, up in camera space.

Exposes the dot products that projection is built on, without the field of view. That matters for calibration: the ORDER of units across the screen depends only on right/forward, not on the fov, so units can be matched to the client's own nameplates before the fov is known.

object_manager.cpp

w2s ​

lua
Nyx.Engine.w2s(x, y, z) -> screenX, screenY, onScreen. The projection the overlay

itself uses, exposed so scripts can anchor the client's own FontStrings and textures at world positions - which is how text and health bars get drawn without a font dependency in the engine.

object_manager.cpp

writefile ​

lua
Nyx.Engine.writefile(name, text) -> true on success

Writes one whitelisted file inside SettingsRoot() (NYX_SETTINGS_ROOT, or External/ as a fallback for a hand-run engine). The whitelist is the entire security model: Lua gets no path, no append, no read - settings.lua or nothing. Temp-then-rename so a crash mid-write cannot truncate settings.

object_manager.cpp

API reference generated from source.