Bitfighter
021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
|
Instantly transports ships from here to there.
Member Functions | |
Teleporter() | |
Constructor. | |
Teleporter(simpleLine) | |
Constructor. [details] | |
addDest(dest) | |
Adds a destination to the teleporter. [details] | |
clearDests() | |
Removes all destinations from the teleporter. [details] | |
delDest(index) | |
Removes a destination from the teleporter. [details] | |
getDelay() | |
getDest(index) | |
Returns the specified destination. [details] | |
getDestCount() | |
Returns the number of destinations this teleporter has. [details] | |
getEngineered() | |
getGeom() | |
Gets teleporter geometry; differs from standard conventions. [details] | |
getId() | |
Gets an object's user assigned id. [details] | |
getObjType() | |
Gets an object's ObjType. [details] | |
getOwner() | |
Gets an object's owner as a PlayerInfo. [details] | |
getPos() | |
Gets an object's position. [details] | |
getTeamIndex() | |
Gets the index of the object's team. [details] | |
isSelected() | |
Determine if an object is selected in the editor. [details] | |
removeFromGame() | |
Removes the object from the current game or editor session. [details] | |
setDelay(delay) | |
Sets the minimum cooldown delay in milliseconds, for when the next ship may enter this teleporter. [details] | |
setEngineered(engineered) | |
Sets whether the item can be destroyed when its health reaches zero. [details] | |
setGeom(simpleLine) | |
Sets teleporter geometry; differs from standard conventions. [details] | |
setId(id) | |
Sets an object's user assigned id. [details] | |
setOwner(playerName) | |
Sets the owner of the object. [details] | |
setPos(pos) | |
Set the object's position. [details] | |
setSelected(selected) | |
Set whether an object is selected in the editor. [details] | |
setTeam(teamIndex) | |
Assigns the object to a team. [details] | |
Instantly transports ships from here to there.
A Teleporter represents the basic teleporter object. Every teleporter has an intake location and one or more destinations. When a ship enters the teleporter, a destination will be chosen randomly if there is more than one.
returns Teleporter |
Arg types: simpleLine: Geom | returns Teleporter |
Constructor.
Example:
Note that teleporter geom is a strange beast and should be documented here!
Arg types: dest: point | returns nothing |
Adds a destination to the teleporter.
dest | A point or coordinate pair representing the location of the destination. |
Example:
returns nothing |
Removes all destinations from the teleporter.
Arg types: index: int | returns nothing |
Removes a destination from the teleporter.
index | The index of the destination to delete. If you specify an invalid index, will generate an error. |
returns bool |
This is the minimum time a ship must wait to use the teleporter after another ship has just entered
Arg types: index: int | returns point |
Returns the specified destination.
index | Index of the dest to return. Will generate an error if index is invalid. |
returns int |
Returns the number of destinations this teleporter has.
returns bool |
true
if the item can be destroyed, false
otherwise. returns Geom |
Gets teleporter geometry; differs from standard conventions.
In this case, geometry represents both Teleporter's location and those of all destinations. The first point in the Geom will be the teleporter's intake location. Each destination will be represented by an additional point. In the editor, all teleporters are simple lines, and will return geometries with two points – an origin and a destination.
|
inherited from BfObject |
Gets an object's user assigned id.
Users can assign an id to elements in the editor with the ! or # keys. Use this function to obtain this id. If the user has not assigned an object an id, getId() will return a negative id that will remain consistent throught the game.
|
inherited from BfObject |
Gets an object's ObjType.
See ObjType for a list of possible return values.
|
inherited from BfObject |
Gets an object's owner as a PlayerInfo.
Some objects (like projectiles) have an owning player associated. This method returns a PlayerInfo object if there is an owner. Otherwise, returns nil.
This method is intended to be used with bullets and other projectiles, not with game objects like zones.
|
inherited from BfObject |
Gets an object's position.
For objects that are not points (such as a LoadoutZone), will return the object's centroid.
|
inherited from BfObject |
Gets the index of the object's team.
Many BfObjects (such as TestItems) are never part of any particular team. For these objects, this method will return Team.Neutral
.
|
inherited from BfObject |
Determine if an object is selected in the editor.
This is useful for editor plugins only.
true
if the object is selected, false
if not.
|
inherited from BfObject |
Removes the object from the current game or editor session.
May not be implemented for all objects.
Arg types: delay: num | returns nothing |
Sets the minimum cooldown delay in milliseconds, for when the next ship may enter this teleporter.
delay | milliseconds to delay next teleporter usage. Example: 500 (1/2 second) |
Arg types: engineered: bool | returns nothing |
Sets whether the item can be destroyed when its health reaches zero.
engineered | true to make the item destructible, false to make it permanent. |
Arg types: simpleLine: Geom | returns nothing |
Sets teleporter geometry; differs from standard conventions.
In this case, geometry represents both Teleporter's location and those of all destinations. The first point specified will be used to set the location. If two or more points are supplied, all existing destinations will be deleted, and the remaining points will be used to define new destinations.
Note that in the editor, teleporters can only have a single destination. Since scripts can add or modify editor items, when the script has finished running, all affected teleporters will be converted into a series of single destination items, all having the same location but with different destinations. (In a game, multi-destination teleporters will remain as created.)
If the teleporter has no destinations, it will not be added to the editor.
geometry | New geometry for Teleporter. |
|
inherited from BfObject |
Sets an object's user assigned id.
Users can assign an id to elements in the editor with the ! or # keys. Use this function to set this id from Lua. When called from an editor plugin, the value passed will be displayed in the editor when the player presses ! or #.
|
inherited from BfObject |
Sets the owner of the object.
playerName | Name of player as a string. |
This method is intended to be used with bullets and other projectiles, not with game objects like zones.
|
inherited from BfObject |
Set the object's position.
To set the full geometry of a more complex object, see the setGeom() method.
pos | The new position of the object. |
|
inherited from BfObject |
Set whether an object is selected in the editor.
This is useful for editor plugins only.
selected | true to select the object, false to deselect it. |
|
inherited from BfObject |
Assigns the object to a team.
teamIndex | Index of the team the object should be assigned to. (first team index is 1; there is no team 0) |
Instead of a team index, you can use the special team enums Team.Neutral
and Team.Hostile
.
Limitations: