-
Notifications
You must be signed in to change notification settings - Fork 0
Home
How to Lua is a Lua scripting framework for How to Fish. It loads mods from the BepInEx plugin directory and provides a restricted, host-aware API for gameplay events, player actions, world snapshots, commands, timers, shared rewards, chat and persistent data.
- Installation
- Creating a Mod
- Manifest Reference
- Lua API
- Events
- Examples
- Troubleshooting
- Player and World API
- Architecture
- Gameplay API
- Load and reload Lua mods without compiling C#.
- Register local-host chat commands and native action buttons.
- Subscribe to 50 events covering players, vitals, inventory, equipment, items, boats, NPC quests, economy, bosses, islands and server lifecycle.
- Use 79 functions: inspect catalogs, spawn ordinary item prefabs, manage bait/pockets, upgrade equipment/boats, change server rules and travel between islands, alongside player/world APIs.
- Schedule delayed and repeating callbacks.
- Broadcast chat, award shared money, and store per-mod string data.
- Declare dependencies by mod ID, with separate Lua states for each mod.
Open Pause > Lua Mods to inspect loaded scripts. Mods / Actions switches to registered buttons; Previous and Next change pages. The framework automatically loads valid mod folders unless AutoLoadMods is disabled in its BepInEx configuration.
The framework exposes restricted Lua globals. Scripts cannot access arbitrary CLR types, Harmony, or raw Unity game objects. Persistent data is available through a per-mod API.
This is beta 0.3.0. The expanded hooks and actions need in-game multiplayer testing. 405 automated checks cover Lua execution, examples, queue semantics, snapshots, API registrations and native contracts against the installed game DLL. Lua callbacks have an instruction limit but no hard memory quota or native-call CPU quota; use trusted scripts.
0.3.0 adds 59 functions and 23 events without changing the existing leading event arguments or native pause-menu styling. Source stays split into Runtime, Api, Game and UI modules. Spawning has shared rate/live-item limits and excludes protected prefabs. Custom network messages, arbitrary object editing, boss spawning, JSON persistence and version-range dependencies are not implemented.
Documentation describes the source plugin version 0.3.0, regardless of the version chosen in an individual Lua manifest. Source and examples live in the How to Lua repository. Measured direct game-method integration is 229/4,737 (4.83%), up from 41 (0.87%). This is not a claim of feature completeness or runtime testing; see the repository's generated coverage report for the exact method inventory and game DLL hash.
The MoonSharp compatibility fix from 0.1.1 remains included. Update both framework DLLs and restart the game; see Troubleshooting.