LuxSDK Map Generator Info
Contained herein is all the info you need to write a map generator plugin for Lux.
The LuxMapGenerator Interface
Lux is written in Java, and each MapGenerator is just a class that implements the LuxMapGenerator interface. The interface comes with comments, and should probably be the first thing you examine. You can have the source or javadoc.
If you are unfamiliar with java interfaces, it is basically just a list of function prototypes. To write a class that implements the interface, you just fill in the code for all of the prototypes.
The MapLoader class
Other then the LuxMapGenerator interface, MapGenerators have to know about the MapLoader class. It contains some functions that your MapGenerator can use. You can see the javadoc or stub of this class.
Examples
- RandomMapGenerator (javadoc or source) is the class that Lux uses to create the built-in tiny-huge maps. AKA the "potato-shape" generator.
- ExternalMapGenerator is a class that delegates all of the work to the accompanying perl script 'luxmap.pl'. You must make sure that the script is executable for it to work (chmod 755 luxmap.pl)
- CastleInfinity, HexInfinity, and IslandInfinity are map generators written by Greg Mcglynns.
To Compile
In order to compile your LuxMapGenerator class, you must have a java compiler on your computer. The SDK comes with an apache ant build file that you can use, or you can copy the src files into your preferred IDE.
Installing
Once you have finished writing a MapGenerator, place your compiled .class file into ~/Library/Application Support/Lux/MapGenerators/ (for Mac OS X users) or into the Support/MapGenerators/ folder where you installed Lux (i.e. C:/Program Files/Lux/Support/MapGenerators/). Your MapGenerator choices should now appear in the map selection menu the next time you run Lux.
Thank You
If you have any questions/comments please let me know.
Your friend in world domination,
Dustin Quasar Sacks
dustin@sillysoft.net