Repository navigation
feat(framework): the Lua API declared once, require and api_version - #25
Merged
Merged
Conversation
lua/meta/mhfu.d.lua declares every binding; tools/lua_api.py renders the registered table from it, and -Werror=missing-declarations makes the two sides fail the build when they disagree. require reads mods/lib/ and reloads a changed library in place; boot lines are written after the script load. Freecam's bindings leave the API until it is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mod does `local port = require("mhfu_port")` and `port.mod(name, fn)`,
which runs its setup at once; the mhfu.port global and the queue
bootstrap are gone. It refuses to load below api_version 1, and takes the
player entity, the species table and its struct offsets from mhfu.addr.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An action override on the executor, a second Tigrex through the ADD path, and a ported Brute on mhfu_port, each tested in lupa against the declared API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mhfu.d.lua declares params, returns and one doc line per binding, with classes for the event contexts and em_status/em_rule tables. The prelude annotates its handles where the code lives (mhfu is a partial class there, so no inject-field). Binding comments in lua_host point at the declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efuses Live, the manifest's charge (2,8) bounced to (0,1) within a tick when requested, and (1,4) parked in its last phase, so the example no longer scripts a move; it shows the port loading and a brain that reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For sp00ktober/MHFU-ModKit#66.
lua/meta/mhfu.d.lua(---@meta), covers the 80 bindings, their constants, and the types of the event contexts andem_*tables, each with a doc line.tools/lua_api.pyrenders the registered table from it. Drift fails the build:-Werror=missing-declarations);static_asserted against its C name..luarc.jsonat the root (Lua 5.4, no io/os/debug). The prelude is annotated in place and embedded with its annotation lines blanked. A new CI job runs a pinnedlua-language-server --checkover all shipped Lua.require: Lua's package library with one searcher, formods/lib/<name>.lua; C loading and path search are removed.mhfu.api_versionis 1 and logged onVM ready.lua/lib/:_prelude.lua, andmhfu_port.lua, now a library (port = require("mhfu_port"); the_queueglobal is gone);lua/tools/:cli_bridge.lua;lua/examples/: action override, second monster, ported Brute.framework.logwithout entering a quest.Documented as they are, not fixed here:
mhfu.player_posreturns the camera eye;Test plan
uv run pytest,pre-commit run --all-files, cleanmake -C framework, LuaLS cleanapi=1appears onVM ready;framework.logwhile in the village;mhfu_portloads throughrequireand hot-reloads;🤖 Generated with Claude Code