Bitfighter
021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
|
Static Member Functions | |
findFile(filename) | |
Finds a specific file to load from various Lua folders. | |
getMachineTime() | |
Get the time according to the system clock. | |
getRandomNumber(m, n) | |
Better random number generated than that included with Lua. [details] | |
getVersion() | |
Get the current Bitfighter version as a string. [details] | |
logprint(val) | |
Print to bitfighter's logging engine. [details] | |
print(val) | |
Print to the in-game console. [details] | |
readFromFile(filename) | |
Reads in a file from our sandboxed IO directory. [details] | |
writeToFile(filename, contents, append) | |
Write or append to a file on the filesystem. [details] | |
|
static |
Finds a specific file to load from various Lua folders.
Scans our scripts, levels, and robots directories for a file, in preparation for loading.
filename | The file you're looking for. |
|
static |
Get the time according to the system clock.
|
static |
Better random number generated than that included with Lua.
General structure and peculiar error messages taken from lua math lib. Docs for that are as follows; we should adhere to them as well:
This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.) When called without arguments, returns a uniform pseudo-random real number in the range [0,1). When called with an integer number m, math.random returns a uniform pseudo-random integer in the range [1, m]. When called with two integer numbers m and n, math.random returns a uniform pseudo-random integer in the range [m, n] where m, n is greater than or equal to 0.
m | (optional) Used for either [1, m] or [m, n] as described above. |
n | (optional) Used for [m, n] as described above. |
|
static |
Get the current Bitfighter version as a string.
|
static |
Print to bitfighter's logging engine.
This will (currently) print to the bitfighter log file as well as stdout.
val | The value you wish to print. |
|
static |
Print to the in-game console.
This hijacks Lua's normal 'print' command that goes to stdout and instead redirects it to the in-game console.
val | The value you wish to print. |
|
static |
Reads in a file from our sandboxed IO directory.
Reads an entire file from the filesystem into a string.
filename | The filename to read. |
screenshot
directory of the Bitfighter resource folder.
|
static |
Write or append to a file on the filesystem.
This is in a sandboxed environment and will only allow writing to a specific directory.
filename | The filename to write. |
contents | The contents to save to the file. |
append | (optional) If true , append to the file instead of creating a new one. |
screenshot
directory of the Bitfighter resource folder.