Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Starting Zone (EN)
    • Rules & Announcements
    • General Discussions
    • Off Topic Discussions
  • Starting Zone (DE)
    • Regeln und Ankündigungen
    • Novark's Registratur
    • Allgemeine Diskussionen
  • Starting Zone (FR)
    • Règles et Annonces
    • Registres du Novark
    • Discussions générales
  • Beta Discussion
    • Beta Updates & Announcements
    • Idea Box
    • Public Test Server Feedback
    • DevBlog Feedback
    • The Gameplay Mechanics Assembly
    • Streamer's Corner
    • The Builder's Corner
    • Innovation Station
  • Organizations
    • Org Updates & Announcements
    • Novark's Registry
  • Fan Art, Fan-Fic & Roleplay
    • Novark Agora
    • Novark Story Time
    • Novark Art Gallery

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location:


Interests


backer_title


Alpha


community_id

  1. Can we get a transparent periscope like it used to be? I have always used this code, but after the release of the Apollo update, the periscope is no longer transparent. local periscope = [[ <style> img { margin-top: 9vh; margin-left: -4vw; }</style> <img src="gunner_target.liveview" style="width: 40%; max-height: 100%; box-sizing: border-box">]] system.setScreen(periscope) system.showScreen(1)
  2. Hello all Noveans, So ive made a small program that i call Screen++ that enables you to add animations to your screens easily. You can use it to create geometrical shapes like ovals, circles or lines and animate them. You can make the geometrical shapes to move in x or y coordinate or change the colors of the border och background of the shapes in intervalls. You can add text and animate them the same way you can animate the geometrical shapes. Check out the newest version (below) to see what new features has been added. -------------------------------------------------------------------- NEW VERSION 3.0 -------------------------------------------------------------------- DATE: 2020 11TH OCTOBER --NEW in version 3.0: -- added ability to set background image, import any picture you like and display it on your screen, normal (use base64) -- +/- in displace elemets in all direction -- added rotation for all functions, clockwise or counter clockwise -- added triangle, normal and animated -- added rectangle, normal and animated (square, width=height) -- added ability to set backgroundcolor, normal and animated -- Z-index, whats elements that should be behind or infront of other elements -- added so all functions can have filled or transparent background (only border will show) -- possible to use Hexcolors -- use variables -- link code/animations to external elements (like a door for example) Tutorial on how to use Screen++ 3.0: I STRONGLY recommend that you watch the video on youtube and not here. Because ive putted timestamps so you easier can navigate through the video This is the link to the codes that you need to copy and past into your programming board (github): https://github.com/robarzangana/dualuniverseRepo/blob/main/screenplusplus_version_3.0 If you have any questions/requests be sure to tell me about them here or on youtube. I hope you'll enjoy it! -------------------------------------------------------------------- OLD VERSION 2.0 -------------------------------------------------------------------- Ive made a tutorial on youtube on how to use Screen++, and im sorry in advance, because i mess up few times in the video. (its my second video): This is the link to the codes that you need to copy and past into your programming board (github): https://github.com/robarzangana/dualuniverseRepo/blob/main/screenplusplus_version_2.0 If you have any questions/requests be sure to tell me about them here or on youtube. I hope you'll enjoy it!
  3. Three years and half after pre alpha launch, the best period ever for DU, everything got overcomplicated, heavy and excruciatingly laggy, especially at the introduction of industry 2.O which has changed till now fps, lag and loading times for everyone, but since the developers aren't testing nor playing their own game, very little have been done concerning the content and game mechanics. Since the beginning JC pretends that he wants to control the visual aspect of the game, but look at the thousands of player made atrocities and piles of elements scattered everywhere For those who never heard about, but there is a french simplistic and satiric cartoon called "Shadoks", where a group of engineers and workers, work hard together to make simple things more complicated, from where we are getting the expression: "why do simple when you can do complicated?" And this is exactly what is happening here But in real life, and i quote, professionals, engineers, designers, and architects will all agree: "Less is more" So here are my thoughts, after 3 years of hope and life time, on the bad and good decisions taken, and what could be improved at the moment: Building mechanics: Vertices editor should have been a priority long ago, long before that not so useful update on the line tool The actual given building tools are half of the reason why we see so much trash everywhere, and why most players are giving up, because voxelmancy is a considerable waste of time since ship selling will never be a major part of the market (everyone want to build his own), PVP will destroy it in a matter of seconds, and detailed or undetailed static or dynamic constructs' spaces are dead as hell. Vertices Editor: self explanatory Line tool: add triangular and circular shapes, and make one of the corners of the selection the center of rotation (not the center of selection, this doesn't make any sense) Paint tool: (omg seriously this one is the biggest joke and laziest decision taken) need to absolutely remove from the game this ridiculous number of different honeycombs, performance wise, and gameplay wise. Every material should have one and only one raw honeycomb, on which we could, using build mode, apply a color we want, a shininess type and or a pattern That would optimize the game code, our inventories/containers, and our factories (and will fix that uggly .24 update changes) Remove the deploy and selection sizes limitations Be more consistent in the deploy shapes size increment (1 by 1, not 1 2 3 4 5 6 8 12 16 24 32) * by the way change "galvanized" honeycomb name and check the definition of galvanized on wiki: which is a zinc coating process to protect different metals from rusting Elements: Here is the second half of the reason why we are surrounded by trashes First, element design is very badly fusing with the voxel building system, specially all the dynamic constructs elements, elements are detailed meshes that don't match with a voxel hull and the voxel default sizes Even after the best achievable voxelmancy, engines, brakes, hovers, wings, look like stains on our creations, element colors dont match available honeycomb colors, some elements are offsets, some are badly symmetrical I m not saying that its bad to have detailed mesh elements, but half of them, must be redesigned to be used and integrated "into" a basic voxel shapes, not to be put like a flower pot "on" the voxels, and this concerning all the elements used for designing ships Dynamic elements (engines, brakes, airfoils): those elements can be a single detailed face element, the face that will pop out from our voxels, and other faces must be designed with an easier global shape to work with the voxel grid (tubular, square, rectangle, just as Empyrion or Space engineers do...) Decorative elements: make sure they are scaled for the voxel grid and size (the reinforced sliding door is the perfect example of bad design and bad consideration) Ability to change elements main color Engines: no no no and no to all this different types of engines (safe/maneuver/military/etc...) with different recipes. again its a mess in inventories and markets, same problem as honeycombs, why doing simple when can do complicated?. while the quality (normal/advanced/rare etc...) should remain, all engines should be crafted as a standard factory type, and have an option by right clicking on them to change their mode type, and why not beeing able to change it using lua Flight mechanics: Overall the flight mechanics are very good, stable and well developed But, the main issue is bringing back to the dynamic elements issue and the overall aesthetic of the game and players creations Elements power/thrust should be multiplied by a minimum of 5!!!! this would greatly reduce the number of elements needed on each ship, reducing the lag and loading time, but most importantly we would not compromise anymore on the design in order to have "acceptable" flight performances (which will increase the visual quality of players creations) Vertical and horizontal cross sections must produce anti drift and high altitude lift, which will reduce the number of wings and stabilizers elements needed, and again will increase everyone performances due to less elements, and allow better ship design Fuel consumption to divide by 2 or more, we are tired to mine 2 hours, refine for an other hour, for 20min of flight (nowadays long distances planes can fly at cruise speed 900kmph for about 12 to 14 hours) LUA Lua is one of the greatest part of the game, allows the best customization possible, but is still way too limited, for no reasons Unlock to unlimited number of links/slots to a pb/remote/ECU/command chair etc... will reduce the number of scripts running at same time, so will increase performances (what is better? to have 10 scripts, on 10 PB, each one linked to 10 elements? or 1 script on 1 PB linked to 100 elements? do the math!) Increase again the recently nerfed CPU usage for custom scripts (they were not producing any client side performances issues, so why decreasing it again?) Increase the conf file allowed size, 150k isnt enough Make possible to install conf files on programming boards Increase Databank sizes Fix the rocket engine please for custom scripts, they are broken and deadly, they activate themselves when construct controls are taken Add function for camera relative rotation and position Ability to save scripts in our nanopack and exchange/sell scripts with DRM protection or not PVP I think pvp is a very delicate topic, but globally so few people have any interest in pvp at all due it its extrem unbalance In my opinion there is no goal and no reward in pvp, which makes it boring So much time and effort put in mining/producing/building a pvp-able ship that it pushes everyone away there should be no safe zone, nowhere! - heard and read too many stories of players ravaging orgs from the inside, secretly stealing work of dozens, and then venting themselves on streams. there should be no safe place in the universe for those people to hide their shameful loot - cargo ships should be accompanied and escorted by armed fleets, even while mining quantas could be physical/stockable/stealable claimed territories shouldnt be visible on the map, unless personally discovered surface ore stones, should be mine-able by anyone anytime anywhere (claimed or not. we should be able to get some fast scrap and fuel if we emergency land in middle of a huge claimed territory) static and dynamic construct need energy shields element containers content should not be destroyed unless the container lost all its lives (otherwise there will be no loot in pvp), they should just be inaccessible there should be a way to restore all lives on salvaged elements (repair unit maybe?) There is so much more to add, but please NQ consider and fix a big part of this first before adding new buggy "content" At some point there should be a planetary wipe, to leave space for the new planets design (allowing what ever is standing in space to be excluded from the wipe, for players beeing able to save enough to restart quickly)
  4. 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.
  5. Purpose, Makes lights randomly change rgb colour and cycles them to give a breathing effect. Level: Lua beginner = cut and paste code, create filters unit start and system update in lua editor , DU = know how to link lights to a programming board Build You need 1 Programming Board(PB) and some lights. Connect the lights to the PB and name each slot in the lua editor (Ctrl L) you have connected l1 , l2 etc. If you don't want 8 then edit the source code and remove. code is below. Other stuff you can do : add a detector to autostart , change parameters in unit start to get the feel you like. -- copy and paste into unit start unit.hide() -- hides programming board -- remove these where you have not connected a light l1.activate() l2.activate() l3.activate() l4.activate() l5.activate() l6.activate() l7.activate() l8.activate() bClock = system.getTime() -- start clock origRgb = l1.getRGBColor() -- stores the colour of the original light if you want to reset lights on exit breathRate = 1 --export: rate of breathing Multiplier changeFrame = 1200 --export: frame colour and channel cycle rgbIndex = utils.round(math.random(3)) -- choose channel to breathe r = math.random(255) -- setup channels g = math.random(255) b = math.random(255) frameCount = 0 -- Copy and Paste into System update frameCount = frameCount + 1 if ( frameCount % changeFrame == 0 ) then --randomize rgb and channel r = math.random(255) g = math.random(255) b = math.random(255) rgbIndex = utils.round(math.random(3)) -- choose channel to breathe end nClock = system.getTime() local timeSeconds = ( nClock - bClock) local breath = utils.round(( math.exp( math.sin(timeSeconds * breathRate )) - 0.36787944 )* 108.0) if rgbIndex == 1 then r = breath elseif rgbIndex == 2 then g = breath else b = breath end -- set rgb colour of linked lights ,remove these where you have not connected a light l1.setRGBColor(r,g,b) l2.setRGBColor(r,g,b) l3.setRGBColor(r,g,b) l4.setRGBColor(r,g,b) l5.setRGBColor(r,g,b) l6.setRGBColor(r,g,b) l7.setRGBColor(r,g,b) l8.setRGBColor(r,g,b)
  6. i know i need to use a programming board but cant for the life of me find a tutorial on exactly how to accomplish this, id be super grateful if someone could point me in the right direction. Thanks for reading and good day Novians
  7. 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
  8. So You can no longer control warp drive with Lua Apparently it was because of emergency jump systems people made to avoid being pirated while hauling long distance and going afk and it was unfair for pirates. I believe the change is stupid because now it's unfair for everyone else but pirates, you have a warp drive and you can't even use it to run away? So here I'm suggesting my solution: Add jump calculation timer to warp drives. The timer should last like 1 minute or 90 sec, not sure how long, that time will have to be balanced. During jump calculation players cannot change their velocity (so cannot thrust or brake, however should be allowed to rotate), if they do the countdown will be canceled. Introducing that timer would make it most fair for both sides, it would give pirates a window to catch the hauler and fire on it (and that activates combat cooldown that is already in the game) and if the pirates are not able to catch the hauler in time it will jump away. And ofc make it possible to initiate that timer with Lua, you shouldn't except people to non stop sit in front of the PC during let's say 90 minute flight between planets.
  9. Basic Ore Monitor. Requires 3 Programming Boards 2 Databanks --two is needed to prevent weird code crossing bugs. later this may be less when they fix bug. 20 Containers of same Size 1 screen 1 switch 1 relay PB1->switch-> relay-> PB2 PB3 Create Events in Lua Editor and Paste the Following as Instructed. 9/17 - Fixed parameter for single boards.Changed some names and Added more exports Programming Board 1 -- Can do 9 Containers OR Read from Databanks ---screen ---databank-----only if your doing more than 9 items added last ---databank2-----only if your doing more than 9 items(using 2 helps code from being crossed from bugs)added last ---switch-----only if your doing more than 9 items ----Unit Start if Morethan9slots == "On" then switch.activate() end unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live Morethan9slots = "Off" --export:Off for 9 slots and On for more than 9 and requires databanks. local containermax = 9600 --export:;Your max container holding. local slot1item = "Bauxite" --export:;Slot1 Iten. local slot1weight = 1.28 --export:;Slot1 weight. local slot2item = "Coal" --export:;Slot2 Iten. local slot2weight = 1.35 --export:;Slot2 weight. local slot3item = "Hematite" --export:;Slot3 Iten. local slot3weight = 5.04 --export:;Slot3 weight. local slot4item = "Quartz" --export:;Slot4 Iten. local slot4weight = 2.65 --export:;Slot4 weight. local slot5item = "Chromite" --export:;Slot5 Iten. local slot5weight = 4.54 --export:;Slot5 weight. local slot6item = "Limestone" --export:;Slot6 Iten. local slot6weight = 2.71 --export:;Slot6 weight. local slot7item = "Malachite" --export:;Slot7 Iten. local slot7weight = 4.0 --export:;Slot7 weight. local slot8item = "Natron" --export:;Slot8 Iten. local slot8weight = 1.55 --export:;Slot8 weight. local slot9item = "Acanthite" --export:;Slot9 Iten. local slot9weight = 7.2 --export:;Slot9 weight. if Morethan9slots == "Off" then local dbhtml = "" local dhtml = "" local index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB1</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] screen.setHTML(html) elseif Morethan9slots == "On" then switch.activate() dbhtml = databank.getStringValue(OreMonitorTwo) dhtml = databank2.getStringValue(OreMonitorThree) local index = {1, 2, 3, 4, 5, 6} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item} -- names to display local htmlContent = "" for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB1</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[]]..dbhtml..[[]]..dhtml..[[ </table>]] screen.setHTML(html) end ---Unit Stop if Morethan9slots == "On" then switch.deactivate() end screen.clear() Programming Board 2 --databank is last slot to add and named databank ---Unit Start unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live --databank is last slot to add and named databank local slot1item = "Malachite" --export:;Slot1 Iten. local slot1weight = 4.0 --export:;Slot1 weight. local slot2item = "Natron" --export:;Slot2 Iten. local slot2weight = 1.55 --export:;Slot2 weight. local slot3item = "Acanthite" --export:;Slot3 Iten. local slot3weight = 7.2 --export:;Slot3 weight. local slot4item = "Garnierite" --export:;Slot4 Iten. local slot4weight = 2.60 --export:;Slot4 weight. local slot5item = "Petalite" --export:;Slot5 Iten. local slot5weight = 2.41 --export:;Slot5 weight. local slot6item = "Pyrite" --export:;Slot6 Iten. local slot6weight = 5.01 --export:;Slot6 weight. local slot7item = "Colbaltite" --export:;Slot7 Iten. local slot7weight = 6.33 --export:;Slot7 weight. local slot8item = "Cryolite" --export:;Slot8 Iten. local slot8weight = 2.95 --export:;Slot8 weight. local slot9item = "Gold Nuggets" --export:;Slot9 Iten. local slot9weight = 19.30 --export:;Slot9 weight. local dbhtml = "" local dhtml = "" local index = {7, 8, 9, 10, 11, 12, 13, 14, 15} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" local containermax = 9600 --export:;Your max container holding. for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB2</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] databank.setStringValue(OreMonitorTwo,html) Programming Board 3 --databank is last slot to add and named databank ---Unit Start unit.setTimer("Live",1) unit.hide() ----Unit Tick ---Name the Tick Live --databank is last slot to add and named databank local slot1item = "Kobelckite" --export:;Slot1 Iten. local slot1weight = 2.37 --export:;Slot1 weight. local slot2item = "Columbite" --export:;Slot2 Iten. local slot2weight = 5.38 --export:;Slot2 weight. local slot3item = "Illmenite" --export:;Slot3 Iten. local slot3weight = 4.55 --export:;Slot3 weight. local slot4item = "Rhodonite" --export:;Slot4 Iten. local slot4weight = 3.76 --export:;Slot4 weight. local slot5item = "Vanadinite" --export:;Slot5 Iten. local slot5weight = 6.95 --export:;Slot5 weight. local slot6item = "Not set" --export:;Slot6 Iten. local slot6weight = 0 --export:;Slot6 weight. local slot7item = "Not set" --export:;Slot7 Iten. local slot7weight = 0 --export:;Slot7 weight. local slot8item = "Not set" --export:;Slot8 Iten. local slot8weight = 0 --export:;Slot8 weight. local slot9item = "Not set" --export:;Slot9 Iten. local slot9weight = 0 --export:;Slot9 weight. local index = {16, 17, 18, 19, 20} -- Row of Container? local containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names local weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item local items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display local htmlContent = "" local containermax = 1200 --export:;Your max container holding. for i=1, #containers do htmlContent = htmlContent .. "<tr>".."<th>"..index[i].."</th><th>"..items[i].."</th><th>"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100)).."%</th><th>"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5).."</th><tr>" end local html = [[ <table style=" margin-left: auto; margin-right: auto; width:30%; font-size:1.25em; text-align:left;"> <tr style = " background-color:Purple; color:black !important;"> <svg> <g> <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="30" id="svg_8" y="50" x="10" stroke="#ff0000" fill="#ff7f00">PB3</text> </g></svg> <th>Row</th> <th>Product</th> <th>Container%</th> <th>Total Ore</th> </tr> ]]..htmlContent..[[ </table>]] databank.setStringValue(OreMonitorThree,html) Pasteable Config for Programming Board 1. Hook up all containers (Bauxite, Coal, Hematite, Quartz, Chromite, Limestone)first and then link switch, screen, databank, databank2 and named them accordingly in the Lua editor slot area. Leave containers slots alone. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"switch","type":{"events":[],"methods":[]}},"7":{"name":"screen","type":{"events":[],"methods":[]}},"8":{"name":"databank","type":{"events":[],"methods":[]}},"9":{"name":"databank2","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"if Morethan9slots == \"On\" then\nswitch.activate()\nend\n\n\nunit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"if Morethan9slots == \"On\" then\nswitch.deactivate()\nend\n\nscreen.clear()\n","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"1"},{"code":"Morethan9slots = \"Off\" --export:Off for 9 slots and On for more than 9 and requires databanks.\nlocal containermax = 9600 --export:;Your max container holding.\nlocal slot1item = \"Bauxite\" --export:;Slot1 Iten.\nlocal slot1weight = 1.28 --export:;Slot1 weight.\nlocal slot2item = \"Coal\" --export:;Slot2 Iten.\nlocal slot2weight = 1.35 --export:;Slot2 weight.\nlocal slot3item = \"Hematite\" --export:;Slot3 Iten.\nlocal slot3weight = 5.04 --export:;Slot3 weight.\nlocal slot4item = \"Quartz\" --export:;Slot4 Iten.\nlocal slot4weight = 2.65 --export:;Slot4 weight.\nlocal slot5item = \"Chromite\" --export:;Slot5 Iten.\nlocal slot5weight = 4.54 --export:;Slot5 weight.\nlocal slot6item = \"Limestone\" --export:;Slot6 Iten.\nlocal slot6weight = 2.71 --export:;Slot6 weight.\nlocal slot7item = \"Malachite\" --export:;Slot7 Iten.\nlocal slot7weight = 4.0 --export:;Slot7 weight.\nlocal slot8item = \"Natron\" --export:;Slot8 Iten.\nlocal slot8weight = 1.55 --export:;Slot8 weight.\nlocal slot9item = \"Acanthite\" --export:;Slot9 Iten.\nlocal slot9weight = 7.2 --export:;Slot9 weight.\n\nif Morethan9slots == \"Off\" then\nlocal dbhtml = \"\"\nlocal dhtml = \"\"\nlocal index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB1</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\n\nscreen.setHTML(html)\nelseif Morethan9slots == \"On\" then\nswitch.activate()\ndbhtml = databank.getStringValue(OreMonitorTwo)\ndhtml = databank2.getStringValue(OreMonitorThree)\nlocal index = {1, 2, 3, 4, 5, 6} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item} -- names to display\nlocal htmlContent = \"\"\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB1</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[]]..dbhtml..[[]]..dhtml..[[\n</table>]]\n\nscreen.setHTML(html)\n\nend\n\n\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"2"},{"code":"dbhtmltwo = databank.getStringValue(OreMonitorTwo)\nscreen.setHTML(dbhtmltwo)","filter":{"args":[{"value":"option2"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"3"},{"code":"local index = {1, 2, 3, 4, 5, 6, 7} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7} -- slot names\nlocal weights = {1.28, 1.35, 5.04, 2.65, 4.54, 2.71, 4.0} -- inspected kg of item\nlocal items = {\"Bauxite\", \"Coal\", \"Hematite\", \"Quartz\", \"Chromite\", \"Limestone\", \"Malachite\"} -- names to display\nlocal htmlContent = \"\"\n\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><th>\"..items[i]..\"</th><th>\"..index[i]..\"</th></tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:25%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Blue;\ncolor:black !important;\">\n <th>Amount</th>\n <th>Row</th>\n <th>#</th>\n </tr>\n ]]..htmlContent..[[]]..dbhtmltwo..[[]]..dbhtml..[[\n</table>]]\n\nscreen.setHTML(html)\n","filter":{"args":[{"value":"option1"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"4"},{"code":"dbhtmlthree = databank.getStringValue(fuck)\nscreen.setHTML(dbhtmlthree)","filter":{"args":[{"value":"option3"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"5"}],"methods":[],"events":[]} Programming Board 2 Link containers(Malachite, Natron, Acanthite, Garnieririte, Petalite, Pyrite, Cobaltite, Cryolite, Gold Nuggets First and then Last slot is databank and named like so. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"databank","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"--databank is last slot to add and named databank\n\n\nlocal slot1item = \"Malachite\" --export:;Slot1 Iten.\nlocal slot1weight = 4.0 --export:;Slot1 weight.\nlocal slot2item = \"Natron\" --export:;Slot2 Iten.\nlocal slot2weight = 1.55 --export:;Slot2 weight.\nlocal slot3item = \"Acanthite\" --export:;Slot3 Iten.\nlocal slot3weight = 7.2 --export:;Slot3 weight.\nlocal slot4item = \"Garnierite\" --export:;Slot4 Iten.\nlocal slot4weight = 2.60 --export:;Slot4 weight.\nlocal slot5item = \"Petalite\" --export:;Slot5 Iten.\nlocal slot5weight = 2.41 --export:;Slot5 weight.\nlocal slot6item = \"Pyrite\" --export:;Slot6 Iten.\nlocal slot6weight = 5.01 --export:;Slot6 weight.\nlocal slot7item = \"Colbaltite\" --export:;Slot7 Iten.\nlocal slot7weight = 6.33 --export:;Slot7 weight.\nlocal slot8item = \"Cryolite\" --export:;Slot8 Iten.\nlocal slot8weight = 2.95 --export:;Slot8 weight.\nlocal slot9item = \"Gold Nuggets\" --export:;Slot9 Iten.\nlocal slot9weight = 19.30 --export:;Slot9 weight.\nlocal dbhtml = \"\"\nlocal dhtml = \"\"\nlocal index = {1, 2, 3, 4, 5, 6, 7, 8, 9} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nlocal containermax = 9600 --export:;Your max container holding.\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB2</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\n\n\ndatabank.setStringValue(OreMonitorTwo,html)\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"0"},{"code":"unit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]} Programming Board 3 Link containers(Kobelckite, Columbite, Illemnite, Rhodonite, Vanadinite) First and then Last slot is databank and named like so. {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"databank","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"--databank is last slot to add and named databank\n\nlocal slot1item = \"Kobelckite\" --export:;Slot1 Iten.\nlocal slot1weight = 2.37 --export:;Slot1 weight.\nlocal slot2item = \"Columbite\" --export:;Slot2 Iten.\nlocal slot2weight = 5.38 --export:;Slot2 weight.\nlocal slot3item = \"Illmenite\" --export:;Slot3 Iten.\nlocal slot3weight = 4.55 --export:;Slot3 weight.\nlocal slot4item = \"Rhodonite\" --export:;Slot4 Iten.\nlocal slot4weight = 3.76 --export:;Slot4 weight.\nlocal slot5item = \"Vanadinite\" --export:;Slot5 Iten.\nlocal slot5weight = 6.95 --export:;Slot5 weight.\nlocal slot6item = \"Not set\" --export:;Slot6 Iten.\nlocal slot6weight = 0 --export:;Slot6 weight.\nlocal slot7item = \"Not set\" --export:;Slot7 Iten.\nlocal slot7weight = 0 --export:;Slot7 weight.\nlocal slot8item = \"Not set\" --export:;Slot8 Iten.\nlocal slot8weight = 0 --export:;Slot8 weight.\nlocal slot9item = \"Not set\" --export:;Slot9 Iten.\nlocal slot9weight = 0 --export:;Slot9 weight.\nlocal index = {16, 17, 18, 19, 20} -- Row of Container?\nlocal containers = {slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8, slot9} -- slot names\nlocal weights = {slot1weight, slot2weight, slot3weight, slot4weight, slot5weight, slot6weight, slot7weight, slot8weight, slot9weight} -- inspected kg of item\nlocal items = {slot1item, slot2item, slot3item, slot4item, slot5item, slot6item, slot7item, slot8item, slot9item} -- names to display\nlocal htmlContent = \"\"\nlocal containermax = 1200 --export:;Your max container holding.\nfor i=1, #containers do\n htmlContent = htmlContent .. \"<tr>\"..\"<th>\"..index[i]..\"</th><th>\"..items[i]..\"</th><th>\"..math.ceil(((math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)/containermax)*100))..\"%</th><th>\"..math.ceil((containers[i].getItemsMass()/weights[i]) - 0.5)..\"</th><tr>\"\nend\nlocal html = [[\n<table style=\"\nmargin-left: auto;\nmargin-right: auto;\nwidth:30%;\nfont-size:1.25em;\ntext-align:left;\">\n <tr style = \"\nbackground-color:Purple;\ncolor:black !important;\">\n <svg>\n <g>\n <text xml:space=\"preserve\" text-anchor=\"start\" font-family=\"Helvetica, Arial, sans-serif\" font-size=\"30\" id=\"svg_8\" y=\"50\" x=\"10\" stroke=\"#ff0000\" fill=\"#ff7f00\">PB3</text> \n </g></svg>\n <th>Row</th>\n <th>Product</th>\n <th>Container%</th>\n <th>Total Ore</th>\n </tr>\n ]]..htmlContent..[[\n</table>]]\ndatabank.setStringValue(OreMonitorThree,html)\n\n","filter":{"args":[{"value":"Live"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"0"},{"code":"unit.setTimer(\"Live\",1)\nunit.hide()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}
  10. Die Mystic Dynasty hat sich folgende Bereiche zur Aufgabe gemacht: 1. Mining und Expansion 2. Schiffsbau und Design 3. Produktion und Forschung 4. Schiffshandel und Marketing Was wir dir bieten können: 1. Industrie auf Alioth 2. Discord für gemütliche Unterhaltungen. 3. Projekte innerhalb der einzelnen Bereiche sowie Corpweite Events. 4. Einführung in Dual Universe für Neulinge 5. Voxelmancy 6. LUA Programmierung 7. Du hast Familie kein Problem Das erwarten wir von dir: 1. Frustresistenz - "Es ist eine Beta, Bugs kommen und gehen... manche nennt man auch Features " 2. Lust am Miteinander in der Corp sowie Corp Beteiligung. 3. Mindestens 18+ 4. Discord beteiligung. Melde dich im Discord https://discord.gg/fqqRbHa bei derSchotte, KABOOM, ChipDE oder AepicA
  11. Main Page/Git Repo Features: All anti-gravity measurements and controls on one screen. Logarithmic altitude scale for more control at lower altitudes. Set target altitude with a slider or step at any power of 10 from 1 to 10,000 meters. Set target altitude to current altitude in one click. Lock controls to prevent accidental clicks. Power on and unlock protected by a drag-to-activate mechanism to prevent accidental disabling. Requirements: Anti-Gravity Generator (of appropriate size for ship core and with the appropriate number of pulsors linked to it) 1x Programming Board 1x Screen Databank (optional, for remembering controller state between sessions) Install/Use Instructions: Link to pre-built lua config for copy/pasting into a programming board Either build a json configuration (see Building from a Template below) or copy the one above and paste it as a Lua configuration into the programming board. Link the screen to the agScreen slot. Add links to the Anti-Gravity Generator, the Dynamic Core Unit, and the Databank if you have one. Order doesn't matter unless you edit the unit start handler to specify what slot is what instead of allowing it to autodetect them. Activate the programming board, either directly or with a signal. Get in the control seat of the ship so the ship is under control, then use the screen to adjust the antigravity.
  12. Here is a quick video tutorial on how to install and some basic usage for this version. ➡️Video Tutorial⬅️ It was brought to my attention that the spoilers were giving errors when pasted to the programming boards. The spoilers were removing bits of the JSON for some reason. So instead, I have added links to the code located between these ➡️⬅️. You can either right click the link and Save As. Or you can click on the link which will open a new page. You copy and paste the entire page into your programming board. This is a work in progress. The development is completed, but it is constantly being refined and upgraded. I encourage and welcome feedback and you are more than welcome to submit your own code, in the comments, for consideration. You can also email me using the link in the first comment. See 1st comment for more info. Here is the JSON code. Just copy/paste it to the programming board. There was a problem pasting the JSON into a spoiler, so I am making it available for download. Right click and Save as, or just click the link and copy the entire page and paste to PB. See video link at top of this post for a tutorial. ***I wasn't able to get rid of the graphics glitch entirely, but I significantly reduced the shift. Now, it's a minor annoyance instead of a massive pain. ➡️ New Industry HUD.⬅️
  13. Hello Dualiers, You are building your new starbase, with a magnificent hangar, and other amazing things, and you decide to let an AI manage it, yet it is all bland and lifeless, but you just remember there is the Text to speech api!!! so you give life and activity to your starbase, hearing the resonant control tower voices in the main hangar (note it is pressurized ofc) I think it would be great to add it, there is an open source cpp lib for it: http://www.speech.cs.cmu.edu/flite/index.html it would be great if you added these sounds to the echo features for great spaces. api bindings would be like: (if user not specified, everyone can hear it) speak('hello world' [, user]); shout('stop'[, user]); whisper('come in'[, user]); and aimanager.setVoice(voice); (or anything equivalent) voices could be cosmetic goodies, with generic male and female available by default. Hope you like it!
  14. I dropped my old scripts from alpha into a repository: https://github.com/Helediron/dualuniverse No license nor usage restrictions.
  15. I run a L core factory and in a different location a S core store. If the store and factory were both in the same core I would be able to move stock from production side to sales side automatically. Since they are in different cores there is no way to move stock (that I am aware of) other than going to one location, sticking it in your cargo and going to the next location. 400 years in the future (not counting time in deep sleep) and you are telling me we can’t have a delivery drone 😩 Would it not not be possible to be able to link two cores together so they act as one larger virtual core as far as placement, linking and Lua are concerned?
  16. I just spent about 3days coding a preliminary ATC system for the org I'm in. It was working (for me) but realised the script in the tower shuts off if I wander >1km away or log off. This makes the ATC system worthless entirely. From what I can tell, LUA currently is mostly limited to things like cargo / inventory management (or making HTML games). Which is INCREDIBLY limiting. I think it would be cool to give players/orgs an 'allotment' to run / host scripts on a server. This would allow really cool systems such as ATC, Automated taxi lanes etc to work. For those super-serious about LUA and advanced systems like that, it could even be a 'premium' subscription option to get more allotment on the server. By allotment I mean an amount of CPU resources, and a script can be analysed to estimate how expensive the script will be on the server which takes up your allotment. If it goes over, you get a 5 minute or whatever warning to turn it (or another script) off to bring you under the limit or scripts will be shut off automatically.
  17. 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).
  18. Like the title says, this is probably a simple question but I'm having an issue getting any kind of custom tweaking done in my ship. Hopefully one of you knowledgeable folks can let me know where I've gone wrong. Currently my ship is setup as a flying construct with the mouse-point control method. I figured I'd start with some 'simple' adjustments so that the ship behaved differently when below a certain speed to simplify the landing process. Apparently I was too ambitious, because when I try to fly the ship it locks up the controls and I get a lovely red "LUA Error" message. I did my best to stick to pretty simple code based on what was already in the script so I'm pretty sure my syntax is correct, but I'm new to LUA so I could be way off base. Here's the code I've tried starting with: local autoRollVelThreshold = 50.0 --my created variable local constructVelocity = vec3(core.getWorldVelocity()) --pre-existing variable -- rolls wings level if velocity is below a certain limit defined by the variable autoRollVelThreshold if constructVelocity < autoRollVelThreshold then local targetRollDeg = utils.clamp(0,currentRollDegAbs-30, currentRollDegAbs+30); -- we go back to 0 within a certain limit if (rollPID == nil) then rollPID = pid.new(autoRollFactor * 0.01, 0, autoRollFactor * 0.1) -- magic number tweaked to have a default factor in the 1-10 range end rollPID:inject(targetRollDeg - currentRollDeg) local autoRollInput = rollPID:get() targetAngularVelocity = targetAngularVelocity + autoRollInput * constructForward end It's based on the pre-existing code for the auto-roll parameter, except instead of using the true/false autoRoll variable I'm using the local variable constructVelocity defined elsewhere in flush() alongside my local variable autoRollVelThreshold which sets the speed at which the action takes place. I thought this would be a simple start to something more complex but it appears I've got some basic issues I still need to get sorted. Any help would be greatly appreciated, thanks.
  19. I have been working on a script to construct HTML for those who want a simple tool yet quite powerfull I hope. The Idea is to have the script as a file in your Lua environement and just use the require() function, then start building your HTML. There is a demo at the end of the script (put the commented lines in your unit.start then uncomment them) HTMLhandler = require(HTMLhandler) HUD = HTMLhandler:Create(system) Features: The tool accept multiple monitors at once, like several screens or HUD (system). myHTMLhandler:Create(system,screen1) Simple usage: To get a simple window inside a left grid in your cockpit you can do: local myHTMLhandler = require("HTMLhandler") normalScreen = myHTMLhandler:Create(system) local baseGrid = myHTMLhandler:addDiv("", "left grid") local myWindow, myWindowContent = myHTMLhandler:addWindow(baseGrid, "MyWindow", "Inside the window") ---- change the content inside the window ---- local changeInside = "change the inside of the window" myHTMLhandler:updateContent(myWindowContent, changeInside) You can create a div with a string or a variable like that myHTMLhandler:createDiv(myVar) and it will display on the selected screen as long as the variable accept the tostring() conversion. You can pass in parameter custom style or/and class. There is also function to create a window and a table. At any time you can change the content as the "addx" functions returns a contentId. For the table, when created you get a table of contentId to modify the column's header and when adding a line you get a table of contentId to modify what's in the line. You can also delete a line or push a new line at the top of the table. indexSimpleDiv = myHTMLhandler:addDiv("simpleDiv") myHTMLhandler:addDiv(indexSimpleDiv, "anotherDiv in SimpleDiv") myHTMLhandler:deleteElement(indexSimpleDiv) -- the anotherDiv will be anchor into the simple Div, but once you delete the simpleDiv it will also delete its child, being "anotherDiv" mainDiv, contentIdMainDiv = myHTMLhandler:addDiv("MainDiv", "left grid") -- this will create a div with the content "MainDiv" and class "left" and "grid" local tableDiv = myHTMLhandler:addDiv(mainDiv, "", "window") -- create a div with the class window as NQ style (works only with HUD) local columnHeaders = {"Name", "Quantity", "Container", "Container size"} --define the title of the column's header for the table local simpleTable = myHTMLhandler:addSimpleTable(tableDiv, columnHeaders) -- create a table with headers local firstLine = {"Gold", "153kL", "Treasure", "L"} local firstLineId, firstLineContentId = myHTMLhandler:addSimpleLine(simpleTable, firstLine) -- add a first line local secondLine = {"Silver", "20kL", "Chest"} local secondLineId = myHTMLhandler:addSimpleLine(simpleTable, secondLine) --add a second line but without data in the last column local pushToFirstLine = {"Plastic", "FULL", "line pushed #1", "M"} myHTMLhandler:addSimpleLine(simpleTable, pushToFirstLine, 2) -- add a third line but at the top position in the table (1 being the headers) myHTMLhandler:updateContent(firstLineContentId[2], "20kL") -- change the amount of gold of "firstLine" Advanced usage: You can change the position of element, attach it to any other element, pass the class and the style in parameters, you can delete it and you can update the content. But it is also possible to do more advanced stuff like creating any HTML element template and use them by referencing them. It should also be possible to do svg tags like that : myHTMLhandler:defineElement("svg", '<svg height="100%" width="100%">', '</svg>') then use myHTMLhandler:addElement("svg",myContentInsideTheTag) The defineElement and the addElement accept variadic parameters so there is in theory no limit Another example, to make this '<line x1="939" y1="537" x2="957" y2="519" style="stroke:rgb(1, 165, 177);opacity:0.7;stroke-width:3"/>' being encapsulated as an element you can do: myHTMLhandler:defineElement("svgLine", '<line ', '" style="stroke:rgb(1, 165, 177);opacity:', ';stroke-width:', '"/> ') local content = 'x1="939" y1="537" x2="957" y2="519"' local svgLineId, svgLineContent = myHTMLhandler:addElement("svgLine", content, 0, '0.7', '3') 0 being a default postion value, if you want to change the position in a list of element (see above for the table). '0.7' the opacity and '3' the strokewidth. now you can change the content by using (by default it will rebuild the HTML and display it as soon as the function ends) : myHTMLhandler:updateContent(svgLineContent, 'x1="0" y1="12" x2="37" y2="24"') Note that multi-content is only availible for table for the moment. others functions: addWindow(Anchor, Title, Content, TitleClass, TitleStyle, ContentClass, ContentStyle, Pos) -- to build a window with the NQ style setAutoDisplay(boolean) setAutoCompute(boolean) -- for big HTML structure you might want to turn them off as every time you add element or edit content the HTML is rebuild and displayed compute() --build the HTML display() --display HTML on all the "monitors" computeAndDisplay() --straightforward getElementHTML(Index) -- to get just a chunk of HTML could be used to display just a part of the structure somewhere else I am aware that there is other tool to build HTML. If you find a bug please report it. If you need help, ask me (same name on discord and IGN) or in the #lua-scripting discord channel If you make your own design using the tool, consider sharing Special thanks to @hdparm ps: I'll put images when the server works pastebin instead of file: https://pastebin.com/KuMRGFFp create a file "HTMLhandler.lua" and save it at the root of lua folder as below
  20. 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.
  21. How can i change the item my refiner is producing? I only found the different starting and stopping methods in the Help(F1) documentation. Do i really need to setup multiple refiners to get all ores automated? That would be heavy on the already poor performance.
  22. This is the output of a script that dumps all global variables. Lua coders may find this somewhat useful. The script was run in r0.21.2 on a hovercraft seat that has 2 fuel tanks and a radar linked. Some functions were called with pcall. The first value indicates whether the call was successful, the second is the actual return value or the error message. To see only elements' functions, visit this topic. Dumping script The script used for dumping is based on something I found on Stack Overflow, with some extensions. In unit start(): https://gist.github.com/d-lua-stuff/180707c172382d06d2c80213a1638f66 In system update(): coroutine.resume(dumping_coroutine) The script will run for a few seconds and then automatically turn off. Output is saved to Dual Universe 's log files in %LOCALAPPDATA%\NQ\DualUniverse\log Dump analyzer To avoid having to look through the logs manually, a Python script was written. It extracts the output of the globals dumping script from Dual Universe's log files, and creates separate files for dumped globals and for members of each linked element. Usage: pip install six python dump_analyzer.py C:\Path\To\Log\File.xml Change log 2020-09-01. Posted the first version outside the NDA forums section.
  23. As a future developer in Dual Universe, the idea of DACs as payment seems like an interesting prospect. But the more I think about it, the more it seems like a bit of a d-bag move on the part of the developers. I don't want this to be an overtly negative post, but bear with me.. I intend to be creating a whole lot of stuff in game, ships, defenses, tools, etc. with full Lua scripting to back them all up. These things will take a TON of time to develop if you hope to have a decent result from them. However, with the Dual Access Coupons being the only *real* form of payment I can hope to receive in game, it kind of feels like a bit of a face slap. Think about it. I spend 25 hours working on a super awesome engine control module with advanced auto-maneuvering for someone who requested it custom. Joe Space Captain goes to the Dual website and buys himself two DACs to give to me as payment for the work I did. Great, I got this month and next in game for free as payment. = 30 Euro savings or whatever for me. Now, instead of a custom job, I make a super awesome base turret blueprint that I sell on open market. Let's say 250 people buy it at 500 credits each, and I trade those 125,000 credits for 5 DACs that people are selling on the market. What happened here? I now have 5 free months in game, which I may or may not ever use, but NovaQuark just made 75 euro in real money cash for all of that work that I did. Once I start collecting DACs like candy because now 10,000 users have realized how good it is and have purchased my super-awesome turret, NQ is rolling in the money for work I did, and those DACs I accrued have become virtually useless to me. Obviously, I made assumptions the monthly fee is 12 euro and DAC are 15 euro. Actual cost doesn't really matter. The more I make and sell on market, the more trivial the DACs will become. Meanwhile, NQ makes tons of constant value cash on my work. My alternative would be to just hoard the in-game currency, which has equally nil real-world value. I have to imagine that with this system of payments, serious developers and builders will eventually just start dealing outside of the game and make contracts to do in-game work with payments in real cash. That's the only way it would actually be worth it to build things over the long term. All of the really good stuff in game will only be accessible through various user-run black markets outside of game, with in-game market only used for trivial purchases just to get items transferred and to earn the in-game money needed for resource accumulation. I could be wrong, but that's what I foresee happening. What are your thoughts?
  24. So I was wondering. We will be able to script in LUA, which is pretty cool. But what if we were able to have databases as well to store and fetch data? Think about the world of programming it would open : statistics, history, logging, stock situation of a warehouse, forecast... basically all information-based services! It could be done with a database element that would whether : - Connect to a reserved database on NQ servers, one on each account to which you could assign rights (to allow organizations to use it) - Connect to an external database on the user's PC or on online. Thoughts?
  25. I know that "predefined sounds" is on the "Considered" list on Trello: https://trello.com/c/HVdTjEsH/51-functional-scriptable-speakers-able-to-play-predefined-sounds While I think that would be cool, I think it would be cooler if we had access to a synth sound module through LUA to build and sequence our own custom sounds. Writing sound synthesis by hand isn't unheard of in LUA, for example: And even more, here are some tracks composed entirely with LUA: https://soundcloud.com/luehi/systemf https://soundcloud.com/luehi/luacid1 https://soundcloud.com/luehi/early https://soundcloud.com/luehi/selfkitchen https://soundcloud.com/luehi/luaessay5 https://soundcloud.com/luehi/movk I think that giving us the flexibility to define our own sounds with such an approach would be incredibly more valuable than choosing from a list of predefined sounds. In case anyone is wondering, yes I am suggesting this because I want a night club in DU.
×
×
  • Create New...