Module AntiGravityGeneratorUnit

Generates graviton condensates to power anti-gravity pulsors.

Note: This is generated from patch notes and in-game codex and has not yet been tested against the actual element. Accuracy not guaranteed.

Element class: AntiGravityGeneratorUnit

Extends: Element > ElementWithState > ElementWithToggle

Functions

activate () Activate the anti-gravity generator.
deactivate () Deactivate the anti-gravity generator.
isActive () Returns the state of activation of the anti-gravity generator.
getWidgetData () Get element data as JSON.
getFieldStrength () Returns the field strength of the anti-gravitational field.
getCompensationRate () Returns the current rate of compensation of the gravitational field.
getFieldPower () Returns the current power of the gravitational field.
getPulsorCount () Returns the number of pulsors linked to the anti-gravity generator.
setBaseAltitude (altitude) Deprecated: Sets the base altitude for the anti-gravity field.
setTargetAltitude (altitude) Sets the target altitude for the anti-gravity field.
getTargetAltitude () Return the target altitude defined for the anti-gravitational field.
getBaseAltitude () Return the current base altitude for the anti-gravitational field.
setSignalIn (plug, state) Set the value of a signal in the specified IN plug of the element.
getSignalIn (plug) Return the value of a signal in the specified IN plug of the element.
mockStepBaseAltitude (seconds) Mock only, not in-game: Updates the base altitude to approach the target altitude at 4 m/s.
mockGetClosure () Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".


Functions

activate ()
Activate the anti-gravity generator.
deactivate ()
Deactivate the anti-gravity generator.
isActive ()
Returns the state of activation of the anti-gravity generator.

Returns:

    0/1 1 when the anti-gravity generator is started, 0 otherwise.
getWidgetData ()
Get element data as JSON.

Anti-gravity generators have an antigravity_generator widget, which contains the following fields (bold fields are visible when making custom use of the widget):

  • antiGravityField (float) Field strength.
  • antiGPower (float) Power as a fraction of 1.0.
  • baseAltitude (float) Base altitude in meters.
  • showError (boolean) True if the error banner should be shown, false otherwise.
  • name (string) The name of the element.
  • helperId (string) antigravity_generator
  • type (string) antigravity_generator

Returns:

    string Data as JSON.
getFieldStrength ()
Returns the field strength of the anti-gravitational field.

Returns:

    float The power of the anti-gravitational field in Es.
getCompensationRate ()
Returns the current rate of compensation of the gravitational field.

Returns:

    float The current rate in percentage.
getFieldPower ()
Returns the current power of the gravitational field.

Returns:

    float The current power in percentage.
getPulsorCount ()
Returns the number of pulsors linked to the anti-gravity generator.

Returns:

    int The number of pulsors linked.
setBaseAltitude (altitude)
Deprecated: Sets the base altitude for the anti-gravity field.

This method is deprecated: setTargetAltitude should be used instead

Parameters:

  • altitude m The desired altitude. It will be reached with a slow acceleration (not instantaneous).

See also:

setTargetAltitude (altitude)
Sets the target altitude for the anti-gravity field. Cannot be called from system.onFlush.

Parameters:

  • altitude float The target altitude in meters. It will be reached with a slow acceleration (not instantaneous).
getTargetAltitude ()
Return the target altitude defined for the anti-gravitational field.

Returns:

    float The target altitude in meters.
getBaseAltitude ()
Return the current base altitude for the anti-gravitational field.

Note: This is the altitude that the anti-gravity generator is currently trying to hold at. It will adjust slowly to match the target altitude but will not instantly reflect the value set.

Returns:

    float The base altitude in meters.
setSignalIn (plug, state)
Set the value of a signal in the specified IN plug of the element.

Valid plug names are:

  • "in" for the in signal (seems to have no actual effect when modified this way).

Parameters:

  • plug string A valid plug name to set.
  • state 0/1 The plug signal state
getSignalIn (plug)
Return the value of a signal in the specified IN plug of the element.

Valid plug names are:

  • "in" for the in signal.

Parameters:

  • plug string A valid plug name to query.

Returns:

    0/1 The plug signal state
mockStepBaseAltitude (seconds)
Mock only, not in-game: Updates the base altitude to approach the target altitude at 4 m/s.

Parameters:

  • seconds number The number of seconds to move at 4 m/s.
mockGetClosure ()
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".

Returns:

    table A table encompasing the api calls of object.

See also:

generated by LDoc 1.5.0 Last updated 2024-09-27 15:22:46