Jump to content

NQ-Ligo

Developer
  • Posts

    57
  • Joined

  • Last visited

Everything posted by NQ-Ligo

  1. Hello everyone, I'll try to answer the questions above, but please understand that the fact that the booleans were not correctly binded was a real problem, both in the background and on the player side. Converting and/or comparing to an integer each time is far from optimal. In addition, default values, particularly useful for managing optional arguments (as you saw with the radar for 1.4 on this previous devblog) will now be better managed, saving a lot of operations in the DU code. It's important to understand that Booleans aren't just 0's and 1's behind the scenes, it's all about memory management and optimization. This problem has been in DU for a long time, in fact I've put off fixing it as long as possible so as not to break your scripts. However, this Lua polishing update to 1.4 required this fix, both for some additions, and to improve performance; and also to allow you to improve your performance. As far as major scripts or systems are concerned, I'm fully aware of the problem, and that's why I've tried to be in direct contact with their creators to prepare the transition as well as possible; even if it's clear that I can't do this for all scripts, I want to limit the damage to the community as much as possible. I'm also aware that this won't reassure everyone, and that some scripts you probably use a lot will be impacted. Thank you for your understanding. NQ-Ligo
  2. Just to make sure it's not misunderstood. When I talk about content creation, I'm talking about User Generated Content. As @Wyndle says, it's more about systems/tools that allow you to create services, cities, events ...etc. But of course we also work on gameplay
  3. I can confirm that there is still some development going on on the Lua feature. Don't worry, there are many things planned that have already been exposed to the Lua community; it just may take some time or wait for the integration of other features (like for example the known issue of remainingSchematics that will be solved with the integration of another feature soon). But no no, I'm still here and still working on extending the possibilities of Lua especially for content creation.
  4. This could be a very interesting idea. I will share it with the team.
  5. The schematicId field is deprecated, so return always 0, it's a relic of the industry API before the new schematics were implemented. For the known issue with updating schematicsRemaining field, we still have some work to do on the server, it will be fixed as soon as possible.
  6. As explained in your stream this afternoon, the currentProductAmount is the amount of products produced by the industry since the last startup. However, there does seem to be a problem with the numbers being too high. I will check this with the server team.
  7. I had planned to add the required number of schemas to the table returned by getRecipes, so this will certainly be added.
  8. This is a good topic and good ideas. Redesigning the databank element is on the table for many reasons, including the impact on performances. However, I can't promise when, how...etc but it will certainly address some of the points in your suggestion.
  9. As replied by @Yoarii, our goal is not to have everything accessible on the screen units. However, we have already discussed internally to have time related functions in the screen units. And we have also discussed adding a different IO for local use for larger data packages. Obviously, I can't promise anything, but know that these are things we have in mind.
  10. To be more concrete, you can already link the axis inputs on different bindings in the game, like the look for example. But for the whole piloting gameplay, which needs joystick/hots support, we have to implement it properly on different levels, additional settings and C++/lua integration. My bad if my answer was not clear.
  11. To answer your question, Dual Universe does have Joystick and Hotas support in the true sense of the word. Nevertheless, their integration in the gameplay, especially the piloting, requires some adjustments, additions and changes. This is something we want to integrate but it will probably only be integrated post-release.
  12. @space_man I have identified your problem. Indeed, we did not add the depreciation of the getStatus function. We're fixing it for the Mercury update. Please report this type of problem to support next time to let us know that it happens.
  13. Hi Noveans ! First of all thank you for telling us what you think of the additions and changes exposed in the devblog (although this is only a selection) and the global direction we chosen for the Lua feature, before you even formulate serial requests. Thanks Secondly, please understand that some changes can be much more complicated than they seem, especially due to architecture choices for the Lua binding made many years ago. Many of the changes require substantive changes and others are planned as general changes. Concerning the offline CODEX, it turns out that there were multiple reasons for its removal including maintainability issues, anyway, I just published the API mockup for the 0.30 Mercury on our official github to allow you to have it updated, here: https://github.com/dual-universe/lua-examples Moreover, a detailed thread is being finalized as exposed on the devblog, it will give you a much more detailed view of the changes by telling you what is new, by what has been replaced such or such function ... etc Regarding deprecation @space_man, it is a complete deprecation, nothing has been removed or changed without deprecation. I personally followed the Lua players tests to make sure that everything was working well, especially with the community custom systems like ArchHud. No concerns about deprecation have been reported. When a change of return type was made, we deprecated the old one and changed the name of the new one to avoid any problems. If any problem appeared, please report it to us with a ticket. Concerning the suggestions @P4rty_Boy, as always, I'll be happy to discuss them on a specific thread where you can tag me to explain them in more details. Overall, I really hope that all the changes will please and show the interest of Lua for us, many of them are not listed in this devblog and will be clearer on the detailed thread. Thank you.
  14. NEW Weapon Displays information about the weapon's state Functions NEW [int] getAmmo(): Returns the item id of the currently equipped ammo NEW [int] getAmmoCount(): Returns the current amount of remaining ammunition NEW [int] getMaxAmmo(): Returns the maximum amount of ammunition the weapon can carry NEW [int] isOutOfAmmo(): Checks if the weapon is out of ammo NEW [int] isOperational(): Checks if the weapon is operational NEW [int] getStatus(): Returns the current weapon status return [int]: The current status of the weapon (Idle = 1, Firing = 2, Reloading = 3, Unloading = 4) NEW [int] getContainerId(): Returns the local id of the container linked to the weapon NEW [float] getHitProbability(): Returns the current hit probability of the weapon for the current target NEW [float] getBaseDamage(): Returns the base weapon damage NEW [float] getOptimalAimingCone(): Returns the optimal aim cone NEW [float] getOptimalDistance(): Returns the optimal distance to target NEW [float] getMaxDistance(): Returns the maximum distance to target NEW [float] getOptimalTracking(): Returns the optimal tracking rate NEW [float] getMagazineVolume(): Returns the magazine volume NEW [float] getCycleTime(): Returns the weapon cycle time NEW [float] getReloadTime(): Returns the weapon reload time NEW [float] getUnloadTime(): Returns the weapon unload time NEW [float] getTargetId(): Returns the id of the current target construct of the weapon Events NEW onReload([int] ammoId): Emitted when the weapon start reloading [int] ammoId: The item id of the ammo NEW onReloaded([int] ammoId): Emitted when the weapon has reloaded [int] ammoId: The item id of the ammo NEW onMissed([int] targetId): Emitted when the weapon has missed its target [int] targetId: The construct id of the target NEW onDestroyed([int] targetId): Emitted when the weapon target has been destroyed [int] targetId: The construct id of the target NEW onElementDestroyed([int] targetId, [int] itemId): Emitted when an element on the weapon target has been destroyed [int] targetId: The construct id of the target [int] itemId:The item id of the destroyed element NEW onHit([int] targetId, [float] damage): Emitted when the weapon has hit [int] targetId: The construct id of the target [int] damage: The damage amount dealt by the hit
  15. Warp Drive Based on the principle of the Alcubierre drive, this unit creates a powerful negative energy-density field capable of distorting space-time and transport your ship at hyper speeds through space. Functions NEW initiate(): Initiate the warp jump process NEW [int] getStatus(): Returns the current status of the warp drive return [int]: The current status of the warp drive (NoWarpDrive = 1, Broken = 2, Warping = 3, ParentWarping = 4, NotAnchored = 5, WarpCooldown = 6, PvPCooldown = 7, MovingChild = 8, NoContainer = 9, PlanetTooClose = 10, DestinationNotSet = 11, DestinationTooClose = 12, DestinationTooFar = 13, NotEnoughWarpCells = 14, Ready = 15) NEW [float] getDistance(): Returns the distance to the current warp destination NEW [int] getDestination(): Returns the construct ID of the current warp destination NEW [string] getDestinationName(): Returns the name of the current warp destination construct NEW [int] getContainerId(): Returns the local id of the container linked to the warp drive NEW [int] getAvailableWarpCells(): Returns the quantity of warp cells available in the linked container NEW [int] getRequiredWarpCells(): Returns the quantity of warp cells required to warp to the warp destination set
  16. NEW Vertical Boosters Vertical boosters are engines designed to produce powerful vertical thrust over a limited distance. They consume space fuel but operate in the atmosphere and in the space void. 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
  17. Transponder Broadcasts data to radars, that can access more information if their transponder tags are matching Functions activate(): Activate the transponder deactivate(): Deactivate the transponder toggle(): Toggle the state of the transponder [int] isActive(): Checks if the transponder is active DEPRECATED [int] getState() → [int] isActive() [int] setTags(): Set the tags list with up to 8 entries. Returns 1 if the application was successful, 0 if the tag format is invalid. [table] tags: List of up to 8 transponder tag strings [table] getTags(): Returns the tag list return [table]: List of up to 8 transponder tag strings Events NEW onToggled([int] active): Emitted when the transponder is started or stopped [int] active: 1 if the element was activated, 0 otherwise DEPRECATED toggled([int] active) → onToggled([int] active)
  18. Telemeter Measures the distance to an obstacle in front of it. Functions DEPRECATED [float] getDistance() → [float] raycast().Distance NEW [table] raycast(): Emits a raycast from the telemeter, returns a raycastHit object return [table]: A table with fields : {[bool] hit, [float] distance, [vec3] point} NEW [table] getRayOrigin(): Returns telemeter raycast origin in local construct coordinates NEW [table] getRayWorldOrigin(): Returns telemeter raycast origin in world coordinates NEW [table] getRayAxis(): Returns telemeter raycast axis in local construct coordinates NEW [table] getRayWorldAxis(): Returns telemeter raycast axis in world coordinates NEW [table] getMaxDistance(): Returns the max distance from which an obstacle can be detected (default is 100m)
  19. System System is a virtual Element that represents your computer. It gives access to events like key strokes or mouse movements that can be used inside your scripts. It also gives you access to regular updates that can be used to pace the execution of your script Functions [string] getActionKeyName([string] actionName): Return the currently key bound to the given action. Useful to display tips. [string] actionName: The action name, represented as a string taken among the set of predefined Lua-available actions (you can check the drop down list to see what is available) return [string]: The key associated to the given action name showScreen([bool] bool): Control the display of the Control Unit custom screen, where you can define customized display information in HTML. 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] bool: True to show the screen, false to hide the screen setScreen([string] content): Set the content of the Control Unit custom screen with some HTML code. 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). [string] content: The HTML content you want to display on the screen widget. You can also use SVG here to make drawings. [string] createWidgetPanel([string] label): Create an empty panel. 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). [string] label: The title of the panel return [string]: The panel ID, or "" on failure [int] destroyWidgetPanel([string] panelId): Destroy the panel. 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). [string] panelId: The panel ID return [int]: 1 on success, 0 on failure. [string] createWidget([string] panelId, [string] type): Create an empty widget and add it to a panel. 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). [string] panelId: The panel ID [string] type: Widget type, determining how it will display data attached to ID return [string]: The widget ID, or "" on failure. [int] destroyWidget([string] widgetId): Destroy the widget. 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). [string] widgetId: The widget ID return [int]: 1 on success, 0 on failure. [string] createData([string] dataJson): Create data. 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). [string] dataJson: The data fields as JSON return [string]: The data ID, or "" on failure. [int] destroyData([string] dataId): Destroy the data. 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). [string] dataId: The data ID return [int]: value 1 on success, 0 on failure. [int] updateData([string] dataId, [string] dataJson): Update JSON associated to data. 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). [string] dataId: The data ID [string]dataJson: The data fields as JSON return [int]: value 1 on success, 0 on failure. [int] addDataToWidget([string] dataId, [string] widgetId): Add data to widget.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). [string] dataId: The data ID [string] widgetId : The widget ID return [int]: value 1 on success, 0 on failure. [int] removeDataFromWidget([string] dataId, [string] widgetId ): Remove data from widget. 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). [string] dataId: The data ID [string] widgetId : The widget ID return [int]: value 1 on success, 0 on failure. [float] getMouseWheel(): Return the current value of the mouse wheel [float] getMouseDeltaX(): Return the current value of the mouse delta X [float] getMouseDeltaY(): Return the current value of the mouse delta Y [float] getMousePosX(): Return the current value of the mouse pos X [float] getMousePosY(): Return the current value of the mouse pos Y [float] getMouseSensitivity(): Return the value of mouse sensitivity game setting [float] getScreenHeight(): Return the current value of the screen height [float] getScreenWidth(): Return the current value of the screen width [float] getCameraHorizontalFov(): Return the current value of the player's horizontal field of view [float] getCameraVerticalFov(): Return the current value of the player's vertical field of view [int] getCameraMode(): Returns the active camera mode. return [int]: 1: First Person View, 2: Look Around Construct View, 3: Follow Construct View [int] isFirstPerson(): Checks if the active camera is in first person view. [int] getCameraPos(): Returns the position of the camera, in construct local coordinates. [int] getCameraWorldPos(): Returns the position of the camera, in world coordinates. [int] getCameraForward(): Returns the forward direction vector of the active camera, in construct local coordinates. [int] getCameraRight(): Returns the right direction vector of the active camera, in construct local coordinates. [int] getCameraUp(): Returns the up direction vector of the active camera, in construct local coordinates. [int] getCameraWorldForward(): Returns the forward direction vector of the active camera, in world coordinates. [int] getCameraWorldRight(): Returns the right direction vector of the active camera, in world coordinates. [int] getCameraWorldUp(): Returns the up direction vector of the active camera, in world coordinates. [float] getThrottleInputFromMouseWheel(): Return the current value of the mouse wheel (for the throttle speedUp/speedDown action). This value will go through the control scheme, devices and sensitivity [float] getControlDeviceForwardInput(): Return the mouse input for the ship control action (forward/backward). This value will go through the control scheme, devices and sensitivity [float] getControlDeviceYawInput(): Return the mouse input for the ship control action (yaw right/left). This value will go through the control scheme, devices and sensitivity [float] getControlDeviceLeftRightInput(): Return the mouse input for the ship control action (right/left). This value will go through the control scheme, devices and sensitivity lockView([bool] state): Lock or unlock the mouse free look. [int] isViewLocked(): Return the lock state of the mouse free look DEPRECATED freeze([int] state) → player.freeze([bool] state) DEPRECATED [int] isFrozen() → [int] player.isFrozen() [float] getArkTime(): Return the current time since the arrival of the Arkship on September 30th, 2017 [float] getUtcTime(): Return the current time since January 1st, 1970. [float] getUtcOffset(): Return the time offset between local timezone and UTC NEW [string] getLocale(): Return the locale in which the game is currently running return [string]: The locale, currently one of "en-US", "fr-FR", or "de-DE" [float] getActionUpdateDeltaTime(): Return delta time of action updates (to use in ActionLoop) return [float]: The delta time in second [string] getPlayerName([int] id): Return the name of the given player, if in range of visibility or broadcasted by a transponder [int] id: The ID of the player return [string]: The name of the player [table] getPlayerWorldPos([int] id): Return the world position of the given player, if in range of visibility [int] id: The ID of the player return [table]: The coordinates of the player in world coordinates [table] getItem([int] id): Return the item table corresponding to the given item ID. [int] id: The ID of the item return [table]: An item table with fields: {[integer] id, [string] name, [string] displayName, [string] locDisplayName, [string] displayNameWithSize, [string] locDisplayNameWithSize, [string] description, [string] locDescription, [string] type, [number] unitMass, [number] unitVolume, [integer] tier, [string] scale, [string] iconPath} NEW [table] getSchematic([int] id): Returns the schematic table corresponding to the given schematic ID [int] id: The Schematic Id, as returned for example by the getCurrentSchematic industry Lua API return [table]: A schematic table with field: {[integer] id, [integer] tier,[integer] time, products:{{[integer] id, [double] quantity},...}, components:{{[integer] id, [double] quantity},...}} NEW [table] getOrganization([int] id): Returns the corresping organization to the given organization id, if known, e.g. broadcasted by a transponder [int] id: The ID of the organization return [table]: A table containing information about the given organization {[string] name, [string] tag} DEPRECATED [string] getOrganizationName([int] id) → [string] getOrganization([int] id).name DEPRECATED [string] getOrganizationTag([int] id) → [string] getOrganization([int] id).tag [string] getWaypointFromPlayerPos(): Return the player's world position as a waypoint string, starting with '::pos' (only in explicit runs) NEW setWaypoint([string] waypointStr, [bool] notify): Set a waypoint at the destination described by the waypoint string, of the form '::pos{...}' (only in explicit runs) [string] waypointStr: The waypoint as a string NEW [bool] notify: (Optional) True to display a notification on waypoint change NEW clearWaypoint([bool] notify): Clear the active destination waypoint. (only in explicit runs)' NEW [bool] notify: (Optional) True to display a notification about the waypoint's clearing showHelper([bool] show): Set the visibility of the helper top menu. playSound([string] filePath): Play a sound file from your audio folder (located in "My documents/NQ/DualUniverse/audio"). Only one sound can be played at a time. filePath: Relative path to audio folder (.mp3, .wav) NEW [int] isPlayingSound(): Checks if a sound is playing stopSound(): Stop the current playing sound Events NEW onActionStart([string] action): Emitted when an action starts [string] action: The action name, represented as a string taken among the set of predefined Lua-available actions (you can check the drop down list to see what is available) DEPRECATED actionStart([string] action) → onActionStart([string] action) NEW onActionStop([string] action): Emitted when an action stops [string] action: The action name, represented as a string taken among the set of predefined Lua-available actions (you can check the drop down list to see what is available) DEPRECATED actionStop([string] action) → onActionStop([string] action) NEW onActionLoop([string] action): Emitted at each update as long as the action is maintained [string] action: The action name, represented as a string taken among the set of predefined Lua-available actions (you can check the drop down list to see what is available) DEPRECATED actionLoop([string] action) → onActionLoop([string] action) NEW onUpdate(): Game update event. This is equivalent to a timer set at 0 seconds, as updates will go as fast as the FPS can go DEPRECATED update() → onUpdate() NEW onFlush(): Game update event. This is equivalent to a timer set at 0 seconds, as updates will go as fast as the FPS can go DEPRECATED flush() → onFlush() NEW onInputText([string] text): A new message has been entered in the Lua tab of the chat, acting like a command line interface DEPRECATED inputText([string] text) → onInputText([string] text) NEW onCameraChanged([int] mode): Emitted when the player changes the camera mode. DEPRECATED cameraChanged([int] mode) → onCameraChanged([int] mode)
  20. NEW Space Engines Space engines are engines designed to operate optimally in the space void. 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] 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 DEPRECATED getDistance() → No reason to keep it from Engine API, only works for hover engines and vertical boosters
  21. NEW Space Brake Space brakes are retro-rocket elements designed to produce thrust opposite to the movement of a construct in space, acting as a space brake. It that can be used to slow down your construct. Functions activate(): Start the brake at full power (works only when run inside a cockpit or under remote control) deactivate(): Stops the brake (works only when run inside a cockpit or under remote control) NEW [int] isActive(): Checks if the brake is active DEPRECATED [int] getState() → isActive() toggle(): Toggle the state of the brake setThrust([float] thrust): Set the thrust of the brake. Note that brakes can generate a force only in the movement opposite direction [float] thrust: The brake thrust in newtons (limited by the maximum thrust) [float] getThrust(): Returns the current thrust of the brake NEW [float] getMaxThrust(): Returns the maximal thrust the brake can deliver in principle, under optimal conditions. DEPRECATED [float] getMaxThrustBase() → getMaxThrust() NEW [float] getCurrentMinThrust(): Returns the minimal thrust the brake 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 brake can deliver at the moment, which might depend on various conditions like atmospheric density, obstruction, orientation, etc. DEPRECATED [float] getMaxThrust() → getCurrentMaxThrust() [float] getMaxThrustEfficiency(): Returns the ratio between the current maximum thrust and the optimal maximum thrust NEW [vec3] getThrustAxis(): Returns the brake thrust direction in construct local coordinates NEW [vec3] getWorldThrustAxis(): Returns the brake thrust direction in world coordinates DEPRECATED [vec3] thrustAxis() → getWorldThrustAxis() [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 DEPRECATED [int] isOutOfFuel() → No reason to keep it from Engine API DEPRECATED [int] hasFunctionalFuelTank() → No reason to keep it from Engine API DEPRECATED [float] getCurrentFuelRate() → No reason to keep it from Engine API DEPRECATED [float] getFuelRateEfficiency() → No reason to keep it from Engine API DEPRECATED [float] getFuelConsumption() → No reason to keep it from Engine API DEPRECATED [float] getDistance() → No reason to keep it from Engine AP DEPRECATED [float] getT50() → No reason to keep it from Engine API DEPRECATED [float] torqueAxis() → No reason to keep it from Engine API
  22. NEW Screen Unit Screens can display any HTML code or text message, and you can use them to create visually interactive feedback for your running Lua script by connecting one or more of them to your Control Unit. Functions activate(): Switch on the screen deactivate(): Switch off the screen NEW [int] isActive(): Checks if the screen is on DEPRECATED [int] getState() → [int] isActive() toggle(): Toggle the state of the screen [int] addText([float] x,[float] y,[float] fontSize,[string] text): Displays the given text at the given coordinates in the screen, and returns an ID to move it later [float] x: Horizontal position, as a percentage (between 0 and 100) of the screen width [float] y: Vertical position, as a percentage (between 0 and 100) of the screen height [float] fontSize: Text font size, as a percentage of the screen width [string] text: The text to display return [int]: An integer ID that is used to identify the Element in the screen. Methods such as setContent return the id that you can store to use later here setCenteredText([string] text): Displays the given text centered in the screen with a font to maximize its visibility [string] text: The text to display setHTML([string] html): Set the whole screen HTML content (overrides anything already set) [string] html: The HTML content to display setRenderScript([string] script): Set the screen render script, switching the screen to native rendering mode [string] script: The Lua render script setScriptInput([string] input): Defines the input of the screen rendering script, which will be automatically defined during the execution of Lua [string] input: A string that can be retrieved by calling getInput in a render script clearScriptOutput(): Set the screen render script output to the empty string [string] getScriptOutput(): Get the screen render script output return [string]: The contents of the last render script setOutput call, or an empty string [int] addContent([float] x, [float] y, [string] html): Displays the given HTML content at the given coordinates in the screen, and returns an ID to move it later [float] x: Horizontal position, as a percentage (between 0 and 100) of the screen width [float] y: Vertical position, as a percentage (between 0 and 100) of the screen height [string] html: The HTML content to display, which can contain SVG elements to make drawings return [int]: An integer ID that is used to identify the html element in the screen. setSVG([string] svg): Displays SVG code (anything that fits within a <svg> section), which overrides any preexisting content [string] svg: The SVG content to display, which fits inside a 1920x1080 canvas resetContent([int] id, [string] html): Update the html element with the given ID (returned by addContent) with a new HTML content [int] id: An integer ID that is used to identify the html element in the screen. Methods such as addContent return the ID that you can store to use later here [string] html: The HTML content to display, which can contain SVG elements to make drawings deleteContent([int] id): Delete the html element with the given ID (returned by addContent) [int] id: An integer ID that is used to identify the html element in the screen. Methods such as addContent return the id that you can store to use later here showContent([int] id, [bool] state): Update the visibility of the html element with the given ID (returned by addContent) [int] id: An integer ID that is used to identify the html element in the screen. Methods such as addContent return the ID that you can store to use later here [bool] state: true to show the content, false to hide moveContent([int] id, [float] x, [float] y): Move the html element with the given id (returned by addContent) to a new position in the screen [int] id: An integer id that is used to identify the html element in the screen. Methods such as addContent return the ID that you can store to use later here [float] x: Horizontal position, as a percentage (between 0 and 100) of the screen width [float] y: Vertical position, as a percentage (between 0 and 100) of the screen height [float] getMouseX(): Returns the x-coordinate of the position point at in the screen return [float]: The x-position as a percentage (between 0 and 1) of screen width; -1 if nothing is point at [float] getMouseY(): Returns the y-coordinate of the position point at in the screen return [float]: The y-position as a percentage (between 0 and 1) of screen height; -1 if nothing is point at [int] getMouseState(): Returns the state of the mouse click return [int]: 1 if the mouse is pressed, otherwise 0 clear(): Clear the screen Events NEW onMouseDown([float] x, [float] y): Emitted when the player starts a click on the screen [float] x: X-coordinate of the click in percentage (between 0 and 1) of the screen width [float] y: Y-coordinate of the click in percentage (between 0 and 1) the screen height DEPRECATED mouseDown([float] x, [float] y) → onMouseDown([float] x, [float] y) NEW onMouseUp([float] x, [float] y): Emitted when the player releases a click on the screen [float] x: X-coordinate of the click in percentage (between 0 and 1) of the screen width [float] y: Y-coordinate of the click in percentage (between 0 and 1) the screen height DEPRECATED mouseUp([float] x, [float] y) → onMouseUp([float] x, [float] y) NEW onOutputChanged([string] output): Emitted when the output of the screen is changed [string] output: The output string of the screen
  23. NEW Rocket Engines Rocket engines are engines capable of producing enormous thrust in a short period of time. They consume fuel but do not need time to warm up. 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] 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 DEPRECATED getDistance() → No reason to keep it from Engine API, only works for hover engines and vertical boosters
  24. Receiver Receives messages on the element's channels Functions [float] getRange(): Returns the receiver range [int] hasChannel([string] channel): Checks if the given channel exists in the receiver channels list [string] channel: The channels list as Lua table NEW [int] setChannelList([table] channels): Set the channels list [table] channels: The channels list as Lua table return [int]: 1 if the channels list has been successfully set DEPRECATED setChannels([string] channels) → [int] setChannelList([table] channels) NEW [table] getChannelList(): Returns the channels list [table] channels: The channels list as Lua table DEPRECATED [string] getChannels() → [table] getChannelList() Events NEW onReceived([string] channel, [string] message): Emitted when a message is received on any channel defined on the element [string] channel: The channel; can be used as a filter [string] message: The message received DEPRECATED receive([string] channel, [string] message) → onReceived([string] channel, [string] message)
  25. Radar Get information about the Radar and its current targets Functions [int] isOperational(): Returns 1 if the radar is not broken, works in the current environment and is not used by another control unit [float] getRange(): Returns the scan range of the radar [table] getIdentifyRanges(): Returns ranges to identify a target based on its core size return [table]: The list of float values for ranges in meters as { xsRange, sRange, mRange, lRange } [table] getConstructIds(): Returns the list of construct IDs in the scan range [table] getIdentifiedConstructIds(): Returns the list of identified construct IDs [int] getTargetId(): Returns the ID of the target construct [float] getConstructDistance([int] id): Returns the distance to the given construct [int] id: The ID of the construct [int] isConstructIdentified([int] id): Returns 1 if the given construct is identified [int] id: The ID of the construct [int] isConstructAbandoned([int] id): Returns 1 if the given construct was abandoned [int] id: The ID of the construct [string] getConstructCoreSize([int] id): Returns the core size of the given construct [int] id: The ID of the construct return [string]: The core size name; can be 'XS', 'S', 'M', 'L', 'XL' NEW [int] getThreatRateTo([int] id): Returns the threat rate your construct is for the given construct [int] id: The ID of the construct return [int]: The threat rate index (None = 1, Identified = 2, Threatened and identified = 3, Threatened = 4, Attacked = 5), can be -1 if the radar is not operational DEPRECATED [int] getThreatTo([int] id) → [int] getThreatRateTo([int] id) NEW [int] getThreatRateFrom([int] id): Returns the threat rate the given construct is for your construct [int] id: The ID of the construct return [int]: The threat rate index (None = 1, Identified = 2, Threatened and identified = 3, Threatened = 4, Attacked = 5), can be -1 if the radar is not operational DEPRECATED [string] getThreatFrom([int] id) → [int] getThreatRateFrom([int] id) [int] hasMatchingTransponder([int] id): Returns whether the target has an active Transponder with matching tags [int] id: The ID of the construct NEW [table] getConstructOwnerEntity([int] id): Returns a table with id of the owner entity (player or organization) of the given construct, if in range and if active transponder tags match for owned dynamic constructs. [int] id: The ID of the construct return [table]: A table with fields {[int] id, [bool] isOrganization} describing the owner. Use system.getPlayerName(id) and system.getOrganization(id) to retrieve info about it DEPRECATED [int] getConstructOwner([int] id) → [int] getConstructOwnerEntity([int] id) [table] getConstructSize([int] id): Return the size of the bounding box of the given construct, if in range [int] id: The ID of the construct NEW [int] getConstructKind([int] id): Return the kind of the given construct [int] id: The ID of the construct return [int]: The kind index of the construct (Universe = 1, Planet = 2,Asteroid = 3,Static = 4,Dynamic = 5,Space = 6,Alien = 7) DEPRECATED [string] getConstructType([int] id) → [int] getConstructKind([int] id) [table] getConstructPos([int] id): Returns the position of the given construct in construct local coordinates, if active transponder tags match for owned dynamic constructs [int] id: The ID of the construct [table] getConstructWorldPos([int] id): Returns the position of the given construct in world coordinates, if in range and if active transponder tags match for owned dynamic constructs [int] id: The ID of the construct [table] getConstructVelocity([int] id): Returns the velocity vector of the given construct in construct local coordinates, if identified and if active transponder tags match for owned dynamic constructs [int] id: The ID of the construct [table] getConstructWorldVelocity([int] id): Returns the velocity vector of the given construct in world coordinates, if identified and if active transponder tags match for owned dynamic constructs [int] id: The ID of the construct [float] getConstructMass([int] id): Returns the mass of the given construct, if identified for owned dynamic constructs [int] id: The ID of the construct return [float]: The mass of the construct in kilograms [string] getConstructName([int] id): Return the name of the given construct, if defined [int] id: The ID of the construct [table] getConstructInfos([int] id): Returns a table of working elements on the given construction, if identified for owned dynamic constructs [int] id: The ID of the construct return [table]: A table with fields : {[float] weapons, [float] radars, [float] antiGravity, [float] atmoEngines, [float] spaceEngines, [float] rocketEngines} with values between 0.0 and 1.0. Exceptionally antiGravity and rocketEngines are always 1.0 if present, even if broken [float] getConstructSpeed([int] id): Returns the speed of the given construct, if identified for owned dynamic constructs [int] id: The ID of the construct return [float]: The speed of the construct relative to the universe in meters per second [float] getConstructAngularSpeed([int] id): Returns the angular speed of the given construct to your construct, if identified for owned dynamic constructs [int] id: The ID of the construct return [float]: The angular speed of the construct relative to our construct in radians per second [float] getConstructRadialSpeed([int] id): Returns the radial speed of the given construct to your construct, if identified for owned dynamic constructs [int] id: The ID of the construct return [float]: The radial speed of the construct relative to our construct in meters per secon Events NEW onEnter([int] id): Emitted when a Construct enters the scan range of the radar DEPRECATED enter() → onEnter([int] id) NEW onLeave([int] id): Emitted when a construct leaves the range of the radar DEPRECATED leave() → onLeave([int] id) NEW onIdentified([int] id): Emitted when a construct is identified
×
×
  • Create New...