Module hyperwall
Functions for hyperwalls
Global functions
Hyperwall.all () | get an iterator over all hyperwalls in the game |
Hyperwall.create (name) | creates a new hyperwall (in a disabled state) |
Hyperwall.getFromId (id) | finds (or generates) any hyperwall by its UID |
Hyperwall.getFromName (name) | finds any hyperwall by name |
Class Hyperwall
hyperwall:addLabel (label) | adds a label to the hyperwall. |
hyperwall:delete () | deletes the hyperwall |
hyperwall:getEnd () | get the ending coordinates of the hyperwall |
hyperwall:getId () | get the UID of the hyperwall |
hyperwall:getMaxShipClass () | get the maximum ship class impacted by the hyperwall. |
hyperwall:getMinShipClass () | get the minimum ship class impacted by the hyperwall. |
hyperwall:getName () | get the name of the hyperwall |
hyperwall:getStart () | get the starting coordinates of the hyperwall |
hyperwall:hasLabel (label) | get whether the hyperwall has a label. |
hyperwall:isEnabled () | get whether a hyperwall is enabled. |
hyperwall:removeLabel (label) | removes a label from the hyperwall. |
hyperwall:setEnabled (enabled) | set whether a hyperwall is enabled. |
hyperwall:setEnd (xpos, ypos) | sets the ending coordinates of the hyperwall |
hyperwall:setMaxShipClass (maxShipClass) | set the maximum ship class blocked by the hyperwall. |
hyperwall:setMinShipClass (minShipClass) | set the minimum ship class blocked by the hyperwall. |
hyperwall:setName (name) | sets the name of the hyperwall |
hyperwall:setStart (xpos, ypos) | sets the starting coordinates of the hyperwall |
Global functions
- Hyperwall.all ()
-
get an iterator over all hyperwalls in the game
Returns:
-
an iterator of Hyperwall
Usage:
for wall in Hyperwall.all() do
- Hyperwall.create (name)
-
creates a new hyperwall (in a disabled state)
Parameters:
- name string the hyperwall name.
Returns:
-
Hyperwall
the hyperwall, or nil if it can't be created
- Hyperwall.getFromId (id)
-
finds (or generates) any hyperwall by its UID
Parameters:
- id integer the numeric UID
Returns:
-
Hyperwall
the hyperwall, or nil if not found
- Hyperwall.getFromName (name)
-
finds any hyperwall by name
Parameters:
- name string the hyperwall name.
Returns:
-
Hyperwall
the hyperwall, or nil if not found
Class Hyperwall
Functions on hyperwall variables
- hyperwall:addLabel (label)
-
adds a label to the hyperwall.
Parameters:
- label string the name of the label to add
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:delete ()
- deletes the hyperwall
- hyperwall:getEnd ()
-
get the ending coordinates of the hyperwall
Returns:
- integer the X coordinate of the ending system
- integer the Y coordinate of the ending system
Usage:
local x, y = hyperwall:getEnd() ch:echoAt("The system is at "..x..", "..y)
- hyperwall:getId ()
-
get the UID of the hyperwall
Returns:
-
integer
the UID of the hyperwall.
- hyperwall:getMaxShipClass ()
-
get the maximum ship class impacted by the hyperwall.
Uses the same class numbers as the
images
andsetship
commands: 0 = fighter, 1 = transport, etc. All hyperwalls default to 10 (satellites) as the largest impacted ships.Returns:
-
integer
the maximum ship class blocked by the hyperwall.
- hyperwall:getMinShipClass ()
-
get the minimum ship class impacted by the hyperwall.
Uses the same class numbers as the
images
andsetship
commands: 0 = fighter, 1 = transport, etc. All hyperwalls default to 0 (fighters) as the smallest impacted ships.Returns:
-
integer
the minimum ship class blocked by the hyperwall.
- hyperwall:getName ()
-
get the name of the hyperwall
Returns:
-
string
the name of the hyperwall.
- hyperwall:getStart ()
-
get the starting coordinates of the hyperwall
Returns:
- integer the X coordinate of the starting system
- integer the Y coordinate of the starting system
Usage:
local x, y = hyperwall:getStart() ch:echoAt("The system is at "..x..", "..y)
- hyperwall:hasLabel (label)
-
get whether the hyperwall has a label.
Parameters:
- label string the name of the label to check for
Returns:
-
boolean
true if label exists, false otherwise.
- hyperwall:isEnabled ()
-
get whether a hyperwall is enabled.
Returns:
-
boolean
true if enabled, false otherwise.
- hyperwall:removeLabel (label)
-
removes a label from the hyperwall.
Parameters:
- label string the name of the label to remove
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setEnabled (enabled)
-
set whether a hyperwall is enabled.
Parameters:
- enabled boolean whether to enable or disable the hyperwall
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setEnd (xpos, ypos)
-
sets the ending coordinates of the hyperwall
Parameters:
- xpos integer the x position of the ending system
- ypos integer the y position of the ending system
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setMaxShipClass (maxShipClass)
-
set the maximum ship class blocked by the hyperwall.
Uses the same class numbers as the
images
andsetship
commands: 0 = fighter, 1 = transport, etc. All hyperwalls default to 10 (satellites) as the largest impacted ships.Parameters:
- maxShipClass integer the maximum ship class blocked by the hyperwall
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setMinShipClass (minShipClass)
-
set the minimum ship class blocked by the hyperwall.
Uses the same class numbers as the
images
andsetship
commands: 0 = fighter, 1 = transport, etc. All hyperwalls default to 0 (fighters) as the smallest impacted ships.Parameters:
- minShipClass integer the minimum ship class blocked by the hyperwall
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setName (name)
-
sets the name of the hyperwall
Parameters:
- name string the name to set
Returns:
-
Hyperwall
the hyperwall, for function chaining
- hyperwall:setStart (xpos, ypos)
-
sets the starting coordinates of the hyperwall
Parameters:
- xpos integer the x position of the starting system
- ypos integer the y position of the starting system
Returns:
-
Hyperwall
the hyperwall, for function chaining