How ntcd-lol/pse-lua works
PSE SDK Lua embeds Lua 5.4 and provides a Fluent Lua interface to Portal Solver Editor (PSE), with an offline mock mode. The main workflow is to start the host, load the Lua SDK, issue game or object commands, and receive results or events through the bridge. The repository also documents game control, player and third-party objects, events, registers, and REPL/mock initialization. These capabilities are represented, but their internal Lua call paths are not asserted: the Lua SDK sources were not excerpted. The graph distinguishes the documented workflow from source-confirmed bridge behavior.
Main entry points: api.lua Fluent API · lua_core.cpp Core Lua bridge · main.cpp Interpreter host · init.lua SDK initialization
Components 19
Lua host
- Interpreter host
src/main.cpp - Core Lua bridge
src/lua_core.cpp
Lua SDK
- SDK initialization
lua/sdk/init.lua - Fluent API
lua/sdk/api.lua - Schemas
lua/sdk/schema.lua - Command packing
lua/sdk/pack.lua - Enums
lua/sdk/enums.lua - Logging
lua/sdk/logger.lua - SDK core
lua/sdk/core.lua - Register API
lua/sdk/registers.lua
PSE connection
- Mock world
src/lua_core.cpp - Shared-memory bridge
src/pse_bridge.cpp - PSE SDK
third_party/pse-sdk
SDK capabilities
- Game control
docs/game.md - Game objects
docs/objects - Events
docs/events.md - Registers
docs/registers.md
Other components
- Script author
- Portal Solver
Connections 13
- Script author → Interpreter host: runs script
README.md - Interpreter host → SDK initialization: loads SDK
src/main.cpp - Interpreter host → Core Lua bridge: registers core
src/main.cpp - SDK initialization → Fluent API: provides API
- Fluent API → Game control: controls
- Fluent API → Game objects: builds objects
- Fluent API → Events: handles events
- Fluent API → Registers: accesses registers
- Core Lua bridge → Shared-memory bridge: sends commands
src/lua_core.cpp - Core Lua bridge → Mock world: simulates commands
src/lua_core.cpp - Shared-memory bridge → PSE SDK: uses buffers
src/pse_bridge.cpp - PSE SDK → Portal Solver: shares data
README.md - Core Lua bridge → Portal Solver: exchanges commands