Lua plug-in API¶
The Lua API is exposed under the hyperion global. Most functions are safe and return nil or default values instead of throwing; if a callback throws, the error is caught and logged without crashing.
Types and conventions¶
Vec2andVec3are math types with methods likelength()anddistance().RGBAis a color type withr,g,b,afields and helper methods.- UI inputs commonly return a table:
{ value = <newValue>, changed = <bool> }. - Source2 objects (player, controller, weapon, entity) should be checked with
isValid()before use.
API sections¶
- Core: logging and version
- Math: vectors and math helpers
- Color: color creation and utilities
- Draw: overlay rendering
- UI: menu widgets and layout
- Source2: game entities and data access
- Globals: timing and local player state