Bitfighter
021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
|
Plugins run once when called, then exit. The main() function is called.
Since plugins do not linger after being called, they cannot subscribe to or respond to events.
Editor plugins can be used to extend the functionality of the editor, and to add new or experimental geometry manipulation functions.
When the user runs a plugin, the editor first tries to call a function called getArgsMenu(). If this function exists, it must return a table containing the menu name and the various items to be displayed on it. The values that the user enters for these items will be passed to the script in the arg table, Lua's structure for passing command line arguments to a script. If getArgsMenu() does not exist, the plugin will be run with no arguments.
Unlike levelgen and bot scripts, plugins do not respond to events, and often consist of only a main() function, and, if they require special inputs, a getArgsMenu() function.
The following is the getArgsMenu() function from the draw_arcs plugin, which can be found in Bitfighter's editor_plugins folder.