Jump to content

NQ-Ligo

Developer
  • Posts

    57
  • Joined

  • Last visited

Everything posted by NQ-Ligo

  1. Pressure Tile Emits a signal when a player walks on the tile. Functions NEW [int] isDown(): Checks if the pressure tile is down DEPRECATED [int] getState() → [int] isDown() Events NEW onPressed(): Emitted when the pressure tile is pressed DEPRECATED pressed() → onPressed() NEW onReleased(): Emitted when the pressure tile is released DEPRECATED released() → onReleased()
  2. NEW Player Player represents the player who is using the control unit Functions NEW [string] getName(): Returns the player name NEW [int] getId(): Return the ID of the player NEW [float] getMass(): Returns the player mass return [float]: The mass of the player in kilograms NEW [float] getNanopackMass(): Returns the player's nanopack content mass return [float]: The player's nanopack content mass in kilograms NEW [float] getNanopackVolume(): Returns the player's nanopack content volume return [float]: The player's nanopack content volume in liters NEW [float] getNanopackMaxVolume(): Returns the player's nanopack maximum volume return [float]: The player's nanopack maximum volume in liters NEW [table] getOrgIds(): Returns the list of organization IDs of the player return [table]: The list of organization IDs NEW [table] getPosition(): Returns the position of the player, in construct local coordinates return [table]: The position in construct local coordinates NEW [table] getWorldPosition(): Returns the position of the player, in world coordinates return [table]: The position in world coordinates NEW [table] getHeadPosition(): Returns the position of the head of the player's character, in construct local coordinates return [table]: The position of the head in construct local coordinates NEW [table] getWorldHeadPosition(): Returns the position of the head of the player's character, in world coordinates return [table]: The position of the head in world coordinates NEW [table] getVelocity(): Returns the velocity vector of the player, in construct local coordinates return [table]: The velocity vector in construct local coordinates NEW [table] getWorldVelocity(): Returns the velocity vector of the player, in world coordinates return [table]: The velocity vector in world coordinates NEW [table] getAbsoluteVelocity(): Returns the absolute velocity vector of the player, in world coordinates return [table]: The velocity absolute vector in world coordinates NEW [table] getForward(): Returns the forward direction vector of the player, in construct local coordinates NEW [table] getRight(): Returns the right vector of the construct coordinates system NEW [table] getUp(): Returns the up direction vector of the player, in construct local coordinates NEW [table] getWorldForward(): Returns the forward direction vector of the player, in world coordinates NEW [table] getWorldRight(): Returns the right direction vector of the player, in world coordinates NEW [table] getWorldUp(): Returns the up direction vector of the player, in world coordinates NEW [int] getPlanet(): Returns the id of the planet the player is located on return [int]: The id of the planet, 0 if none NEW [int] getParent(): Returns the identifier of the construct to which the player is parented return [int]: The id of the construct, 0 if none NEW [int] isSeated(): Checks if the player is seated return [int]: 1 if the player is seated NEW [int] getSeatId(): Returns the local id of the seat on which the player is sitting return [int]: The local id of the seat, or 0 is not seated NEW [int] isParentedTo([int] id): Checks if the player is parented to the given construct [int] id: The construct id return [int]: 1 if the player is parented to the given construct NEW [int] isSprinting(): Checks if the player is currently sprinting return [int]: 1 if the player is sprinting NEW [int] isJetpackOn(): Checks if the player's jetpack is on return [int]: 1 if the player's jetpack is on NEW [int] isHeadlightOn(): Returns the state of the headlight of the player return [int]: 1 if the player has his headlight on NEW setHeadlightOn([bool] state): Set the state of the headlight of the player [bool] state: True to turn on headlight NEW freeze([bool] state): Freezes the player movements, liberating the associated movement keys to be used by the script. Note that this function is disabled if the player is not running the script explicitly (pressing F on the Control Unit, vs. via a plug signal) [bool] state: 1 freeze the character, 0 unfreeze the character NEW [int] isFrozen(): Checks if the player movements are frozen return [int]: 1 if the player is frozen, 0 otherwise NEW [int] hasDRMAutorization(): Checks if the player has DRM autorization to the control unit return [int]: 1 if the player has DRM autorization on the control unit Events NEW onParentChanged([int] oldId, [int] newId): Emitted when the player parent change [int] oldId: The previous parent construct ID [int] newId: The new parent construct ID
  3. NEW Plasma Extractor Extracts a regular amount of plasma from the space surrouding an alien core Functions NEW [int] getStatus(): Returns the current status of the plasma extractor return [int]: The status of the plasma extractor can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4) NEW [float] getRemainingTime(): Returns the remaining time of the current batch extraction process. NEW [table] getPlasmaPools(): Returns the list of available plasma pools return [table]: A list of tables composed with {[int] oreId, [float] available, [float] maximum) Events NEW onStarted(): Emitted when the plasma extractor started a new extraction process NEW onCompleted(): Emitted when the plasma extractor complete a batch NEW onStatusChanged([int] status): Emitted when the plasma extractor status is changed [int] status: The status of the mining unit can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4) NEW onStopped(): Emitted when the plasma extractor stopped the extraction process
  4. Mining Unit Extracts a regular amount of resources from the ground. Functions NEW [int] getState(): Returns the current state of the mining unit return [int]: The status of the mining unit can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4) DEPRECATED [int] getStatus() → [int] getState() [float] getRemainingTime(): Returns the remaining time of the current batch extraction process. [int] getActiveOre(): Returns the item ID of the currently selected ore. [table] getOrePools(): Returns the list of available ore pools return [table]: A list of tables composed with {[int] oreId, [float] available, [float] maximum). [float] getBaseRate(): Returns the base production rate of the mining unit. [float] getEfficiency(): Returns the efficiency rate of the mining unit. [float] getCalibrationRate(): Returns the calibration rate of the mining unit. [float] getOptimalRate(): Returns the optimal calibration rate of the mining unit. [float] getProductionRate(): Returns the current production rate of the mining unit. [float] getAdjacencyBonus(): Returns the territory's adjacency bonus to the territory of the mining unit. Note: This value is updated only when a new batch is started. [table] getLastExtractionPosition(): Returns the position of the last calibration excavation, in world coordinates. [int] getLastExtractingPlayerId(): Returns the ID of the last player who calibrated the mining unit. [float] getLastExtractionTime(): Returns the time in seconds since the last calibration of the mining unit. [float] getLastExtractedVolume(): Returns the volume of ore extracted during the last calibration excavation. Events NEW onStarted([int] oreId): Emitted when the mining unit started a new extraction process. [int] oreId: The item ID of the ore mined during the extraction process NEW onCalibrated([int] oreId, [float] amount, [float] rate): Emitted when the mining unit is calibrated. [int] oreId: The item ID of the ore extracted during the calibration process [float] amount: Amount of ore extracted during the calibration process [float] rate: The new calibration rate after calibration process DEPRECATED calibrated([int] oreId, [float] amount, [float] rate) → onCalibrated([int] oreId, [float] amount, [float] rate) NEW onCompleted([int] oreId, [float] amount): Emitted when the mining unit complete a batch. [int] oreId: The item ID of the ore mined during the extraction process [float] amount: Amount of ore mined DEPRECATED completed([int] oreId, [float] amount) → onCompleted([int] oreId, [float] amount) NEW onStatusChanged([int] status): Emitted when the mining unit status is changed. [int] status: The status of the mining unit can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4) DEPRECATED statusChanged([int] status) → onStatusChanged([int] status) NEW onStopped(): Emitted when the mining unit stopped the extraction process.
  5. Manual Switch A Manual Switch that can be in an on/off state. Functions activate(): Switches the switch on deactivate(): Switches the switch off toggle(): Toggle the switch NEW [int] isActive(): Checks if the switch is active DEPRECATED [int] getState() → [int] isActive() Events NEW onPressed(): Emitted when the button is pressed DEPRECATED pressed() → onPressed() NEW onReleased(): Emitted when the button is released DEPRECATED released() → onReleased()
  6. Manual Button Emits a signal for the duration it is pressed. Functions NEW [int] isDown(): Checks if the manual button is down DEPRECATED [int] getState() → [int] isDown() Events NEW onPressed(): Emitted when the button is pressed DEPRECATED pressed() → onPressed() NEW onReleased(): Emitted when the button is released DEPRECATED released() → onReleased()
  7. Light Emits a source of light. Functions activate(): Switches the light on deactivate(): Switches the light off NEW [int] isActive(): Checks if the light is on DEPRECATED [int] getState() → [int] isActive() toggle(): Toggle the state of the light NEW setColor([float] r, [float] g, [float] b): Set the light color in RGB [float] r: The red component, between 0.0 and 1.0 [float] g: The green component, between 0.0 and 1.0 [float] b: The blue component, between 0.0 and 1.0 DEPRECATED setRGBColor() → setColor() NEW [table] getColor(): Returns the light color in RGB return [table]: A vec3 for the red, blue and green components of the light, with values between 0.0 and 1.0 DEPRECATED getRGBColor() → getColor() NEW setBlinkingState([bool] state): Returns the blinking state of the light [bool] state: True to enable light blinking NEW [int] isBlinking(): Checks if the light blinking is enabled NEW [float] getOnBlinkingDuration(): Returns the light 'on' blinking duration NEW setOnBlinkingDuration([float] time): Set the light 'on' blinking duration [float] time: The duration of the 'on' blinking in seconds NEW [float] getOffBlinkingDuration(): Returns the light 'off' blinking duration NEW setOffBlinkingDuration([float] time): Set the light 'off' blinking duration [float] time: The duration of the 'off' blinking in seconds NEW [float] getBlinkingTimeShift(): Returns the light blinking time shift NEW setBlinkingTimeShift([float] shift): Set the light blinking time shift [float] shift: The time shift of the blinking
  8. Library Contains a list of useful math and helper methods that would be slow to implement in Lua, and which are given here as fast C++ implementation. Functions systemResolution3([table] c1,[table] c2,[table] c3,[table] c0): Solve the 3D linear system M*x=c0 where M is defined by its column vectors c1,c2,c3 [table] c1: The first column of the matrix M [table] c2: The second column of the matrix M [table] c3: The third column of the matrix M [table] c0: The target column vector of the system return [table]: The vec3 solution of the above system systemResolution2([table] c1,[table] c2,[table] c0): Solve the 2D linear system M*x=c0 where M is defined by its column vectors c1,c2 [table] c1: The first column of the matrix M [table] c2: The second column of the matrix M [table] c0: The target column vector of the system return [table]: The vec2 solution of the above system NEW [vec3] getPointOnScreen([table] worldPos): Returns the position of the given point in world coordinates system, on the game screen [table] worldPos: The world position of the point return [table]: The position in percentage (between 0 and 1) of the screen resolution as vec3 with {x, y, depth}
  9. Laser Emitter Emits a Laser ray that can be use to detect the passage of a player or on a Laser Detector unit. Functions activate(): Activates the laser emitter deactivate(): Deactivates the laser emitter toggle(): Toggle the laser emitter NEW [int] isActive(): Checks if the laser emitter is active DEPRECATED [int] getState() → [int] isActive()
  10. Laser Detector Detect the hit of a Laser. Functions NEW isHit(): Checks if any laser is hitting the detector DEPRECATED getState() → isHit() Events NEW onHit(): Emitted when a laser hit the detector DEPRECATED laserHit() → onHit() NEW onLoss(): Emitted when all lasers stop hitting the detector DEPRECATED laserRelease() → onLoss()
  11. Landing Gear A Landing Gear that can be opened or closed. Functions NEW deploy(): Deploys the landing gear DEPRECATED activate() → deploy() NEW retract(): Retracts the landing gear DEPRECATED deactivate() → retract() NEW isDeployed(): Checks if the landing gear is deployed DEPRECATED getState() → isDeployed() [float] toggle(): Toggle the landing gear
  12. Industry An industry is a machine designed to produce different types of elements Functions NEW startRun(): Start the production, and it will run unless it is stopped or the input resources run out DEPRECATED start() → startRun() NEW startMaintain([float] quantity): Start maintaining the specified quantity. Resumes production when the quantity in the output Container is too low, and pauses production when it is equal or higher [float] quantity: Quantity to maintain inside output containers DEPRECATED startAndMaintain([float] quantity) → startMaintain([float] quantity) NEW startFor([int] numBatches): Start the production of numBatches and then stop [int] numBatches: Number of batches to run before unit stops DEPRECATED batchStart([int] numBatches) → startFor([int] numBatches) NEW stop([bool] force,[bool] allowLoss): Stop the production of the industry unit [bool] force: (optional by default false) True if you want to force the production to stop immediately [bool] allowLoss: (optional by default false) True if you want to allow the industry unit to lose components when recovering in use components DEPRECATED hardStop([bool] allowLoss) → stop( true, [bool] allowLoss) DEPRECATED softStop() → stop(false) [int] getStatus(): Get the current running state of the industry return [int]: (Stopped = 1, Running = 2, Jammed missing ingredient = 3, Jammed output full = 4, Jammed no output container = 5, Pending = 6) NEW [table] getState(): Get the complete state of the industry return [table]: The complete state of the industry, a table with fields {[int] state, [bool] stopRequested, [int] schematicId, [int] unitsProduced, [int] remainingTime, [int] batchesRequested, [int] batchesRemaining, [float] maintainProductAmount, [int] currentProductAmount} [int] getCyclesCompleted(): Get the count of completed cycles since the player started the unit DEPRECATED [int] getCycleCountSinceStartup() → [int] getCyclesCompleted() [float] getEfficiency(): Returns the efficiency of the industry [float] getUptime(): Returns the time elapsed in seconds since the player started the unit for the latest time [int] getCurrentSchematic(): Get the id of the currently loaded Schematic setCurrentSchematic([int] id): Set the loaded Schematic, based on its id. Use getCurrentSchematic to learn about your Schematic id Events NEW onStarted([int] id, [float] quantity): Emitted when the Industry Unit has started a new production process [int] id: The product item id [float] quantity: The product quantity NEW onCompleted([int] id, [float] quantity): Emitted when a player enters in the detection zone [int] id: The product item id [float] quantity: The product quantity DEPRECATED completed([int] id, [float] quantity) → onCompleted([int] id, [float] quantity) NEW onStatusChanged([int] status): Emitted when the industry status has changed [int] status: The status of the industry can be (Stopped = 1, Running = 2, Jammed missing ingredient = 3, Jammed output full = 4, Jammed no output container = 5, Pending = 6) DEPRECATED statusChanged[int] status) → onStatusChanged([int] status)
  13. NEW Hover Engines Hover engines are engines designed for ground vehicles in the atmosphere; they require a surface to produce thrust. Functions activate(): Start the engine at full power (works only when run inside a cockpit or under remote control) deactivate(): Stops the engine (works only when run inside a cockpit or under remote control) NEW [int] isActive(): Checks if the engine is active DEPRECATED [int] getState() → isActive() toggle(): Toggle the state of the engine setThrust([float] thrust): Set the thrust of the engine [float] thrust: The engine thrust in newtons (limited by the maximum thrust) [float] getThrust(): Returns the current thrust of the engine NEW [float] getMaxThrust(): Returns the maximal thrust the engine can deliver in principle, under optimal conditions. DEPRECATED [float] getMaxThrustBase() → getMaxLift() NEW [float] getCurrentMinThrust(): Returns the minimal thrust the engine can deliver at the moment (can be more than zero), which will depend on various conditions like atmospheric density, obstruction, orientation, etc DEPRECATED [float] getMinThrust() → getCurrentMinThrust() NEW [float] getCurrentMaxThrust(): Returns the maximal thrust the engine can deliver at the moment, which might depend on various conditions like atmospheric density, obstruction, orientation, etc. The actual thrust will be anything below this maxThrust, which defines the current max capability of the engine DEPRECATED [float] getMaxThrust() → getCurrentMaxThrust() NEW [float] getMaxThrustEfficiency(): Returns the ratio between the current maximum thrust and the optimal maximum thrust NEW [int] isTorqueEnabled(): Checks if the torque generation is enabled on the engine NEW enableTorque([bool] state): Sets the torque generation state on the engine NEW [vec3] getThrustAxis(): Returns the engine thrust direction in construct local coordinates NEW [vec3] getTorqueAxis(): Returns the engine torque axis in construct local coordinates NEW [vec3] getWorldThrustAxis(): Returns the engine exhaust thrust direction in world coordinates DEPRECATED [vec3] thrustAxis() → getWorldThrustAxis() NEW [vec3] getWorldTorqueAxis(): Returns the engine torque axis in world coordinates DEPRECATED [vec3] torqueAxis() → getWorldTorqueAxis() [int] isOutOfFuel(): Checks if the engine out of fuel NEW [int] getFuelId(): Returns the item ID of the fuel currently used by the engine NEW [int] getFuelTankId(): Returns the local ID of the fueltank linked to the engine [int] hasFunctionalFuelTank(): Checks if the engine linked to a functional Fuel Tank (not broken or colliding) [float] getCurrentFuelRate(): Returns the engine fuel consumption rate per newton of thrust delivered per second [float] getFuelRateEfficiency(): Returns the ratio between the current fuel rate and the theoretical nominal fuel rate [float] getFuelConsumption(): Returns the current fuel consumption rate NEW [float] getWarmupTime(): Returns the T50; the time needed for the engine to reach 50% of its maximal thrust (all engines do not instantly reach the thrust that is set for them, but they can take time to "warm up" to the final value) DEPRECATED [float] getT50() → getWarmupTime() [float] getDistance(): Returns the distance to the first object detected in the direction of the thrust NEW [float] getMaxDistance(): Returns the maximum functional distance from the ground [float] getObstructionFactor(): Returns the obstruction ratio of the engine exhaust by Elements and Voxels. The more obstructed the engine is, the less properly it will work. Try to fix your design if this is the case. [string] getTags(): Returns the tags of the engine [string] setTags([string] tags,[boolean] ignore): Set the tags of the engine [string] tags: The CSV string of the tags [bool] ignore: True to ignore the default engine tags [int] isIgnoringTags(): Checks if the engine is ignoring default tags
  14. Gyro A general kinematic unit to obtain information about the ship orientation, velocity, and acceleration. Functions activate(): Selects this gyro as the main gyro used for ship orientation deactivate(): Deselects this gyro as the main gyro used for ship orientation, using the Core Unit instead toggle(): Toggle the activation state of the gyro NEW isActive(): Returns the activation state of the gyro DEPRECATED getState() → isActive() [float] getPitch(): The pitch value relative to the gyro orientation and the local gravity return [float]: The pitch angle in degrees, relative to the gyro orientation and the local gravity [float] getRoll(): The roll value relative to the gyro orientation and the local gravity return [float]: The roll angle in degrees, relative to the gyro orientation and the local gravity DEPRECATED [table] localForward() → [table] getForward() DEPRECATED [table] localRight() → [table] getRight() DEPRECATED [table] localUp() → [table] getUp() DEPRECATED [table] worldForward() → [table] getWorldForward() DEPRECATED [table] worldRight() → [table] getWorldRight() DEPRECATED [table] worldUp() → [table] getWorldUp()
  15. Force Field A Force Field to create an uncrossable energy barrier. Functions NEW deploy(): Deploys the forcefield DEPRECATED activate() → deploy() NEW retract(): Retracts the forcefield DEPRECATED deactivate() → retract() NEW isDeployed(): Checks if the forcefield is deployed DEPRECATED getState() → isDeployed() [float] toggle(): Toggle the forcefield
  16. Firework A firework launcher capable to launch Fireworks that are stored in the attached Container. Functions NEW fire(): Fire the firework DEPRECATED activate() → fire() setExplosionDelay([float] delay): Set the delay before the launched Fireworks explodes [float] delay: The delay before explosion in seconds (maximum 5s) NEW [float] getExplosionDelay(): Returns the delay before the launched Fireworks explodes setLaunchSpeed([float] speed): Set the speed at which the firework will be launched (impacts its altitude, depending on the local gravity). [float] speed: The launch speed in m/s (maximum 200m/s) NEW [float] getLaunchSpeed(): Returns the speed at which the firework will be launched setType([int] type): Set the type of launched firework (will affect which firework is picked in the attached Container) [int] type: The type index of the firework (Ball = 1, Ring = 2, Palmtree = 3, Shower = 4) NEW [float] getType(): Returns the type of launched firework setColor([int] color): Set the color of the launched firework (will affect which firework is picked in the attached Container) [int] color: The color index of the firework (Blue = 1, Gold = 2, Green = 3, Purple = 4, Red = 5, Silver = 6) NEW [float] getColor(): Returns the color of the launched firework Events NEW onFire(): Emitted when a firework has just been fired
  17. Emitter This unit is capable of emitting messages on a channel Functions send(): Send a message on the given channel, limited to one transmission per frame and per channel [string] channel: The channel name, limited to 64 characters. The message will not be sent if it exceeds this [string] message: The message to be transmitted, truncated to 512 characters in case of overflow [float] getRange(): Returns the emitter range Events NEW onSent([string] channe, [string] message): Emitted when a player enters in the detection zone [string] channel: The channel name [string] message: The transmitted message
  18. Element All Elements share the same generic methods described below Functions NEW showWidget(): Show the element widget in the in-game widget stack DEPRECATED show() → showWidget() NEW hideWidget(): Hide the element widget in the in-game widget stack DEPRECATED hide() → hideWidget() [string] getWidgetType(): Returns the widget type compatible with the element data NEW [string] getWidgetData(): Returns the element data as JSON DEPRECATED [string] getData() → [string] getWidgetData() NEW [string] getWidgetDataId(): Returns the element data ID DEPRECATED [string] getDataId() → [string] getWidgetDataId() NEW [string] getName(): Returns the element name NEW [string] getClass(): Returns the class of the Element DEPRECATED [string] getElementClass() → [string] getClass() [float] getMass(): Returns the mass of the element (includes the included items' mass when the Element is a Container) NEW [int] getItemId(): Returns the element item ID (to be used with system.getItem() function to get information about the element). NEW [int] getLocalId(): Returns the unique local ID of the element DEPRECATED [int] getLocalId() → [int] getId() [float] getIntegrity(): Returns the element integrity between 0 and 100 [float] getHitPoints(): Returns the element's current hit points (0 = destroyed) [float] getMaxHitPoints(): Returns the element's maximal hit points [int] getRemainingRestorations(): Returns the element's remaining number of restorations [int] getMaxRestorations(): Returns the element's maximal number of restorations NEW [table] getPosition(): Returns the position of the Element in construct local coordinates. NEW [table] getBoundingBoxSize(): Returns the bounding box dimensions of the element. NEW [table] getBoundingBoxCenter(): Returns the position of the center of bounding box of the element in local construct coordinates. NEW [table] getUp(): Returns the up direction vector of the Element in construct local coordinates NEW [table] getRight(): Returns the right direction vector of the Element in construct local coordinates NEW [table] getForward(): Returns the forward direction vector of the Element in construct local coordinates NEW [table] getWorldUp(): Returns the up direction vector of the Element in world coordinates NEW [table] getWorldRight(): Returns the right direction vector of the Element in world coordinates NEW [table] getWorldForward(): Returns the forward direction vector of the Element in world coordinates setSignalIn(plug, state): Set the value of a signal in the specified IN plug of the Element. [string] plug: The plug name, in the form of IN-SIGNAL-index [int] state: The plug signal state getSignalIn(plug, state): eturns the value of a signal in the specified IN plug of the Element. [string] plug: The plug name, in the form of IN-SIGNAL-index return [int]: The plug signal state getSignalOut(plug): Returns the value of a signal in the specified OUT plug of the Element. [string] plug: The plug name, in the form of IN-SIGNAL-index return [int]: The plug signal state
  19. Door A door that can be opened or closed. Functions NEW open(): Open the door DEPRECATED activate() → open() NEW close(): Close the door DEPRECATED deactivate() → close() NEW [int] isOpen(): Return the opening status of the door DEPRECATED getState() → isOpen() toggle(): Toggle the door
  20. Detection Zone Detect the intrusion of any player inside the effect zone. Functions [float] getRadius(): Returns the detection zone radius NEW [table] getPlayers(): Returns the list of ids of the players in the detection zone Events NEW onEnter([int] id): Emitted when a player enters in the detection zone [int] id: The ID of the player. Use system.getPlayerName(id) to retrieve its name DEPRECATED enter([int] id) → onEnter([int] id) NEW onLeave([int] id): Emitted when a player leaves in the detection zone [int] id: The ID of the player. Use system.getPlayerName(id) to retrieve its name DEPRECATED leave([int] id) → onLeave([int] id)
  21. Databank Stores key/value pairs in a persistent way. Functions clear(): Clear the Databank [int] getNbKeys(): Returns the number of keys that are stored inside the Databank NEW [table] getKeyList(): Returns all the keys in the Databank DEPRECATED getKeys() → getKeyList() [int] hasKey([string] key): Returns 1 if the key is present in the Databank, 0 otherwise [string] key: The key used to store a value NEW [int] clearValue([string] key): Remove the given key if the key is present in the Databank [string] key: The key used to store a value setStringValue([string] key, [string] val): Stores a string value at the given key [string] key: The key used to store the value [string] val: The value, as a string [string] getStringValue([string] key): Returns value stored in the given key as a string [string] key: The key used to store the value return [string]: The value, as a string setIntValue([string] key, [int] val): Stores an integer value at the given key [string] key: The key used to store the value [int] val: The value, as an integer [int] getIntValue([string] key): Returns value stored in the given key as an integer [string] key: The key used to store the value return [int]: The value, as an integer setFloatValue([string] key, [float] val): Stores a floating number value at the given key [string] key: The key used to store the value [string] val: The value, as a floating number [float] getFloatValue([string] key): Returns value stored in the given key as a floating number [string] key: The key used to store the value return [string]: The value as a floating number
  22. Counter Cycle its output signal over a set of n-plugs, incrementing the activate plug by one step at each impulse received on its IN plug Functions NEW [int] getIndex(): Returns the index of the current active output plug DEPRECATED [int] getCounterState() → [int] getIndex() NEW [float] getMaxIndex(): Returns the container content mass(the sum of the mass of all items it contains). NEW [float] nextIndex(): Returns the current hit points of the shield DEPRECATED next() → nextIndex() NEW setIndex([int] index): Sets the counter index [int] index: The index of the plug to activate
  23. Core Unit It is the heart of your construction. It represents the interaction of the environment of your construction with its surroundings. Functions [table] getElementIdList(): Returns the list of all the local IDs of the Elements of this construct [string] getElementNameById([int] localId): Returns the name of the Element, identified by its local ID [int] localId: The local ID of the Element NEW [string] getElementClassById([int] localId): Returns the class of the Element, identified by its local ID [int] localId: The local ID of the Element NEW [string] getElementDisplayNameById([int] localId): Returns the display name of the Element, identified by its local ID [int] localId: The local ID of the Element DEPRECATED [string] getElementTypeById([int] uid) → [string] getElementDisplayNameById([int] localId) NEW [int] getElementItemIdById([int] localId): Returns the item ID of the Element, identified by its local ID [int] localId: The local ID of the Element [float] getElementHitPointsById([int] localId): Returns the current level of hit points of the Element, identified by its local ID [int] localId: The local ID of the Element [float] getElementMaxHitPointsById([int] localId): Returns the maximum level of hit points of the Element, identified by its local ID [int] localId: The local ID of the Element [float] getElementMassById([int] localId): Returns the mass of the Element, identified by its local ID [int] localId: The local ID of the Element [table] getElementPositionById([int] localId): Returns the position of the Element, identified by its local ID, in construct local coordinates. [int] localId: The local ID of the Element [table] getElementUpById([int] localId): Returns the up direction vector of the Element, identified by its local ID, in construct local coordinates [int] localId: The local ID of the Element [table] getElementRightById([int] localId): Returns the right direction vector of the Element, identified by its local ID, in construct local coordinates [int] localId: The local ID of the Element [table] getElementForwardById([int] localId): Returns the forward direction vector of the Element, identified by its local ID, in construct local coordinates [int] localId: The local ID of the Element NEW [table] getElementIndustryInfoById([int] localId): Returns the status of the Industry Unit Element, identified by its local ID [int] localId: The local ID of the Element return [table]: If the Element is an Industry Unit, a table with fields {[string] state, [bool] stopRequested, [int] schematicId, [int] unitsProduced, [int] remainingTime, [int] batchesRequested, [int] batchesRemaining, [number] maintainProductAmount, [int] currentProductAmount} DEPRECATED [string] getElementIndustryStatusById([int] uid) → [table] getElementIndustryInfoById([int] localId) [string] getElementTagsById([int] localId): Returns the list of tags associated to the Element, identified by its local ID [int] localId: The local ID of the Element [float] getAltitude(): Returns the altitude above sea level, with respect to the closest planet (0 in space) [float] getGravityIntensity(): Returns the local gravity intensity DEPRECATED [string] g() → [table] getGravityIntensity() [table] getWorldGravity(): Returns the local gravity vector in world coordinates [table] getWorldVertical(): Returns the vertical unit vector along gravity, in world coordinates (0 in space) [int] getCurrentPlanetId(): Returns the id of the current close stellar body [float] getCoreStress(): Returns the core's current stress, destroyed when reaching max stress [float] getMaxCoreStress(): Returns the maximal stress the core can bear before it gets destroyed [float] getCoreStressRatio(): Returns the core's current stress to max stress ratio [int] spawnNumberSticker([int] nb,[float] x,[float] y,[float] z,[string] orientation): Spawns a number sticker in the 3D world, with coordinates relative to the construct [int] nb: The number to display 0 to 9 [float] x: The x-coordinate in the construct in meters. 0 = center [float] y: The y-coordinate in the construct in meters. 0 = center [float] z: The z-coordinate in the construct in meters. 0 = center [string] orientation: Orientation of the number. Possible values are "front", "side" [int] spawnArrowSticker([float] x,[float] y,[float] z,[string] orientation): Spawns an arrow sticker in the 3D world, with coordinates relative to the construct [float] x: The x-coordinate in the construct in meters. 0 = center [float] y: The y-coordinate in the construct in meters. 0 = center [float] z: The z-coordinate in the construct in meters. 0 = center [string] orientation: Orientation of the arrow. Possible values are "up", "down", "north", "south", "east", "west" [int] deleteSticker([int] index): Delete the referenced sticker [int] index: Index of the sticker to delete [int] moveSticker([int] index,[float] x,[float] y,[float] z): Move the referenced sticker [int] index: Index of the sticker to delete [float] x: The x-coordinate in the construct in meters. 0 = center [float] y: The y-coordinate in the construct in meters. 0 = center [float] z: The z-coordinate in the construct in meters. 0 = center [int] rotateSticker([int] index,[float] angle_x,[float] angle_y,[float] angle_z): Rotate the referenced sticker. [int] index: Index of the sticker to delete [float] angle_x: Rotation along the x-axis in degrees [float] angle_y: Rotation along the y-axis in degrees [float] angle_z: Rotation along the z-axis in degrees DEPRECATED [int] getConstructId() → [int] construct.getId() DEPRECATED [string] getConstructName() → [string] construct.getName() DEPRECATED [table] getConstructWorldPos() → [table] construct.getWorldPosition() DEPRECATED [table] getWorldAirFrictionAcceleration() → [table] construct.getWorldAirFrictionAngularAcceleration() DEPRECATED [table] getAngularVelocity() → [table] construct.getAngularVelocity() DEPRECATED [table] getWorldAngularVelocity() → [table] construct.getWorldAngularVelocity() DEPRECATED [table] getAngularAcceleration() → [table] construct.getAngularAcceleration() DEPRECATED [table] getWorldAngularAcceleration() → [table] construct.getWorldAngularAcceleration() DEPRECATED [table] getWorldAngularVelocity() → [table] construct.getWorldAngularVelocity() DEPRECATED [table] getVelocity() → [table] construct.getVelocity() DEPRECATED [table] getWorldVelocity() → [table] construct.getWorldVelocity() DEPRECATED [table] getAbsoluteVelocity() → [table] construct.getAbsoluteVelocity() DEPRECATED [table] getWorldAbsoluteVelocity() → [table] construct.getWorldAbsoluteVelocity() DEPRECATED [table] getAcceleration() → [table] construct.getAcceleration() DEPRECATED [table] getWorldAcceleration() → [table] construct.getWorldAcceleration() DEPRECATED [int] getOrientationUnitId() → [int] construct.getOrientationUnitId() DEPRECATED [table] getConstructOrientationUp() → [table] construct.getConstructOrientationUp() DEPRECATED [table] getConstructOrientationRight() → [table] construct.getConstructOrientationRight() DEPRECATED [table] getConstructOrientationForward() → [table] construct.getConstructOrientationForward() DEPRECATED [table] getConstructWorldOrientationUp() → [table] construct.getConstructWorldOrientationUp() DEPRECATED [table] getConstructWorldOrientationRight() → [table] construct.getConstructWorldOrientationRight() DEPRECATED [table] getConstructWorldOrientationForward() → [table] construct.getConstructWorldOrientationForward() DEPRECATED [table] getConstructWorldUp() → [table] construct.getConstructWorldUp() DEPRECATED [table] getConstructWorldRight() → [table] construct.getConstructWorldRight() DEPRECATED [table] getConstructWorldForward() → [table] construct.getConstructWorldForward() DEPRECATED [float] getPvPTimer() → [float] construct.getPvPTimer() DEPRECATED [table] getPlayersOnBoard() → [table] construct.getPlayersOnBoard() DEPRECATED [table] getPlayersOnBoardInVRStation() → [table] construct.getPlayersOnBoardInVRStation() DEPRECATED [table] getDockedConstructs() → [table] construct.getDockedConstructs() DEPRECATED [int] isPlayerBoarded([int] pid) → [int] construct.isPlayerBoarded([int] id) DEPRECATED [int] isPlayerBoardedInVRStation([int] pid) → [int] construct.isPlayerBoardedInVRStation([int] id) DEPRECATED [int] isConstructDocked([int] cid) → [int] construct.isConstructDocked([int] id) DEPRECATED forceDeboard([int] pid) → construct.forceDeboard([int] id) DEPRECATED forceInterruptVRSession([int] pid) → construct.forceInterruptVRSession([int] id) DEPRECATED forceUndock([int] cid) → construct.forceUndock([int] id) DEPRECATED [float] getBoardedPlayerMass([int] id) → [float] construct.getBoardedPlayerMass([int] id) DEPRECATED [float] getBoardedInVRStationAvatarMass([int] id) → [float] construct.getBoardedInVRStationAvatarMass([int] id) DEPRECATED [float] getDockedConstructMass([int] id) → [float] construct.getDockedConstructMass([int] id) DEPRECATED [int] getParent() → [int] construct.getParent() DEPRECATED [table] getCloseParents() → [table] construct.getCloseParents() DEPRECATED [int] getClosestParent() → [int] construct.getClosestParent() DEPRECATED [int] dock([int] id) → [int] construct.dock([int] id) DEPRECATED [int] undock() → [int] construct.undock() DEPRECATED [int] setDockingMode([int] mode) → [int] construct.setDockingMode([int] mode) DEPRECATED [int] getDockingMode() → [int] construct.getDockingMode() DEPRECATED [table] getParentPosition() → [table] construct.getParentPosition() DEPRECATED [table] getParentWorldPosition() → [table] construct.getParentWorldPosition() DEPRECATED [table] getParentForward() → [table] construct.getParentForward() DEPRECATED [table] getParentUp() → [table] construct.getParentUp() DEPRECATED [table] getParentRight() → [table] construct.getParentRight() DEPRECATED [table] getParentWorldForward() → [table] construct.getParentWorldForward() DEPRECATED [table] getParentWorldUp() → [table] construct.getParentWorldUp() DEPRECATED [table] getParentWorldRight() → [table] construct.getParentWorldRight() DEPRECATED [float] getMaxSpeed() → [float] construct.getMaxSpeed() DEPRECATED [float] getMaxAngularSpeed() → [float] construct.getMaxAngularSpeed() DEPRECATED [table] getMaxSpeedPerAxis() → [table] construct.getMaxSpeedPerAxis() DEPRECATED [float] getConstructMass() → [float] construct.getMass() DEPRECATED [float] getConstructIMass() → [float] construct.getInertialMass() DEPRECATED [float] getConstructCrossSection() → [float] construct.getCrossSection() DEPRECATED [table] getMaxKinematicsParametersAlongAxis([string] taglist, [table] CRefAxis) → [table] construct.getMaxThrustAlongAxis([string] taglist, [table] CRefAxis) Events NEW onStressChanged([float] stress): Emitted when core unit stress changed [float] stress: Difference to previous stress value DEPRECATED stressChanged([float] stress) → onStressChanged([float] stress) DEPRECATED pvpTimer([int] active) → construct.onPvPTimer([int] active) DEPRECATED playerBoarded([int] id) → construct.onPlayerBoarded([int] id) DEPRECATED VRStationEntered([int] id) → construct.onVRStationEntered([int] id) DEPRECATED constructDocked([int] id) → construct.onConstructDocked([int] id) DEPRECATED docked([int] id) → construct.onDocked([int] id) DEPRECATED undocked([int] id) → construct.onUndocked([int] id)
  24. Control Unit Control Units come in various forms: cockpits, programming boards, emergency Control Units, etc. A Control Unit stores a set of Lua scripts that can be used to control the Elements that are plugged on its CONTROL plugs. Kinematics Control Units like cockpit or command seats are also capable of controlling the ship's engines via the update ICC method. Functions setTimer([string] tag, [float] period): Set up a timer with a given tag in a given period. This will start to trigger the 'onTimer' event with the corresponding tag as an argument, to help you identify what is ticking, and when. [string] tag: The tag of the timer, as a string, which will be used in the 'onTimer' event to identify this particular timer [float] period: The period of the timer, in seconds. The time resolution is limited by the framerate here, so you cannot set arbitrarily fast timers stopTimer([string] tag): Stop the timer with the given tag [string] tag: The tag of the timer to stop, as a string [float] getAtmosphereDensity(): Returns the ambient atmospheric density return [float]: The atmospheric density(between 0 and 1) [float] getClosestPlanetInfluence(): Returns the influence rate of the nearest planet return [float]: The planet influence rate(between 0 and 1) NEW [int] hasDRM(): Checks if the control unit is protected by DRM [int] isRemoteControlled(): Check if the construct is remote controlled [float] setEngineCommand([string] taglist, [table] acceleration, [table] angularAcceleration, [bool] keepForceCollinearity, [bool] keepTorqueCollinearity, [string] priority1SubTags, [string] priority2SubTags, [string] priority3SubTags, [float] toleranceRatioToStopCommand): Automatically assign the engines within the taglist to result in the given acceleration and angular acceleration provided. Can only be called within the system.onFlush event. If engines designated by the tags are not capable of producing the desired command, setEngineCommand will try to do its best to approximate it [string] taglist: Comma (for union) or space (for intersection) separated list of tags. You can set tags directly on the engines in the right-click menu [table] acceleration: The desired acceleration expressed in world coordinates in m/s2 [table] angularAcceleration: The desired angular acceleration expressed in world coordinates in rad/s2 [bool] keepForceCollinearity: Forces the resulting acceleration vector to be collinear to the acceleration parameter bool] keepTorqueCollinearity: Forces the resulting angular acceleration vector to be collinear to the angular acceleration parameter [string] priority1SubTags: Comma (for union) or space (for intersection) separated list of tags of included engines to use as priority 1 [string] priority2SubTags: Comma (for union) or space (for intersection) separated list of tags of included engines to use as priority 2 [string] priority3SubTags: Comma (for union) or space (for intersection) separated list of tags of included engines to use as priority 3 setEngineThrust([string] taglist, [float] thrust): Sets the thrust values for all engines in the tag list. This function must be used on a piloting controller [string] taglist: Comma separated list of tags. You can set tags directly on the engines in the right-click menu [float] thrust: The desired thrust in newtons (note that for boosters, any non zero value here will set them to 100%) NEW [table] getEngineThrust([string] taglist): Returns the total thrust values of all engines in the tag list. This function must be used on a piloting controller [string] taglist: Comma separated list of tags. You can set tags directly on the engines in the right-click menu return [float]: The total thrust in newtons setAxisCommandValue([int] axis, [float] commandValue): Set the value of throttle in the cockpit, which will be displayed in the cockpit widget when flying. This function must be used on a piloting controller [int] axis: Longitudinal = 0, lateral = 1, vertical = 2 [float] commandValue: In 'by throttle', the value of the throttle position: -1 = full reverse, 1 = full forward. Or In 'By Target Speed', the value of the target speed in km/h [float] getAxisCommandValue([int] axis,): Get the value of throttle in the cockpit. This function must be used on a piloting controller [int] axis: Longitudinal = 0, lateral = 1, vertical = 2 return [float]: In travel mode, return the value of the throttle position: -1 = full reverse, 1 = full forward or in cruise mode, return the value of the target speed setupAxisCommandProperties(axis, commandType, targetSpeedRanges): Set the properties of an axis command. This function must be used on a piloting controller. These properties will be used to display the command in UI. [int] axis: Longitudinal = 0, lateral = 1, vertical = 2 [int] commandType: By throttle = 0, by target speed = 1, hidden = 2 [table] targetSpeedRanges: This is to specify the cruise control target speed ranges (for now, only for the longitudinal axis) in m/s NEW [int] getControlMode(): Returns the current control mode. The mode is set by clicking the UI button or using the associated keybinding. This function must be used on a piloting controller return [int]: The current control mode (for now, only 2 are available, 0 and 1) DEPRECATED [int] getControlMasterModeId() → [table] getControlMode() cancelCurrentControlMasterMode(): Cancel the current master mode in use. This function must be used on a piloting controller [int] isMouseControlActivated(): Check if a mouse control scheme is selected. This function must be used on a piloting controller [int] isMouseDirectControlActivated(): Check if the mouse control direct scheme is selected. This function must be used on a piloting controller [int] isMouseVirtualJoystickActivated(): Check if the mouse control virtual joystick scheme is selected. This function must be used on a piloting controller activateGroundEngineAltitudeStabilization([float] targetAltitude): The ground engines will stabilize to this altitude within their limits. The stabilization will be done by adjusting thrust to never go over the target altitude. This includes VerticalBooster and HoverEngine. This function must be used on a piloting controller [float] targetAltitude: The stabilization target altitude in m [float] getSurfaceEngineAltitudeStabilization(): Return the ground engines' stabilization altitude. This function must be used on a piloting controller return [float]: Stab altitude in m or 0 if none is set deactivateGroundEngineAltitudeStabilization(): The ground engines will behave like regular engine. This includes VerticalBooster and HoverEngine. This function must be used on a piloting controller [table] computeGroundEngineAltitudeStabilizationCapabilities(): Returns ground engine stabilization altitude capabilities (lower and upper ranges). This function must be used on a piloting controller. return [table]: Stabilization altitude capabilities for the least powerful engine and the most powerful engine [float] getThrottle(): Return the current throttle value. This function must be used on a piloting controller. return [float]: Throttle value between -100 and 100 NEW [int] setWidgetControlModeLabel([int] modeId, [string] label): Set the label of a control mode buttons shown in the control unit widget. This function must be used on a piloting controller [int] modeId: The control mode: 0=Travel Mode, 1=Cruise Control by default [string] label: The display name of the control mode, displayed on the widget button DEPRECATED setupControlMasterModeProperties([int] modeId, [string] label) → setWidgetControlModeLabel([int] modeId, [string] label) NEW [int] isAnyLandingGearDeployed(): Checks if any landing gear is deployed return [int]: 1 if any landing gear is deployed DEPRECATED isAnyLandingGearExtended() → isAnyLandingGearDeployed() NEW deployLandingGears(): Deploy all landing gears DEPRECATED extendLandingGears() → deployLandingGears() retractLandingGears(): Retract all landing gears [int] isAnyHeadlightSwitchedOn(): Check construct lights status switchOnHeadlights(): Turn on the construct headlights switchOffHeadlights(): Turn off the construct headlights DEPRECATED [int] getMasterPlayerId() → [int] player.getId() DEPRECATED [table] getMasterPlayerOrgIds() → [table] player.getOrgIds() DEPRECATED [table] getMasterPlayerPosition() → [table] player.getPosition() DEPRECATED [table] getMasterPlayerWorldPosition() → [table] player.getWorldPosition() DEPRECATED [table] getMasterPlayerForward() → [table] player.getForward() DEPRECATED [table] getMasterPlayerUp() → [table] player.getUp() DEPRECATED [table] getMasterPlayerRight() → [table] player.getRight() DEPRECATED [table] getMasterPlayerWorldForward() → [table] player.getWorldForward() DEPRECATED [table] getMasterPlayerWorldUp() → [table] player.getWorldUp() DEPRECATED [table] getMasterPlayerWorldRight() → [table] player.getWorldRight() DEPRECATED [int] isMasterPlayerSeated() → [int] player.isSeated() DEPRECATED [int] getMasterPlayerSeatId() → [int] player.getSeatId() DEPRECATED [int] getMasterPlayerParent() → [int] player.getParent() DEPRECATED [float] getMasterPlayerMass() → [float] player.getMass() Events NEW onTimer([string] tag): Emitted when the timer with the tag 'tag' is ticking [string] tag: The tag of the timer that just ticked (see setTimer to set a timer with a given tag) DEPRECATED tick([string] timerId) → onTimer([string] tag)
  25. Container Containers are elements designed to store items and resources Functions [float] getSelfMass(): Returns the mass of the container element(as if it were empty). [float] getItemsMass(): Returns the container content mass(the sum of the mass of all items it contains). [float] getItemsVolume(): Returns the current hit points of the shield [float] getMaxVolume(): Returns the maximum volume of the container. NEW [table] getContent(): Returns a table describing the contents of the container, as a pair itemId and quantity per slot. return [table]: The content of the container as a table with fields {[int] id, [float] quantity} per slot DEPRECATED [table] getItemsList() → [table] getContent() NEW [float] updateContent(): Send a request to get an update of the content of the container, limited to one call allowed per 30 seconds. The onContentUpdate event is emitted by the container when the content is updated. NEW return [float]: If the request is not yet possible, returns the remaining time to wait for. DEPRECATED acquireStorage() → [float] updateContent() Events NEW onContentUpdate(): Emitted when the container content is updated(storage update or after a manual request made with updateContent()) DEPRECATED storageAcquired() → onContentUpdate()
×
×
  • Create New...