upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/lua-modding.md
diff options
context:
space:
mode:
authorNotRexed <therealnothingfn@gmail.com>2026-11-27 12:17:56 -0500
committerNotRexed <therealnothingfn@gmail.com>2026-11-27 12:17:56 -0500
commit68a13c4d5e41d57477eb03d49729b5c49332b1bc (patch)
tree39894b290fcf71be7d980ddace65b2a1e5b3144c /docs/lua-modding.md
parentffccea85efd046173f08f8e82d6302def4320eaa (diff)
Trainer menu: game actions through the title's own cheat system (LEONIDA_GAME_ACTIONS=1)
The title has a cheat system of its own: a table of sixteen handlers without arguments, and the functions those call take plain arguments. Ten places in its code are found by short byte signatures (each once in the executable), which give the cheat dispatcher and table, the title's deferred call, the player's ped, the functions that set a ped's wanted level, the time of day and the forced weather type, and the globals they work on. The title's once-a-frame call of its cheat input function becomes a call of ours (a near stub, written before any title code runs); the menu only queues a request, and the hook hands the title's own deferred-call queue (the one its cheats go through) the work. Wanted level, clear, never wanted, hour, clock paused, sync with system, weather by name, freeze weather, the health cheat and the nine vehicle cheats are wired; the player's position and heading come from the ped itself. Moving the player, god mode and the rest still say why they are not there. Off unless LEONIDA_GAME_ACTIONS=1: built and unit-tested, not yet run in the title. LEONIDA_GAME_ACTIONS_RUN scripts commands for a test without the keyboard and logs to %TEMP%\leonida-actions. docs/mod-menu.md: how it was found, with counts; the 6,811 script command wrappers (each carries its own 64-bit hash) and what was tried to find the table that binds them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'docs/lua-modding.md')
-rw-r--r--docs/lua-modding.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/lua-modding.md b/docs/lua-modding.md
index 819250707..3231797ed 100644
--- a/docs/lua-modding.md
+++ b/docs/lua-modding.md
@@ -192,10 +192,11 @@ alone; a mod can have both. Load order is the folder names', sorted.
192 192
193- `leonida.teleport(x, y, z [, hold_seconds])` (true line, or nil and why) and `leonida.player_position()` (x, y, z) move 193- `leonida.teleport(x, y, z [, hold_seconds])` (true line, or nil and why) and `leonida.player_position()` (x, y, z) move
194 and read the player by memory, once the runtime knows where the player is (`docs/mod-menu.md`, "Teleport by memory"). 194 and read the player by memory, once the runtime knows where the player is (`docs/mod-menu.md`, "Teleport by memory").
195- God mode, wanted level, vehicles, weapons, weather, time of day: these are the title's own script 195- God mode, wanted level, vehicles, weapons, weather, time of day: there is no `leonida.player` and no
196 functions, which the runtime cannot call (no table of them was found in the executable, `docs/mod-menu.md`), so 196 `leonida.world` yet. With `LEONIDA_GAME_ACTIONS=1` the F4 menu does wanted level, time of day, weather and the
197 there is no `leonida.player` and no `leonida.world`. A mod that wants them has the memory API and has to find the 197 title's own cheats through the title's own code (`docs/mod-menu.md`, "Game actions"), and
198 addresses itself. 198 `leonida.player_position()` is the ped's own position then; that is not offered to mods until it has run in the
199 title. A mod that wants the rest has the memory API and has to find the addresses itself.
199- Anything online, any file outside the mod's folder, any process or library: not offered, on purpose. 200- Anything online, any file outside the mod's folder, any process or library: not offered, on purpose.
200- No keys, decryption or protection workarounds, and no game data in the repository: a mod holds its own script and 201- No keys, decryption or protection workarounds, and no game data in the repository: a mod holds its own script and
201 the addresses its author found, not pieces of the title. 202 the addresses its author found, not pieces of the title.