Engine Specific API
Unreal Engine Helpers (unreal_engine)
unreal_engine)The unreal_engine table contains helpers for working with Unreal Engine games (UE4 / UE5).
unreal_engine.read_tarray
unreal_engine.read_tarrayunreal_engine.read_tarray(proc, tarray_address[, max_count]) -> tableReads an Unreal-style dynamic array (TArray) and returns its contents as a Lua array of pointers.
Parameters
procProcess object used for reading game memory.tarray_addressInteger address of the array in game memory.max_count(optional, default: 4096) Maximum number of elements to read. Used as a safety limit.
Returns
A Lua array table indexed from
1upward, containing integer addresses (pointers).If anything is invalid (bad address, null pointer, weird count), an empty table is returned.
Example
local actors = unreal_engine.read_tarray(proc, actors_array_addr, 1024)
for i, actor_ptr in ipairs(actors) do
-- actor_ptr is an integer address inside the game
endunreal_engine.read_minimal_view_info
unreal_engine.read_minimal_view_infounreal_engine.read_minimal_view_info(proc, view_info_address) -> tableReads a camera/view structure and converts it into a normalized Lua table.
Parameters
procProcess object.view_info_addressAddress of the camera/view information in memory.
Returns
A table with this structure:
{
location = { x = number, y = number, z = number },
rotation = { pitch = number, yaw = number, roll = number },
fov = number
}If the address or process is invalid, an empty table is returned.
Example
local view = unreal_engine.read_minimal_view_info(proc, camera_addr)
if view.fov then
local s = unreal_engine.world_to_screen({ x = 0, y = 0, z = 200 }, view)
-- ...
endunreal_engine.read_minimal_view_info_f64
unreal_engine.read_minimal_view_info_f64unreal_engine.read_minimal_view_info_f64(proc, view_info_address) -> tableSame purpose as read_minimal_view_info, but for layouts that use double-precision values (common in some UE5 setups).
Parameters
procProcess object.view_info_addressAddress of the camera/view information in memory.
Returns
Same shape as the float version:
{
location = { x = number, y = number, z = number },
rotation = { pitch = number, yaw = number, roll = number },
fov = number
}If inputs are invalid, returns an empty table.
Example
-- Example when you know the game uses a double-precision view structure:
local view = unreal_engine.read_minimal_view_info_f64(proc, view_addr)
local screen = unreal_engine.world_to_screen({ x = 1000, y = 500, z = 150 }, view)unreal_engine.world_to_screen
unreal_engine.world_to_screenunreal_engine.world_to_screen(world_position, view_info) -> table | nilProjects a point from world space to screen space using camera data.
Parameters
world_positionCan be either:A table:
{ x = number, y = number, z = number }, orThree numbers:
x, y, z
view_infoThe camera table returned from:unreal_engine.read_minimal_view_info, orunreal_engine.read_minimal_view_info_f64
Must contain:
view_info = { location = { x, y, z }, rotation = { pitch, yaw, roll }, fov = number }
Returns
On success (point is in front of the camera):
{ x = number, -- screen X (pixels) y = number, -- screen Y (pixels) visible = true }If the point is behind the camera:
nil.If input is invalid: a Lua error is raised.
Example
local view = unreal_engine.read_minimal_view_info(proc, camera_addr)
local pos = { x = enemy.x, y = enemy.y, z = enemy.z + 80 }
local screen = unreal_engine.world_to_screen(pos, view)
if screen and screen.visible then
-- draw box, text, etc. at screen.x, screen.y
endSource 2 Helpers (source2)
source2)The source2 table contains helpers for working with Source 2 games.
source2.world_to_screen
source2.world_to_screensource2.world_to_screen(world_position, view_matrix16) -> table | nilProjects a world-space point using a 4×4 row-major view-projection matrix.
Parameters
world_positionEither:Table
{ x = number, y = number, z = number }, orThree numbers:
x, y, z
view_matrix16A Lua array with 16 numeric values:local m = { m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33 }The matrix should be the combined view-projection matrix for the current camera.
Returns
On success:
{ x = number, y = number, visible = true }If the point is behind the camera:
nil.If
view_matrix16does not contain at least 16 numbers: a Lua error is raised.
Example
local world_pos = { x = 100.0, y = 200.0, z = 50.0 }
local screen = source2.world_to_screen(world_pos, view_matrix)
if screen and screen.visible then
-- draw overlay at screen.x, screen.y
endFortnite Helper
A small helper for reading player names in Fortnite.
fortnite_get_player_name
fortnite_get_player_namefortnite_get_player_name(proc, address) -> stringAttempts to read and decode a player name from game memory.
Parameters
procProcess object.addressAddress pointing to a name-related structure in Fortnite.
Returns
The player name as a string on success.
An empty string
""if:The process is invalid,
The memory cannot be read safely,
The decoded name is empty.
Example
local name = fortnite_get_player_name(proc, name_struct_addr)
if name ~= "" then
print("Player name:", name)
endRust Helper
A helper for getting world-space transform positions in Rust (Unity).
rust_get_transform_position
rust_get_transform_positionrust_get_transform_position(proc, address) -> x, y, zResolves the world-space position of a Unity transform hierarchy used by Rust.
Parameters
procProcess object.addressAddress of a transform-related structure for a given entity.
Returns
On success: three numbers
x, y, z(Lua returns them as multiple values).On failure (invalid process, invalid address, or any internal error):
0, 0, 0.
Example
local x, y, z = rust_get_transform_position(proc, transform_addr)
if x ~= 0 or y ~= 0 or z ~= 0 then
local screen = unreal_engine.world_to_screen({ x = x, y = y, z = z }, view_info)
if screen and screen.visible then
-- draw marker on that entity
end
endLast updated