Commit Graph

4 Commits

Author SHA1 Message Date
68a13c4d5e 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>
2026-11-27 12:17:56 -05:00
4fc6d11141 Teleport page and leonida.teleport work through the player hook when a position is known
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 02:45:50 -05:00
58e1f3c272 leonida-lua: a test runs the example mod; the README row
What: a test copies mods/example_lua enabled into a temporary folder and drives it
on the fake host: its page (toggle, number, two actions), the overlay line, F9
turning it off, the menu callbacks, the menu_open event. d3d12/README.md gets the
row for the Lua mods that the last commit left out.
How checked: cargo test -p leonida-lua --lib (35 passed); cargo test -p
leonida-menu --lib (47 passed). AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:11:50 -05:00
581440a319 Lua mods: an example mod, the docs, and the mod manager lists them
What: mods/example_lua (mod.json disabled by default, main.lua: a frame-rate and
time line in the lower left, a page in the F4 menu with a toggle, a number and two
actions, an F9 key handler); docs/lua-modding.md (the API reference, the sandbox
rules, what is not available and why, what was not tried), pointers in
docs/README.md, docs/mod-menu.md, docs/modding.md and a row in d3d12/README.md.
tools/leonida_mods.py reads "script": it must be a .lua path inside the folder, the
list shows `Lua main.lua`, the JSON report has "script", and a Lua mod no longer
warns that it has no archetype_swaps.
Why: a Lua mod is mods\<name>\mod.json plus a script, so the manager that lists the
asset mods should list these too, and a mod author needs the reference.
How checked: python -I tests/test_leonida_mods.py (13 tests, 3 new, pass; the one
failure, test_run_print_builds_gta6rt_command, fails the same on the base: no gta6rt
build here). The example's script was not run in the title. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:11:50 -05:00