Overview
The Lua scripting feature provides:- Event-driven system - Hook into game events
- Game state access - Read and modify game data
- File I/O - Persistent data storage
- Custom commands - Create new console commands
- Map-specific scripts - Different behavior per map
- Global scripts - Always-loaded functionality
Lua scripting is ported from Chimera -572 and provides a comprehensive API for game modification.
Script Locations
Chimera loads scripts from specific directories:Script Types
- Global Scripts
- Map Scripts
- Embedded Scripts
Location:
chimera/lua/scripts/global/Behavior:- Loaded on game startup
- Remain loaded until game closes or manual reload
- Survive map changes
- Ideal for persistent features
- Custom HUD overlays
- Chat enhancements
- Statistics tracking
- Quality of life features
Directory Structure Setup
Chimera automatically creates the directory structure:If you have scripts in the old directory structure, Chimera will automatically migrate them to the new
scripts/ subdirectories.Basic Script Structure
Hello World Example
Event Callbacks
Scripts can register callbacks for game events:API Categories
The Lua API provides access to various game systems:Game State
Player Data
Object Manipulation
Console Output
File I/O
chimera/lua/
Custom Commands
Advanced Examples
Kill Counter
Map-Specific Welcome Message
Auto-Reload Script
Script Management
Reloading Scripts
Reload all scripts without restarting the game:This is useful during script development - make changes and reload without restarting Halo.
Listing Scripts
List all loaded scripts:Unloading Scripts
- When the game closes
- When manually reloaded
- Map scripts when changing maps
Security Considerations
Embedded Scripts
Why disabled?:- Scripts can execute arbitrary code
- Potential for malicious behavior
- Can access file system
- Can modify game state
Script Sandboxing
Chimera Lua scripts have access to:- ✅ Game data (read/write)
- ✅ File I/O (within
chimera/lua/directory) - ✅ Console commands
- ❌ System-level operations (blocked)
- ❌ Network access (blocked)
Performance Considerations
Callback Performance
Technical Implementation
Location:src/chimera/lua/
Initialization
Related Features
Commands
Lua-related console commands
File System
Understanding file paths
Custom Commands
Creating custom commands
Hotkeys
Bind Lua scripts to keys
Example Scripts Collection
Common script patterns:FPS Counter
FPS Counter
Position Logger
Position Logger
Chat Logger
Chat Logger
Getting Help
For Lua scripting support:- Check existing scripts in the community
- Refer to the Chimera Lua API documentation
- Ask on the Discord server
- Review example scripts in the repository
