Overview
GrandMA2 plugins consist of two files that work together: a.lua file containing the code and an .xml file that registers the plugin with the console. This guide covers the complete installation process.
Plugin File Structure
XML File Format
Every MA2 plugin requires an XML file that follows the GrandMA2 schema:Key XML Attributes
index
index
The plugin slot number (1-1000). Each plugin needs a unique index in your showfile.
execute_on_load
execute_on_load
Controls whether the plugin runs automatically when the showfile loads:
0= Manual execution only (recommended)1= Auto-execute on showfile load
luafile
luafile
The filename of the associated Lua script (must match exactly).
name
name
The display name shown in the plugin pool.
Installation Methods
Prepare the Files
Ensure you have both files:
PluginName.lua- The Lua scriptPluginName.xml- The XML descriptor
The
luafile attribute in the XML must exactly match the .lua filename.Access the Plugin Path
On GrandMA2, the plugin directory location is stored in the system variable Typical paths:
PLUGINPATH.- Internal Drive:
gma2/plugins/ - USB Drive:
/media/usb0/plugins/
Copy Files to Console
- USB Transfer (Recommended)
- Network Transfer
- Session Transfer
- Copy both
.luaand.xmlfiles to a USB drive - Insert USB into the console
- Navigate to the USB drive in the console file browser
- Select files and copy to internal drive plugin directory
Programmatic Plugin Creation
Plugins can create other plugins dynamically. Here’s the pattern from the source code:File Locations Reference
| System Variable | Purpose | Typical Path |
|---|---|---|
PLUGINPATH | Plugin storage | /gma2/plugins/ |
PATH | Showfile path | /gma2/showdata/shows/ |
| Import/Export | Temporary files | [PATH]/importexport/ |
Accessing Paths in Code
Common Installation Issues
Plugin Not Appearing After Import
Plugin Not Appearing After Import
Possible Causes:
- XML filename doesn’t match import command
- Files not in correct directory
- XML syntax error
- Verify both files exist in
PLUGINPATH - Check XML file for syntax errors
- Ensure
luafileattribute matches .lua filename exactly
Plugin Executes But Does Nothing
Plugin Executes But Does Nothing
Possible Causes:
- Lua file not found
- Lua syntax errors
- Return statement missing
- Check that .lua file exists and has correct name
- View system messages for Lua errors
- Ensure plugin returns its main function:
Overwriting Existing Plugins
Overwriting Existing Plugins
Issue: Importing to an index that’s already in useSolution:
- Check plugin pool before importing
- Choose an unused index
- Or deliberately overwrite to update a plugin
Drive Selection
Always select the correct drive before importing:Drive selection is critical for programmatic imports. The console looks for files on the currently selected drive.
Best Practices
- Use Descriptive Names: Make plugin names clear and specific
- Document Index Usage: Keep track of which plugin uses which index
- Version Control: Include version info in plugin feedback messages
- Test Before Deploying: Always test on a backup showfile first
- Backup Originals: Keep copies of .lua and .xml files externally
- Avoid Auto-Execute: Set
execute_on_load="0"unless absolutely necessary