Skip to content

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

  • Vec2 and Vec3 are math types with methods like length() and distance().
  • RGBA is a color type with r, g, b, a fields 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