-
Notifications
You must be signed in to change notification settings - Fork 41
LUA methods for Movement
Returns the location of the ship controller.
x, y, z = shipController.getLocalPosition()
Returns the list of attached players.
stringPlayers, arrayPlayers = shipController.getAttachedPlayers()
- stringPlayers is a comma separated list
- arrayPlayers is only available on OpenComputers
- only attached players can be summoned
Returns the ship mass measured in blocks.
shipMass, shipVolume = shipController.getShipSize()
- this is fairly slow call, make sure you only call it when strictly necessary (i.e. not at every screen refresh)
- shipMass is the count of non-air blocks
- shipVolume is the count of all blocks. It was added in 1.3.31
Returns the x,y,z vector for the ship front.
dx, dy, dz = shipController.getOrientation()
- dx and dz are -1, 0 or +1 depending on ship controller position relative to ship core. They're nil is ship core wasn't detected
- dy is always 0, obviously :)
Returns energy required for jumping with current parameters
shipController.command(...)
shipController.movement(...)
success, energyRequired = shipController.getEnergyRequired()
- success is true if the arguments are correct. In the opposite, second return value is the error message
- energyRequired is the estimated energy required for a single jump with current parameters. By default, it depends on the current position and mass of the ship.
Previously to 1.3.31, the syntax was:
energyRequired = shipController.getEnergyRequired(distance)
Type: Boolean
Returns the status for the current ship position.
Reports the maximum jump distance for current dimension and command.
shipController.command(...)
shipController.movement(...)
success, distance = shipController.getMaxJumpDistance()
- success is true if the arguments are correct. In the opposite, second return value is the error message
- distance is the maximum movement of the ship in a single jump. It depends on the current position and mass of the ship.
Previously to 1.3.31, the syntax was:
distance = shipController.getMaxJumpDistance()
This was used to report if a ship core was found. Use it to confirm the ship is ready during boot time/chunk loading. isAttached() was replaced to isAssemblyValid() as of 1.3.31, allowing to get a status message.
This was used to trigger the jump sequence based on previously set properties. jump() was replaced by enable(true) as of 1.3.31, allowing to disable an ongoing command.
Summon a specific player Returns true if the arguments are correct.
success, namePlayer = shipController.summon(indexPlayer)
- indexPlayer is a 0 based index in the array returned by getAttachedPlayers()
- success is true if the arguments are correct. In the opposite, second return value is the error message
- namePlayer is the name of the player that will be considered for summoning
- player summoning will happen after the return from this call
- player will be teleported in front or around of the ship core since 1.3.20
Summon all attached players back to the ship.
shipController.summon_all()
- player summoning will happen after the return from this call
- player will be teleported in front of the ship core as of 1.3.20
- this method has been removed as of 1.3.31. You can loop through attached players to get a similar behavior.
Returns the current lock strength.
lockStrength = transporterCore.getLockStrength()
- lockStrength is a number from 0.0 (no lock) to 1.0 (perfect lock) or higher
Returns the acquisition and energizing energy required per tick.
acquisitionEnergy, energizeEnergy = transporterCore.getEnergyRequired()
- acquisitionEnergy is the energy required per tick for locking on a remote location
- energizeEnergy is the energy required per tick for energizing
Home
Dependencies
Frequently Asked Questions
Changelog
Tutorials
* First ship, first jump
* Tuning Tools
* Programmable blocks
* Lasers - Basic Tutorial
* Lasers - Advanced Boosting
Exploration
* World generation
* Air in space
* Planets and Transition Planes
* Warp Jump Checklist
Atomic
* Large Hadron Collider
* Accelerator Controller
* Accelerator Control Point
* Chiller
* Electromagnet
* Particles Collider
* Particles Injector
* Void Shell
* Electromagnetic Cell
Breathing
* Breathing
* Air Canister
* Air Generator
* Air Tank
* Energy Air Shield
* Warp armor
Collection
* Laser Tree Farm
* Mining Laser
Detection
* Camera and Monitor
* Cloaking
* Radar
* Siren
* Warp Field Isolation Block
Energy
* IC2 Reactor Laser
* Subspace Capacitor
* Enantiomorphic Reactor
Movement
* Lift
* Transporter Room
* Transporter Core
* Transporter Scanner
* Transporter Containment
* Transporter Beacon
Protection
* Hull
* Force field projector
* Force field relay
* Force field upgrades
Weapons
* Lasers - Basic Tutorial
* Lasers - Advanced Boosting
LUA API
* LUA methods
- for Detection
- for Energy
- for Movement
* LUA properties
- for Energy
- for Movement
* LUA events
* LUA change logs