Bitfighter  021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
LevelGenerator Class Reference

Supervisor class of a levelgen with various utilities.

Member Functions

announce(message)
 Broadcast an announcement.
 
globalMsg(message)
 Broadcast a message to all players. [details]
 
privateMsg(message, playerName)
 Broadcast a private message to a player. [details]
 
setGameTime(timeInMinutes)
 Sets the time remaining in the current game to the specified value. [details]
 
subscribe(event)
 Let the level listen for and respond to the specified event. [details]
 
teamMsg(message, teamIndex)
 Broadcast a message to players of a team. [details]
 
unsubscribe(event)
 Stop listening for the specified event. [details]
 

Detailed Description

Supervisor class of a levelgen with various utilities.

Member Function Documentation

◆ announce(message)

Arg types: message: string  |  returns nothing

Broadcast an announcement.

Parameters
messageMessage to broadcast.

◆ globalMsg(message)

Arg types: message: string  |  returns nothing

Broadcast a message to all players.

Parameters
messageMessage to broadcast.

◆ privateMsg(message, playerName)

Arg types: message: string, playerName: string  |  returns nothing

Broadcast a private message to a player.

Parameters
messageMessage to broadcast.
playerNameName of player to which to send a message.

◆ setGameTime(timeInMinutes)

Arg types: timeInMinutes: num  |  returns nothing

Sets the time remaining in the current game to the specified value.

Decimals can be used to specify fractions of minutes. A value of 0 will set the game time to unlimited

Parameters
timeInMinutesTime, in minutes, that the game should continue. Can be fractional.

◆ subscribe(event)

Arg types: event: Event  |  returns nothing

Let the level listen for and respond to the specified event.

When the specified event is fired, the level can respond by implementing a specially named listener function. See Subscribing to Events for more information. See also the Event page for a list of events you can subscribe to and their corresponding listener funtcitons.

Parameters
eventEvent to subscribe to.

◆ teamMsg(message, teamIndex)

Arg types: message: string, teamIndex: num  |  returns nothing

Broadcast a message to players of a team.

Parameters
messageMessage to broadcast.
teamIndexIndex of team to which to send a message.

◆ unsubscribe(event)

Arg types: event: Event  |  returns nothing

Stop listening for the specified event.

After unsubscribing from the event, the corresponding listener function will no longer be called when the event is fired.

Parameters
eventEvent to unsubscribe from.