Difference between revisions of "Using a levelgen script"

From Bitfighter
 
Line 1: Line 1:
 
To include a levelgen script in a level, edit the level file, and insert a line like the following:
 
To include a levelgen script in a level, edit the level file, and insert a line like the following:
  
Script levelgen .lua [arg1] [arg2] [arg3] ...
+
Script scriptname.levelgen [arg1] [arg2] [arg3] ...
  
When the level is loaded, the script ''levelgen .lua'' will be run.  This script can the create level elements, as specified in the [[Programming levelgens]] section.  The optional arguments ''arg1'', ''arg2'', ''arg3'', etc. will be passed to the script, so the same levelgen script can be used in different ways by different levels.  
+
When the level is loaded, the script ''scriptname.levelgen'' will be run.  This script can then create level elements, as specified in the [[Programming levelgens]] section.  The optional arguments ''arg1'', ''arg2'', ''arg3'', etc. will be passed to the script, so the same levelgen script can be used in different ways by different levels.
  
 
Currently, Bitfighter assumes that the levelgen script is in the same folder as the level file that calls it.
 
Currently, Bitfighter assumes that the levelgen script is in the same folder as the level file that calls it.

Latest revision as of 17:15, 27 February 2013

To include a levelgen script in a level, edit the level file, and insert a line like the following:

Script scriptname.levelgen [arg1] [arg2] [arg3] ...

When the level is loaded, the script scriptname.levelgen will be run. This script can then create level elements, as specified in the Programming levelgens section. The optional arguments arg1, arg2, arg3, etc. will be passed to the script, so the same levelgen script can be used in different ways by different levels.

Currently, Bitfighter assumes that the levelgen script is in the same folder as the level file that calls it.