Jump to content


Alpha Team Vanguard
  • Posts

  • Joined

Everything posted by hdparm

  1. In a game that's described as "the space MMO entirely built and driven by the players", a currency issued by NPCs (quanta) should not be required for anything. Not for unlocking or changes recipes, not for territory upkeep, not for anything else. Quanta should only be used to optionally trade on NPC markets.
  2. Harvesting ore stones (that are spawned after calibrating mining units) requires players to hold the left mouse button a lot. For some players this causes wrist and/or finger pain/discomfort. Could surface ore harvesting be made more ergonomic? Mining tool had an auto-mine mode (toggled with the middle mouse button). Perhaps the harvest tool could have this mode too?
  3. A 4x4 voxel hole under the beam appears to be sufficient and does not obstruct. This works for me:
  4. Database is a wrapper around core and system functions. It doesn't return anything you couldn't get directly, and there is no function to get skills.
  5. Is there a new gameplay feature involving organization transponder tags? If I set tags aaa,bbb,ccc on a transponder on an organization's construct, how will system.getOrganizationTag decide what to return?
  6. The Lua atlas will be useful. But, is it a just a .lua file in Game/data/lua, which has to be updated manually (or with a script) by someone from NQ? It may be better (more future-proof) to have a system function that would generate the atlas at runtime from game data. system.getPlanetAtlas() could even return a JSON string, as the scripts would only need to parse it once.
  7. See what's inside the JSON string returned by weapon.getData().
  8. The Lua changes from this and previous devblogs are not in the game yet.
  9. Could radar.getConstructWorldPos(id) be extended to return position of any static (or stationary) construct in range? Popular flight scripts are already trilaterating construct positions based on distance (for collision avoidance), so it would mainly improve code efficiency/complexity.
  10. What about adding a single function that would take 3D world (or construct) coordinates and project them into 2D screen coordinates? It would cover most use cases (AR HUDs, custom location markers), and would also be faster than doing 3D projection math in Lua. Agreed. There are already at least 3 separate Lua APIs: 1) the control unit API, 2) the screen (render script) API, 3) the internal tutorial & achievement API. Adding one more (control unit API v2) shouldn't be impossible For compatibility with existing scripts (and consistency with other core.getParent* functions), could core.getWorldVelocity() always return absolute linear velocity, and velocity relative to parent be returned by a new function core.getParentRelativeWorldVelocity()? Same for core.getVelocity().
  11. There shouldn't be any skillpoint or quanta reward for the player who sent an invitation. Otherwise it's the same as buying skillpoints or quanta with real money (with an extra step).
  12. This bug happens when graphics mode is set to OpenGL instead of DirectX. If you're not on Windows 7 (which only supports OpenGL with DU), set graphics to DirectX and restart the game before using the map heavily (scanning territories, etc).
  13. @KuntChopsMcFrontButt Try this: local rgbColor = vec3(light.getRGBColor()) local r = rgbColor.x -- rgbColor["x"] would also work system.print(r) But, you don't really need vec3 here. When the codex says "vec3", it means an array-like table with 3 elements, not a cpml.vec3 instance. This should also work: local rgbColor = light.getRGBColor() local r = rgbColor[1] system.print(r)
  14. T4 and T5 schematic prices are still too high. For example, Warp Beacon schematic costs 841 292 033 quanta. Assuming an average miner can mine meganodes at 200 000 liters per hour and ore can be sold at 25 quanta per liter, it's 168 hours of non-stop mining.
  15. The function dump and the unofficial changelog have been updated for r0.23. Let me know if I missed any changes.
  16. This script stops your construct 80 km above a planet and holds it there with brakes. You lose less than 0.3 km of altitude per hour, so you can AFK for a day or two The script could be modified to use an AGG, but would it be useful?
  17. Do not modify existing files in Game/data/lua. If you do, EQU8 may kick you. Creating new files is allowed. EDIT: editing local .lua files is now allowed again.
  18. It's possible. What planet were you flying from? Could you record a video next time it happens? Also check the Lua chat tab for errors. EDIT: adding more vertical space engines apparently fixed this for Sunfyre.
  19. Many autopilot scripts exist, but most are not shared publicly. You may have to script it yourself
  20. About This is a basic autopilot script that can accelerate your construct towards a planet and later apply brakes to stop. Vertical space engines are used to control drift. Requirements Space brakes, 1.5+ g. Vertical space engines (pointing down), 0.3+ g. A remote controller or a separate hovercraft seat. Limitations No manual piloting. Use another script to get to space and to land. No collision avoidance. Make sure there are no planets, moons, asteroids, space stations or pirates between you and the destination. Planet positions are stored in the script. If NQ moves the planets, the script will have to be updated. Set-up With an auto-configuration schema (recommended) Download this file to Game\data\lua\autoconf\custom in your Dual Universe installation directory. By default it's C:\ProgramData\Dual Universe\Game\data\lua\autoconf\custom Right-click the control unit (a remote controller or a hovercraft seat) and select "Update custom autoconf list". This needs to be done only once. Right-click the control unit and select "Actions for this element", "Run custom autoconfigure", "Basic Space Autopilot". With a pasteable script configuration Open this link and copy everything to clipboard. Right-click the control unit (a remote control or a hover seat) and select "Actions for this element", "Paste Lua configuration from clipboard". The game should display a "Lua script loaded" message. If it did not, restart the game and copy the script configuration again. Link the core (required) and fuel tanks (optional) to the control unit. Credits Many planet positions were provided by @meigrafd from Hyperion. The script was bundled (amalgamated from multiple .lua files) using amalg. Change log 2020-09-23. Fixed heavy constructs not accelerating past 29997 km/h. A radar widget will be displayed if a PVP radar is linked (not available on remote controllers). Tested in r0.22.2. 2020-09-16. Posted the first version outside the NDA forums section. Tested in r0.21.6.
  21. About This is a short script that prints base max thrust of linked engines. It can serve as an example, and may also be used to detect which engines do not have a technician buff applied to them. Set-up Place a programming board. Link up to 10 engines to the programming board. In the Lua editor (right-click, "Advanced", "Edit Lua code") create a unit start() event handler with this code: -- detect linked engines local engines = {} for key, value in pairs(unit) do if type(value) == "table" and type(value.export) == "table" then -- `value` is an element and `key` is the slot name if value.getThrust and value.getMaxThrust then -- `value` is an engine engines[#engines + 1] = value end end end -- get engine names local engineNames = {} for _, engine in ipairs(engines) do -- engine name is available in its widget data -- for other elements `core.getElementNameById` would have to be used instead local dataJson = engine.getData() local data = json.decode(dataJson) engineNames[engine] = data.name or "???" end -- sort engines by name table.sort(engines, function (engine1, engine2) return engineNames[engine1] < engineNames[engine2] end) -- print engines and their base max thrust system.print("Linked engines: " .. #engines) for _, engine in ipairs(engines) do local name = engineNames[engine] local maxThrustBase = engine.getMaxThrustBase() system.print(string.format("%s: %.0f N", name, maxThrustBase)) end unit.exit() Click "Apply" in the Lua editor, exit build mode and activate the programming board. You should see base max thrust printed in the Lua chat tab. Change log 2020-09-13. Posted the first version (tested in r0.21.5).
  22. @FluxFaraday By default hover engines are "magicked" to produce thrust along gravity. This can be disabled by right-clicking the hover engine, selecting "Advanced" and "Disable Thrust Along Gravity". Vertical booster behavior can be changed too. You can right-click them and enable thrust along gravity.
  23. About This tool enables a somewhat different way of writing Dual Universe scripts. It takes a single Lua file that defines a global object with event handlers, and automatically generates a script configuration that can be pasted into a control unit. This allows writing the entire script outside the game, and automates away the need to manually set up each event handler. Prerequisites Some knowledge of Dual Universe Lua scripting (watch the official tutorial) Be able to run a Lua script from the command line. Download wrap.lua example-input.lua example-output.json Usage example Let's make a simple script that will react to key presses and display some text on a screen element. 1. Edit and save a Lua script in any plain text editor: -- Define a global script object with event handlers script = {} function script.onStart () -- Display some text screen.setCenteredText("script started") -- Create some timers to show that the script is working unit.setTimer("a", 2) -- timer id "a", ticks every 2 seconds unit.setTimer("b", 3) -- timer id "b", ticks every 3 seconds end function script.onStop () screen.setCenteredText("script stopped") end function script.onActionStart (actionName) screen.setCenteredText(actionName .. " key pressed") end function script.onActionStop (actionName) screen.setCenteredText(actionName .. " key released") end function script.onTick (timerId) screen.setCenteredText("timer " .. timerId .. " ticked") end -- Other events that are available by default: -- * onActionLoop(actionName): action key is held -- * onUpdate(): executed once per frame -- * onFlush(): executed 60 times per second, for physics calculations only; setEngineCommand must be called from here -- Slot events are available if slot type is set with the --slot command line option. function script.onMouseDown (x, y) screen.setCenteredText("mouse down: x=" .. x .. " , y=" .. y) end -- Call the start event handler -- Alternatively, initialization code can be placed anywhere in this file. -- The only requirement is that there is a global "script" object with event handlers script.onStart() Note: sometimes invalid characters are added when copying code from forums. If that happens, copy code from the provided link instead. 2. Run the packaging script: lua wrap.lua yourscript.lua yourscript.json --slots screen:type=screen --handle-errors --slots screen:type=screen sets first slot's name to screen and adds mouse down/up event support for that slot. --handle-errors adds error handling code, so that run-time Lua errors are displayed on the screen and in the Lua tab. 3. Open the resulting configuration file in a text editor, and copy everything to clipboard. 4. Inside Dual Universe, prepare a construct. There must be a programming board and a screen, and the screen must be linked into the programming board's slot 1. 5. Right-click on the programming board, select "Advanced", "Paste Lua configuration from clipboard". Done! The DU construct has been programmed without opening the in-game editor once. Activate the programming board and see if it works. Command line arguments Command line examples To produce a pasteable configuration for a custom piloting script: lua wrap.lua pilot.bundle.lua pilot.bundle.json --slots core gyro container_0 screen verticalEngine To produce a pasteable configuration for a radar script: lua wrap.lua radar.bundle.lua radar.bundle.json --handle-errors --default-slot type=pressable To produce an autoconf file for another custom piloting script: lua wrap.lua flight-enhancednav.bundle.lua flight-enhancednav.conf --output yaml --name "Airplane Cockpit (Enhanced)" --slots core:type=core gyro:type=gyro container:type=fuelContainer,select=all --handle-errors Known issues "Root node should be a map" This error is caused by wrong .conf file encoding. If you are using Powershell, the > operator saves the output with UCS-2 LE BOM encoding. Use cmd.exe instead, or replace > my.conf with | Out-File -Encoding UTF8 my.conf, or do not use output redirection, as the output file name can now be specified as an argument. Change log 2020-09-04. Posted the first version outside the NDA forums section. Output can now be written to a file without using output redirection. Credits This tool uses argparse and dkjson libraries, and was bundled using amalg.
  24. Unofficial Lua changelog r0.23.0 Changes since r0.22.4: All elements New functions: getMaxRestorations(), getRemainingRestorations(). Anti-Gravity Generator setBaseAltitude(altitude) no longer works inside the system flush() event. Container (Fuel and Item) New event: storageAcquired(). New functions: acquireStorage(), getItemsList(), getItemsVolume(), getMaxVolume(). Control unit New function: getMasterPlayerRelativeOrientation(). Restored function: setupControlMasterModeProperties(controlMasterModeId,displayName). Core New functions: getElementIndustryStatus(localId), getSchematicInfo(schematicId). Emitter and Receiver Range increased to 1000 m. Industry New functions: getCurrentSchematic(), setCurrentSchematic(id). Light New functions: getRGBColor(), setRGBColor(r,g,b). System New event: inputText(text). New functions: getFov(), getScreenHeight(), getScreenWidth(), getWaypointFromPlayerPos(), setWaypoint(waypointStr). Warp drive Removed function: activateWarp(). r0.22.4 Changes since r0.22.0: Core New functions: getElementPositionById(localId), getElementRotationById(localId), getElementTagsById(localId). Other global.lua is now inside game.ung and cannot be edited by players. Editing existing files in Game/data/lua should no longer trigger the EQU8 anti-cheat. r0.22.0 Changes since r0.21.3: PVP radar New functions: getConstructName(id), getConstructPos(id), getConstructSize(id), getConstructType(id), getEntries(), getRange(), hasMatchingTransponder(id). The getConstruct* functions return "unreachable" or { 0, 0, 0 }, even for construct information that's available in getData(). New events: enter(id), leave(id). r0.21.3 Changes since r0.21.2: Other package.loadlib has been disabled. r0.21.2 Changes since r0.20.0: Anti-Gravity Generator New function: getBaseAltitude(). PVP radar getData() no longer returns construct positions. Other pcall and xpcall can no longer be used to avoid the CPU instruction limit.
  25. OUTDATED. NOT UPDATED SINCE v0.23.0 This is the result of running the globals dumping script in-game on constructs that had various elements attached to them. Some exposed functions were called with pcall. The first value indicates whether the call was successful, the second is the actual function return value. All functions that return a vector return it as a table, not as a vec3 structure. Usually such functions will be called like this: local worldGravity = vec3(core.getWorldGravity()). Boolean values are returned as a number 0 or 1, and not as true or false. Element events are not listed here, as they cannot be detected by the dump.lua script. See the codex in-game (press F1) or outside the game (C:\ProgramData\Dual Universe\Game\documentation\web_codex.html) for event and function descriptions and other information. Anti-Gravity Generator r0.21.0 Control unit r0.23.0 Programming board exposes fewer functions compared to cockpit and seat. The control unit has references to linked elements, which are also available as local variables in each event handler. Event handlers defined in the script editor also get placed inside it. Here the control unit is a hovercraft seat that has 2 linked fuel tanks, a radar and a core. Core r0.23.0 Static cores have fewer functions compared to dynamic cores. Databank r0.21.2 Elements with a state r0.21.2 Detection areas, laser detectors and manual buttons expose the same functions. Their state is accessed using getState(). Elements with a toggle-able state r0.21.2 Force fields, ship doors, landing gears and manual switches expose the same functions. The state is accessed using getState() and can be changed by activate(), deactivate() or toggle(). Emitter r0.23.0 Engine r0.21.0 Space engines, atmospheric engines, ailerons, air-brakes, retro-engines and adjustors expose the same functions. Usually engines are controlled through unit.setEngineCommand and do not require linking to the control unit. Fuel container r0.23.0 Gyro r0.21.2 Industry r0.23.0 Item container r0.23.0 Library r0.21.2 Light r0.23.0 PVP radar (atmospheric and space) r0.22.0 Radar not available to craft or buy; for atmosphere and space radars see PVP radar instead Receiver r0.23.0 Screen r0.21.2 System r0.23.0 Telemeter r0.21.2 Warp Drive r0.23.0 Weapon r0.21.0
  • Create New...