Jump to content

NQ-Deckard

Staff
  • Posts

    105
  • Joined

  • Last visited

4 Followers

Profile Information

  • Alpha
    No

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NQ-Deckard's Achievements

  1. Hello Noveans! We have just released a client-side hotfix update, DU is now in version 0.26.19. The changes can be found below: Bugfixes [Highlight] Highlight no longer makes elements go invisible when using the build helper or the link tool. [Highlight] Highlight once again follows the full current element model. [Lua] Fixed an incorrect localization field in the local atlas.lua lib. Thank you all for your support! - Deckard
  2. Hello Noveans! We have just released a new hotfix update, DU is now in version 0.26.18. The changes can be found below: Bug Fixes Restored previous dispenser behavior (only "Use Element" right required to use a dispenser). The Crash Reporter now works properly again and can be used to send crash reports. Fixed the wrong root folder on the icon paths in the atlas.lua library. Crash Fix [Crash] Fixed a bug related to element highlight that could lead to a crash. Known Issues [Lua] Edit Lua Parameters can fail to be applied with some specific custom configurations. After investigation, we’ll need time to fix this and can’t provide an ETA yet. [Lua] We are aware of and investigating a number of other Lua-related crashes and freezes. [Highlight] Element highlight doesn't match with the element in some cases. [Tool] Some elements visually disappear when you use the link tool; however, they remain linkable as they reappear when moused over. Thank you all for your support! - Deckard
  3. Hello Noveans! We have just released a new video where we go over some of the changes that are coming with Demeter, and how we intend to aid our players in the transition. We would love to hear your feedback, and thoughts!
  4. Members of the Dual Universe dev team joined forces to talk about Dual Universe’s next update, Demeter, which focuses primarily around mining. In this vlog, you’ll meet: NQ-Sesch, General Manager of Novaquark-Montreal NQ-Kyrios, Creative Director NQ-Entropy, Game Designer NQ-Sirg, Technical Director NQ-Deckard, Live Ops Specialist Topics include: How we're implementing a new voxel grid on planets called hexoctrees, which will significantly decrease database costs and improve performance for players. The fundamental changes to mining, including the removal of underground ore, how mining units work and how their efficiency can be optimized. How the management of territories is impacted with the introduction of monthly ownership fees among other changes. How these changes include a reset of the planets’ geometry and the potential impact on some players with underground bases. How Novaquark is trying to help such players ahead of the launch of Demeter. To allow players the opportunity to see and experience these changes first-hand, including the effects of the geometry reset on their constructs, the public test server will be available soon with a preview of Demeter. The PTS will host a fresh copy of the database from Live so that all of your inventory and constructs will be waiting for you there . We highly encourage DU community members to watch the vlog and join us on PTS to try all the things. Questions or comments about the vlog? We have the perfect place for those on our forum.
  5. The Dual Universe creator community will be delighted to dive into the latest update. Named for the goddess of the Moon, Selene (0.26.17) shines with new Lua-related features and improvements that players can integrate into their constructs to bring them to new heights. Lua is a real and easy-to-learn programming language that can be used in DU to bring functionality and usability to constructs, such as making ships fly, doors open and close, and screens display graphics. For a more in-depth look at the various Lua components in Selene, we published “Lua Improvements and Changes”, a three-part devblog. (See Part 1, Part 2, and Part 3.) If you’re not familiar with Lua scripting, we hope this update will inspire you to give it a try. We would also like to highlight these very important container RDMS changes. The “Use Element” right will no longer provide full access to all containers. Instead, the following RDMS rights will be the sole governors of who has access to containers. Put items in container - Allows an actor to place items into a container Retrieve items from container - Allows an actor to take items from a container View container contents - Allows an actor to view the content of a container. (This right is implicitly given with the Put & Retrieve rights.) This change will affect all container types: containers, fuel tanks, ammunition containers, and Mission containers. Alongside the Lua goodies and container changes, the Selene update also includes several improvements and bug fixes. View the full changelog here. Questions or comments about the update? Warp over to the forums. We’d love to hear from you.
  6. Hello everyone! We look forward to hearing your feedback on the new changes that come with the 0.26.17 Selene update!
  7. Hello Noveans! Today we released the 0.26.17 - Selene update, named after the Greek goddess of the moon. This update comes with the following changes: Gameplay Changes The “Use element” RDMS right no longer allows you to fully “use” a container. You now need to assign the specific container management rights associated to the expected level of access. "Use element": Now no longer provides an actor access to the container. “Put Items in container”: Allows an actor to put something into a container “Retrieve items from container”: Allows an actor to take from a container “View container contents”: Allows an actor to view the content of a container. It is implicitly given with the Put & Retrieve rights.. The container rights change affects all container types - item containers, fuel tanks, ammo containers, mission package containers. Lua Improvements and Changes Changes in the management of construct and element referentials. For more consistency and to pave the way for future radar changes, the Lua now uses the construct building zone center as origin for all. This change affects local elements or player position and radar construct positions. We removed the quaternions from the Lua API are now exposing the direction vectors of the objects instead. This change was made to improve the overall player experience as not all players may be familiar with this mathematical notion of representing rotation. For more information you can read the Lua Improvements and Changes devblog, Part 1. Added Lua functions on Core Unit: core.getOrientationUnitId() : Returns the UID of the currently active orientation unit (the core unit or the gyro unit). core.getVelocity(): Returns the construct's linear velocity, relative to its parent, in construct local coordinates. core.getWorldVelocity(): Returns the construct's linear velocity, relative to its parent, in world coordinates. core.getAbsoluteVelocity(): Returns the construct's absolute linear velocity in construct local coordinates. core.getWorldAbsoluteVelocity(): Returns the construct's absolute linear velocity in world coordinates. core.getParentPosition(): Returns the position of the construct's parent when docked in construct local coordinates. core.getParentWorldPosition(): Returns the position of the construct's parent when docked in world coordinates. core.getParentForward(): Returns the construct's parent forward direction vector in construct local coordinates. core.getParentUp(): Returns the construct's parent up direction vector in construct local coordinates. core.getParentRight(): Returns the construct's parent right direction vector in construct local coordinates. core.getParentWorldForward(): Returns the construct's parent forward direction vector in world coordinates. core.getParentWorldUp(): Returns the construct's parent up direction vector in world coordinates. core.getParentWorldRight(): Returns the construct's parent right direction vector in world coordinates. core.getElementForwardById( uid) : Returns the forward direction vector of the element identified by its UID in construct local coordinates. core.getElementUpById( uid) : Returns the up direction vector of the element identified by its UID in construct local coordinates. core.getElementRightById( uid) : Returns the right direction vector of the element identified by its UID in construct local coordinates. Added Lua functions on Control Unit: unit.getMasterPlayerPosition() : Returns the position of the player currently running the control unit in construct local coordinates (relative to the construct center instead of the control unit). unit.getMasterPlayerWorldPosition() : Returns the position of the player currently running the control unit in world coordinates. unit.getMasterPlayerForward() : Returns the forward direction vector of the player currently running the control unit in construct local coordinates. unit.getMasterPlayerUp() : Returns the up direction vector of the player currently running the control unit in construct local coordinates. unit.getMasterPlayerRight() : Returns the right direction vector of the player currently running the control unit in construct local coordinates. unit.getMasterPlayerWorldForward() : Returns the forward direction vector of the player currently running the control unit in world coordinates. unit.getMasterPlayerWorldUp() : Returns the up direction vector of the player currently running the control unit in world coordinates. unit.getMasterPlayerWorldRight() : Returns the right direction vector of the player currently running the control unit in world coordinates. Changed existing Lua functions: core.getConstructOrientationForward() : Returns the forward direction vector of the active orientation unit in construct local coordinates. core.getConstructOrientationUp() : Returns the up direction vector of the active orientation unit in construct local coordinates. core.getConstructOrientationRight() : Returns the right direction vector of the active orientation unit in construct local coordinates. core.getConstructWorldOrientationForward() : Returns the forward direction vector of the active orientation unit in world coordinates. core.getConstructWorldOrientationUp() : Returns the up direction vector of the active orientation unit in world coordinates. core.getConstructWorldOrientationForward() : Returns the right direction vector of the active orientation unit in world coordinates. core.getConstructWorldPos() : Returns the position of the center of the construct in world coordinates (instead of orientation units position). core.getElementPositionById(<int> uid) : Returns the position of the element, identified by its UID in construct local coordinates (instead of the construct corner). Deprecated existing Lua functions: core.getElementRotationById() : Deprecated. unit.getMasterPlayerRelativePosition() : Deprecated. unit.getMasterPlayerRelativeOrientation() : Deprecated. Removed Lua functions that were previously deprecated: unit.getOwnerRelativePosition(), core.getElementList(), core.getElementName(), core.getElementType(), core.getElementHitPoints(), core.getElementMaxHitPoints(), core.getElementMass(), engine.getFuelRate(), engine.isObstructed(), gyro.setYawWorldReference(), gyro.getYaw() Radar and transponder changes. There are some future backend radar changes in the planning stages now. In preparation, we have made some improvements to the Lua implementation of the radar. These should not only have a usability benefit but also improve performance as we reduce the usage of JSON strings to deliver payloads in Lua in favor of tables and values. We also heard your feedback that many of you found the transponder lacking in usability. To counter this, we’ve added the transponder Lua API. For more information on the radar changes, you can read the Lua Improvements and Changes, Part 2 devblog. Added Lua functions on radar unit: radar.isOperational() : Returns 1 if the radar is not broken, works in the current environment and is not used by another control unit. radar.getRange() : Returns the scan range of the radar unit. radar.getIdentifyRanges() : Returns ranges to identify a target based on its core size. radar.getConstructIds() : Returns the list of construct IDs in the scan range. radar.getIdentifiedConstructIds() : Returns the list of identified construct IDs. radar.getTargetId() : Returns the ID of the target construct. radar.getConstructDistance( cid) : Returns the distance to the given construct. radar.isConstructIdentified( cid) : Returns 1 if the given construct is identified. radar.isConstructAbandoned( cid) : Returns 1 if the given construct was abandoned. radar.getConstructCoreSize( cid) : Returns the core size of the given construct. radar.getThreatTo( cid) : Returns the threat rate your construct is for the given construct. radar.getThreatFrom( cid) : Returns the threat rate the given construct is for your construct. radar.getConstructOwner( cid) : Returns a table with ID of the owner entities (player or organization) of the given construct if in range and if active transponder tags match. radar.getConstructPos( cid) : Returns the position of the given construct in construct local coordinates if the active transponder tags match. radar.getConstructWorldPos( cid) : Returns the position of the given construct in world coordinates if in range and if the active transponder tags match. radar.getConstructSpeed( cid) : Returns the speed of the given construct if identified. radar.getConstructAngularSpeed( cid) : Returns the angular speed of the given construct relative to your construct if identified. radar.getConstructRadialSpeed( cid) : Returns the radial speed of the given construct relative to your construct if identified. radar.getConstructMass( cid) : Returns the mass of the given construct if identified. radar.getConstructInfos( cid) : Returns a list of working elements on the given construct if identified. radar.getConstructVelocity( cid) : Returns the velocity vector of the given construct in construct local coordinates if identified and if the active transponder tags match. radar.getConstructWorldVelocity( cid) : Returns the velocity vector of the given construct in world coordinates if identified and if the active transponder tags match. Added Lua functions on Transponder Unit: transponder.activate() : Activate the transponder. transponder.deactivate() : Deactivate the transponder. transponder.toggle() : Toggle the state of the transponder. transponder.getState() : Returns the activation state of the transponder. transponder.setTags( tags) : Set the tags list with up to eight entries. Returns 1 if the application was successful, 0 if the tag format is invalid. transponder.getTags() : Returns the tag list. transponder.toggled( active) event : Emitted when the transponder is started or stopped. Deprecated existing Lua functions: radar.getEntries() : has been renamed to getConstructIds for consistency. The radar can now be connected to all controllers. You can only use radar for PvP on restricted links or you will not be able to identify or engage a target with it. Additional local libraries and update We took the time to add a few minor features to the Lua following some popular requests that we felt would gel well with the other changes. For more information on the libraries, you can read the Lua Improvements and Changes, Part 3 devblog. Updated database Lua library: database.getPlayer( pid) : Returns all information about a given player, identified by its ID. database.getMasterPlayer( unit) : Returns all information about the player running the script. database.getConstruct( cid) : Returns all information about a given construct, identified by its ID; requires a radar to detect the construct. database.getElement( core, uid) : Returns all information about a given element, identified by its ID, and requires a linked core unit. Added the atlas Lua library containing all the information about the stellar bodies. (Check the devblog or check the file in your local Lua game folder.) Added the event Lua library designed to help players create events in pure Lua. (Check the devblog or check the file in your local Lua game folder.) Other changes and improvements. Ammo containers now have the same Lua API as other container elements. Added a section on RenderScript and Lua screen units to the Codex. Added Lua functions on Lua screen units: getTime(): Return the time, in seconds, relative to the first execution. getAvailableFontCount(): Return the number of fonts available to be used by render script. getAvailableFontName(index): Return the name of the nth available font Added additional Lua functions : core.getConstructName() : Returns the name of the construct. core.getCurrentPlanetId() : Returns the ID of the current close stellar body. system.getPlayerName( pid) : Returns the name of the given player if in range of visibility or broadcasted by a transponder. unit.getMasterPlayerOrgIds() : Returns the list of organization IDs of which the player running the script is a member. system.getOrganizationName( oid) : Returns the name of the given organization, if known, e.g. broadcasted by a transponder. system.getOrganizationTag( oid) : Returns the tag of the given organization, if known, e.g. broadcasted by a transponder. Deprecated isFontLoaded() function due to a bug fix related to font loading. Improvements [UI] Added a wallet log when canceling a buy order on a market. (Refund was already done but was not noted in the log.) [UI] Reordered context menu for pack and unpack item action. [UI] Polished lateral consumable bar displayed with materials or elements tools. [UI] Add Talent queue warning notification when you are on surrogate session: "Talent training only affects your avatar". Bug Fixes Fixed a bug where a destroyed construct immediately stops and does not move until it is repaired. Fixed an issue where game pop-ups would never appear during a session, including the "quit game" pop-up. Fixed occasional framerate drops at the beginning of a game session. Fixed the scanner in the hand preventing the territory scanner interface from opening correctly. Fixed the Dual Universe black screen before loading which could freeze the game. [Lua] core.getParent function no longer returns nearby construct/planet IDs. Now returns the parent construct ID. [Lua Screens] Fixed a problem that sometimes caused fonts to load incorrectly. [Codex] core.getBoardedAvatars() was incorrect; the correct function name is core.getPlayersOnBoard(). [UI] Fixed hand scanner graphic not showing closest voxels. [Talents] Fixed inconsistency with Fixed Refill and Drain Speed. [Build] Fixed an issue where animated element meshes would be duplicated when using the Move element tool in build mode. [Build] Element highlights now correctly correspond to the whole element mesh. Fixed refuel tool feedback when player doesn’t have rights. Known Issues [Lua] Edit Lua parameters can fail to be applied with some specific custom configurations. After investigation, we’ll need time to fix this and can’t provide an ETA yet. [Lua] We are aware of and investigating a number of other Lua-related crashes and freezes. We currently have an issue with the Crash Reporter causing it to not trigger correctly, we’re investigating this bug and will push an update to resolve the issue soon. [Crash] An issue related to element highlights has been identified that can lead to a crash. This is most noticeable when using the Repair Tool or Linking Elements. Thank you all for your support! - Deckard
  8. Hello everyone, We would love to hear your feedback about the new ability to detect if your construct has stacked elements! NQ-Deckard
  9. With production on the Demeter update well underway, we wanted to make you aware of one of the big changes that will be included in the release, the Stacked Element Detection function. Previously, it was possible (though not permissible) to stack elements while creating ships. We’ve since eliminated the means to do this; however, there could still be players who are unknowingly piloting purchased ships that contain stacked elements. Used in tandem with the in-game build helper, we will now provide a way to identify stacked elements on constructs so that the owner can remove them. You may now find that some elements listed have a red triangle in front of them, indicating a stacked element and/or an element that is overlapping another element. The following elements* are currently subject to disabling: Repair units Shield generators Weapons Elevators Anti-gravity generators Anti-gravity pulsors Containers Industries Mining units Airfoils (wings, stabilizers, and ailerons) Space and air brakes Adjustors Engines (atmospheric, space, rocket, hover, and vertical boosters) Control units (including PvP seats) Deep space asteroid trackers Resurrection nodes Surrogate pods and VR stations Territory scanners *List subject to change Please note that this is a temporary method to address the issues caused by stacked elements. An automated process will be introduced in a future update in which any stacked or overlapping element will have its function disabled. We highly recommend that all players use this to retrofit, redesign, or unstack any stacked elements to ensure retention of functionality once the final phase of the stacking fixes is implemented. A forum thread is available here for questions and comments.
  10. Hello @EasternGamer! That was quite the read. Although we do already have very similar plans on the drawing board, it is unlikely that this will happen soon as it will likely have to go hand in hand with a larger Lua change for which we simply do not have an ETA at this time. And it's also not something that can be implemented at any point as it involves some major changes that would mean refactoring and "fixing" just about every single Lua script that currently exists in the game. As such, although we agree with the idea and would eventually like to do something along these lines. It is very unlikely it will be before release.
  11. The Event Library Example Below you will find example Lua code for a Lua Screen Units renderscript which demonstrates some of the use cases of the events library. (Yes, I realise this is a stunning example screenshot. 😎) The Event Library example code: (This example will not work in game until the related update is deployed.) --Local libs used in this example local event = require('utils/event') local rslib = require('rslib') --Layers instanciation and font loading local font = loadFont('RefrigeratorDeluxe',20) local back = createLayer() local front = createLayer() local fore = createLayer() local rx,ry = getResolution() local mx,my = getCursor() --Default styles definition setDefaultFillColor(back,Shape_BoxRounded,0.2,0.2,0.3,1) setDefaultFillColor(front,Shape_Text,1,1,1,1) setDefaultFillColor(fore,Shape_Text,1,193/255,32/255,1) --Background color definition setBackgroundColor(15/255,25/255,40/255) --[EXAMPLE] Button class definition local function addButton(x,y,w,h,text,ft) --Pubic properties local self = {} self.text = text or "" self.font = ft or nil self.onPressed = event:new() self.onDown = event:new() self.onReleased = event:new() self.onHover = event:new() self.onLeave = event:new() --Local properties local _x,_y,_w,_h = x,y,w,h local _lines = {} local _hover = false local _asc, _desc = 0,0 if self.font then _asc,_desc = getFontMetrics(font) _lines = rslib.getTextWrapped(font, text, _w) end --Set the caption of the button function self:setText(text) if self.font then _lines = rslib.getTextWrapped(self.font, text, _w) end end --Handle button events function self:compute(x,y) if x>_x and x<_x+_w and y>_y and y<_y+_h then if getCursorPressed() then self.onPressed:emit(self,x,y) elseif getCursorReleased() then self.onReleased:emit(self,x,y) elseif getCursorDown() then self.onDown:emit(self,x,y) end _hover = true self.onHover:emit(self,x,y) elseif _hover then self.onLeave:emit(self,x,y) _hover = false end end --Draw the button function self.draw(self) local x,y,w,h,txt,ft = _x, _y, _w, _h, self.text, self.font local layer = _hover and fore or front addBoxRounded(back,_x,_y,_w,_h,6) if ft then for k,l in pairs(_lines) do local ty = y + h*0.5 - (#_lines-1)*(_asc+_desc)*0.5 + _asc*(k-1) setNextTextAlign( layer, AlignH_Center, AlignV_Middle) addText( layer, ft, l, x+w/2, ty) end end end return self end ---# Initialization - Executed only at the first frame if not _init then display = {"Don't click me!","No! What did I say?!","STOP!! I SAID STOP !","STOP!! I'M BLOCKING MYSELF NOW"} k = 1 --Create the button btn_print = addButton(rx/2 -93, ry/2 -28, 186, 56, display[1], font) --Add the action on the onPressed event. --event:addAction( call, enabled, limit) btn_print.onPressed:addAction(function(self,x,y) k = k+1 self:setText(display[k]) end, true, 3) --In this case, we limit the action to 3 invoke and is disabled after. _init = true end ---# Computation btn_print:compute(mx,my) ---# Rendering btn_print:draw() requestAnimationFrame(10)
  12. The Atlas Library Example Below you will find example Lua code for a Lua Screen Units renderscript which demonstrates some of the use cases of the atlas library. The Atlas Library example code: (This example will not work in game until the related update is deployed.) ----------------------------------------------------------------------------------- -- Atlas Lua Screen -- -- This screen provides an example of a stellar atlas based on screen rendering -- and the local atlas.lua library. ----------------------------------------------------------------------------------- ---# Local constants class and objects definition local atlas = require("atlas") local json = require("dkjson") local rslib = require("rslib") local vec3 = require("cpml/vec3") local system = atlas[0] local rx,ry = getResolution() local rear = createLayer() local back = createLayer() local front = createLayer() local fore = createLayer() local small = loadFont('Play',10) local smallBold = loadFont('Play-Bold',10) local normal = loadFont('Play',16) local normalBold = loadFont('Play-Bold',16) local medium = loadFont('Play',22) local mediumBold = loadFont('Play-Bold',22) ---# Local functions definition --Returns the id of the images requested to load (prevent to load multiple time the same image) local images = {} local function loadImages(src) for k,img in pairs(images) do if k == src then return img end end images[src] = loadImage(src) return images[src] end --Returns a concatenated string of the given table with the comma separator according to the language local function concatList(list,lng) local out = {} for i,v in pairs(list) do out[i] = v[lng] end return table.concat(out,', ') end --Check if the given table t has the given entry u local function contains(t, u) for i,v in pairs(t) do if v == u then return true, i end end return false end --Used to set the view to a given stellar body id local function setView(id) local i = 0 for k,b in pairs(system) do if b.id == id and b.systemId == 0 then i = k else for k,b in pairs(system) do if b.id == b.systemId then i = k end end end end if _mode == 1 then _viewX = 470-(i*350) else _initShift = _viewX _shift = 470-(i*350) _time = 0 end end ---# Settings -- showCursor : Set at true to display a cursor -- _lang : Set here the default language (1: English, 2: French, 3: German) -- _mode : Set the view mode (1: system view, 2: local view) -- _select : Set the default selected stellar body (i.e. 2 for Alioth) local showCursor = false _lang = _lang or 1 _mode = _mode or 1 _select = _select or 1 local loc = { description = {"Description", "Description", "Beschreibung"}, ores = {"Ores", "Minerais", "Erze"}, biosphere = {"Biosphere", "Biosphere", "Biosphare"}, habitability = {"Habitability", "Habitabilite", "Bewohnbarkeit"}, classification = {"Classification", "Classification", "Klassifizierung"}, satellites = {"Satellites", "Satellites", "Satelliten"}, distance = {"Distance", "Distance", "Entfernung"}, radius = {"Radius", "Rayon", "Radius"}, gravity = {"Gravity", "Gravité", "Schwerkraft"}, atmoThickness = {"Atmo. Thickness", "Epaiss. atmosphère", "Atmospharendicke"}, noSatellite = {"This stellar body does not have satellites.","Ce corps stellaire ne dispose pas de satellites.","Dieser Sternkörper hat keine Satelliten."} } ---# Initialization _viewX = _viewX or 220 _planets = _planets or {} _time = _time and _time+getDeltaTime() or 0 _initShift, _shift = _initShift or 0, _shift or 0 local input, dist = getInput(), 0 if not _init then if not system[_select] then _select = 1 end setView(_select) local data = json.decode(input) or {} if data.pos then dist = vec3(data.pos) - vec3(planet.center) end _init = true for _,b in pairs(system) do if b.systemId == 0 then if b.satellites then table.sort (b.satellites, function (b1, b2) return system[b1].positionInSystem < system[b1].positionInSystem end ) end _planets[#_planets+1] = b end end table.sort (_planets, function (b1, b2) return b1.positionInSystem < b2.positionInSystem end ) end local planet = system[_select] local vignette = loadImages(planet.iconPath) ---# Computation local mx, my = getCursor() local down, pressed = getCursorDown(), getCursorPressed() --Compute actions on mouse clicks if pressed then for k=1,3 do local lx = rx-84 + k*24 if (mx-lx)^2 + (my-13) < 20^2 then _lang = k end end if _mode==2 and (mx-256)^2 + (my-32)^2 < 24^2 then _mode = 1 end end if my>ry-60 and mx>224 and down then if _mode==1 then _viewX = 220-((mx-224)/700)*4200 + (rx-224)/2 else _mode = 1 end end --Slide animation when clicked on a planet if _mode == 2 then local t = _time/1 local sqt = t * t; _viewX = t>=1 and _shift or _initShift + (sqt / (2.0 * (sqt - t) + 1.0))*(_shift-_initShift); end --Clamp the view shift _viewX = _viewX>220 and 220 or _viewX _viewX = _viewX<-3800 and -3800 or _viewX ---# Rendering --Draw backgrounds and cursor circle setBackgroundColor(5/255, 6/255, 10/255) setNextFillColor( front, 15/255, 16/255, 20/255, 1) addBox( front, 0, 0, 224, ry) setNextFillColor( back, 5/255, 6/255, 10/255, 1) addBox( back, 224, ry-60, rx-224, 60) if showCursor then setNextStrokeWidth( fore, 0.1) setNextStrokeColor( fore, 1, 193/255, 32/255, 1) setNextFillColor( fore, 0,0,0,0) addCircle( fore, mx, my, 5) setNextFillColor( fore, 1, 193/255, 32/255, 1) addCircle( fore, mx, my, 1) end ---Main view --Draw the main view sun glow, only if visible on the view if _viewX > 0 then setNextStrokeWidth( rear, 0) setNextStrokeColor( rear, 0, 0, 0, 0) setNextShadow( rear, 200, 255/255, 120/255, 5/255, 0.85) addBox( rear, _viewX-10, 0, 0, ry) end local bx,by = _viewX+300, ry/2 --Draw the thumbnail sun glow setNextStrokeWidth( back, 0) setNextStrokeColor( back, 0, 0, 0, 0) setNextShadow( back, 45, 255/255, 120/255, 5/255, 0.75) addBox( back, 200, ry-35, 0, 10) --Draw all planets for i,body in pairs(_planets) do local img = loadImages(body.iconPath) local hover = false local r = body.radius/900 local mbx = 224+(i*350)/6 if _mode==1 or (_mode == 2 and _select == body.id or (body.satellites and contains(body.satellites, _select))) then --Check the hover and click events in the rendering (exception made to avoid having to do the same loop in the computation part). if (mx-bx)*(mx-bx) + (my-by)*(my-by) < (r+18)^2 then hover = true if pressed then _select = body.id if _mode == 1 then _mode = 2 setView(body.id) end end end --Draw the planet only if it is visible on the screen in order to optimize the rendering cost. if bx > -r*1.5 and bx < rx+r*1.5 then if hover then setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 193/255, 32/255, 1) end setNextFillColor( rear, 0, 0, 0, 0) addCircle( rear, bx, by, r+18) --Draw atmosphere if the stellar body has if body.hasAtmosphere then local atm = body.atmosphereRadius/900 setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 1, 1, 0.03) setNextFillColor( rear, 1, 1, 1, 0.025) addCircle( rear, bx, by, atm) end --Draw back line setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 1, 1, 0.25) addLine( rear, bx, 0, bx, ry) --Draw planet image if body.id == 3 then addImage( back, img, bx-(2*r)+8, by-(2*r)+14, 2*(2*r), 2*(2*r)) else r = 1.025 * r addImage( back, img, bx-r, by-r, 2*r, 2*r) end --Draw satellites if in local view if _mode == 2 then if body.satellites then local dsx = 0.5 * (rx-bx+r)/(#body.satellites+1) local sx, sy = bx + r + dsx, by for j,sid in pairs(body.satellites) do hover = false local sat = system[sid] local satImg = loadImages(sat.iconPath) sr = sat.radius/1240 if (mx-sx)*(mx-sx) + (my-sy)*(my-sy) < (sr+18)^2 then hover = true if pressed then _select = sat.id end end if hover then setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 193/255, 32/255, 1) end setNextFillColor( rear, 0, 0, 0, 0) addCircle( rear, sx, sy, sr+18) if sat.hasAtmosphere then atm = sat.atmosphereRadius/1240 setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 1, 1, 0.03) setNextFillColor( rear, 1, 1, 1, 0.025) addCircle( rear, sx, sy, atm) end addImage( back, satImg, sx-sr, sy-sr, 2*sr, 2*sr) setNextStrokeWidth( rear, 0.1) setNextStrokeColor( rear, 1, 1, 1, 0.25) addLine( rear, sx, sy + (sr+10)*(-1)^j, sx, sy + (sr+38)*(-1)^j) setNextTextAlign( back, AlignH_Center, AlignV_Middle) addText( back, normal, sat.name[_lang], sx, sy + (sr+48)*(-1)^j) sx = sx + sr + dsx end else --Otherwise, if the star body has no satellites, we display a message. setNextTextAlign( back, AlignH_Center, AlignV_Middle) addText( back, normal, loc.noSatellite[_lang], (rx+bx)/2, by) end end --Draw the planet name setNextTextAlign( back, AlignH_Center, AlignV_Baseline) addText( back, medium, body.name[_lang], bx, by+r+38) end end --Draw the thumbnail view setNextStrokeWidth( back, 0.1) setNextStrokeColor( back, 1, 1, 1, 0.25) addLine( back, mbx, ry-60, mbx, ry) addImage( front, img, mbx -r/8, ry-30 -r/8, 2*r/8, 2*r/8) --If the local view, show the back button arrow if _mode == 2 then setNextStrokeColor( fore, 1, 193/255, 32/255, 1) setNextStrokeWidth( fore, 1) addLine( fore, 250, 32, 262, 44) setNextStrokeColor( fore, 1, 193/255, 32/255, 1) setNextStrokeWidth( fore, 1) addLine( fore, 250, 32, 262, 20) end bx = bx +350 end --Draw the minature view box setNextFillColor( front, 1, 1, 1, 0.1) addBox( front, 224+(220-_viewX)/6, ry-60, (rx-224)/6, 60) --Draw the language selector local langs = {'EN', 'FR', 'GE'} for k,l in pairs(langs) do if _lang == k then setNextFillColor( fore, 1, 193/255, 32/255, 1) end addText( fore, small, l .. (k<3 and ' |' or ''), rx-96 + k*24, 18) end ---Lateral View --Draw all informations on the lateral panel addText( front, medium, string.upper('| '..planet.name[_lang]), 18, 38) local y = 50 setNextFillColor( front, 10/255, 11/255, 15/255, 1) addBox( front, 0, y, 224, 120) addImage( fore, vignette, 112 - 50, y+10, 100, 100) y = y + 140 addText( front, smallBold, string.upper('| '.. loc.description[_lang]), 18, y) local _lines = rslib.getTextWrapped( small, planet.description and planet.description[_lang] or '-', 200) for k,l in pairs(_lines) do setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, l, 18, y+2+k*10) end y = y + #_lines*10 + 16 addText( front, smallBold, string.upper('| '.. loc.ores[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) local _lines = rslib.getTextWrapped( small, concatList(planet.ores, _lang), 200) for k,l in pairs(_lines) do setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, l, 18, y+2+k*10) end y = y + #_lines*10 + 28 if planet.biosphere then addText( front, smallBold, string.upper('| '.. loc.biosphere[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, planet.biosphere[_lang], 18, y+11) y = y +26 end if planet.habitability then addText( front, smallBold, string.upper('| '.. loc.habitability[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, planet.habitability[_lang], 18, y+11) y = y +26 end if planet.classification then addText( front, smallBold, string.upper('| '.. loc.classification[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, planet.classification[_lang], 18, y+11) y = y +26 end addText( front, smallBold, string.upper('| '.. loc.satellites[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, planet.satellites and #planet.satellites or 0, 18, y+11) y = y +38 addText( front, smallBold, string.upper('| '.. loc.distance[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, string.format('%.2f km', dist/1000), 18, y+11) y = y +26 addText( front, smallBold, string.upper('| '.. loc.radius[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, string.format('%.2f km', planet.radius/1000), 18, y+11) y = y +26 addText( front, smallBold, string.upper('| '.. loc.gravity[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, string.format('%.2f m/s²', planet.gravity), 18, y+11) y = y +26 if planet.hasAtmosphere then addText( front, smallBold, string.upper('| '.. loc.atmoThickness[_lang]), 18, y) setNextFillColor( front, 1, 1, 1, 0.75) addText( front, small, string.format('%.2f m', planet.atmosphereThickness), 18, y+11) end ---# Request animation frame requestAnimationFrame(1)
  13. Lua is a real programming language that can be used in Dual Universe to bring dynamics and interactivity. Whether it is to fly a ship made in voxels or to add movement and functionality to a construct (such as controlling doors), Lua is everywhere. If you haven’t read the first two devblogs in this series, here’s what you missed: Part 1: Recent changes and additions, docking-related changes, and the deprecation of quaternions Part 2: Radar API changes and transponder API additions In Part 3, we’re wrapping up this round of Lua devblogs by taking a look at highly-requested features, an update to the database library, the in-game atlas, and the event handling system. OTHER ADDITIONS We took the time to add a few minor features to the Lua following some popular requests that we felt would gel well with the other changes. <string> core.getConstructName() : Returns the name of the construct. <int> core.getCurrentPlanetId() : Returns the ID of the current close stellar body. <string> system.getPlayerName(<int> pid) : Returns the name of the given player if in range of visibility or broadcasted by a transponder. <list> unit.getMasterPlayerOrgIds() : Returns the list of organization IDs of which the player running the script is a member. <string> system.getOrganizationName(<int> oid) : Returns the name of the given organization, if known, e.g. broadcasted by a transponder. <string> system.getOrganizationTag(<int> oid) : Returns the tag of the given organization, if known, e.g. broadcasted by a transponder. DATABASE LUA LIBRARY UPDATE With all of these other changes and improvements being deployed, it seemed a perfect time to update the local database library accordingly and to add some others based on players’ feedback. You will now find the following functions: <table> database.getPlayer(<int> pid) : Returns all information about a given player, identified by its ID. <table> database.getMasterPlayer(<table> unit) : Returns all information about the player running the script. <table> database.getOrganization(<int> oid) : Returns all information about the given organization, identified by its ID. <table> database.getConstruct(<int> cid) : Returns all information about a given construct, identified by its ID; requires a radar to detect the construct. <table> database.getElement(<table> core,<int> uid) : Returns all information about a given element, identified by its ID, and requires a linked core unit. LUA ATLAS ADDITION Lua designers have indicated the need for an in-game atlas. With the addition of the getCurrentPlanetId function, we can make that available now. We’re pleased that we were able to stick close to a similar structure that players were already familiar with, but with certified values and refactoring, especially for localization aspects. The text fields for the name, description, minerals, etc. are not strings but tables. This was done with the objective of providing simple information in the three languages we currently support: English, French, and German. With this atlas library, you will have the following information: <int> id : The id of the stellar body. <list> name : The name of the stellar body. <list> type: The type of the stellar body (planet or moon). <list> biosphere : The stellar body biosphere. <list> habitability : The level of habitability of the stellar body. <list> classification : The thermal classification of planetary habitability. <list> description: The description of the stellar body. <string> iconPath: The stellar body icon image path (i.e. to be used on screens). <bool> hasAtmosphere: True if the stellar body has an atmosphere. <bool> isSanctuary: True if the stellar body is a sanctuary moon. <bool> isInSafeZone: True if the stellar body is in the safe zone. <int> systemId: The stellar system id in which is the stellar body. <int> positionInSystem: The indicative position of the stellar body in the stellar system. <list> satellites: The list of IDs of the satellites of this stellar body. <vec3> center: The position of the center of the stellar body in world coordinates. <float> gravity: The gravitational acceleration at the nominal radius of the stellar body in m/s². <float> radius: The nominal radius of the stellar body. <float> atmosphereThickness: The atmosphere thickness in meters. <float> atmosphereRadius: The radius of the sphere of the atmosphere measured from the center of the stellar body. <float> surfaceArea: The nominal surface area for the stellar body. <float> surfaceAverageAltitude: The average altitude at the surface of the stellar body. <float> surfaceMaxAltitude: The maximum altitude at the surface of the stellar body. <float> surfaceMinAltitude: The minimum altitude at the surface of the stellar body. <float> GM: The standard gravitational parameter of the stellar body. <list> ores: The list of ores available on the stellar body. <int> territories: The number of territories on the surface of the stellar body. Example of use: local atlas = require(‘atlas’) --You can access to any stellar body from its id : atlas[system_id][stellar_body_id] local alioth = atlas[0][1] EVENT HANDLING LUA LIBRARY ADDITION To make it easier for players to organize and implement an event handling system, either for use on Lua screens or for various board systems, we added a new local Lua event library. This makes it possible to create events, associate actions to it, and manage these events and their emissions. Here is a short documentation of this light library. Event Description: An event contains actions to be triggered on its emission. Properties: <table> actions: The tables of actions attached to the event. Functions : event:emit(...): Emit the event and invoke attached actions with the given arguments. <bool, int> event:findAction(<string> id): Find a specific action associated with this event with the given ID. The function can take an action in argument to know if the action is attached to this event. Arguments: <string> id: The ID of an action. Returns: <bool> success: True if an action is found attached to this event. <bool> index: The index of the action found in the actions table of the event. <string> event:addAction(<any> call,<bool> enabled,<int> limit): Add an action to the event with the given arguments. Arguments: <object> call: The function or the thread invoked when the event is triggered. <bool> enabled: The boolean that indicates whether or not the action is enabled. <int> limit: The number of times the event can invoke this action. Returns: <string> id: The ID of an action. <nil> event:removeAction(<string> id): Remove the action associated with the event with the given arguments. The function can take an action object in argument. Action Description: An action is defined by a callable object, a function, or a thread. Properties: <string> id: This is an ID that can be used later to refer to this action. <any> call: Invoked when the event is triggered. <bool> enabled: This boolean indicates whether or not the action is enabled. <int> limit: This property represents the number of times events can invoke this action. <int> nbCall: This property keeps track of how many times events have invoked this action. <float> interval: This property allows to limit the time interval between two calls. <float> lastCall: This property helps track the time of when we last called this action. Example of use of the Atlas Library. Example of use of the Event Library. <BOOL> ARTICLE.ENDDEVBLOG() We hope you’ve enjoyed the Lua devblog series. Our work here is done, but yours isn’t. Our primary motivation for the blogs was to gather your feedback before perhaps considering further Lua changes and new features, whether for the API, as for the addition of additional libraries. Head over to the forum and join the conversation, share your thoughts and insights, and let us know what Lua-related improvements you’d like to see in the future.
  14. Hello everyone, I just want to quickly chime in on the conversation and take the time to respond to this post. There are a few factors at play here, including security, sandboxing and learning. Particularly the last one, as Lua is a very verbal language, with terms such as if something == true then doAction() end It is a particularly easy language for someone to learn who has never seen code before, and as Dual Universe is a game for everyone it is a much better fit. Besides that, it also meshes well with C++, can be nicely sandboxed and is commonly used in many games and thus a familiar platform for many players. Chances are high, that if you have good knowledge of JS, Lua will be a piece of cake to learn. On top of all that, there is also simply: Lua, Lua, oh baby, said we gotta go. Yeah, yeah, yeah, yeah...
  15. Sure, you can go it alone in Dual Universe, but you don’t have to, thanks to our new Recruit a Friend program. Who better than your tried and true mates to join you as wingmen on your epic adventures? The Recruit a Friend program is a reward system that allows you to earn free game time and great in-game rewards (including exclusive item skins and elements such as thrones and firework types) when you invite friends to purchase game time. In turn, your recruits will also receive items that will help them in their journey, such as handy starter elements, a speeder blueprint, and a week’s worth of talent points. The program is built in a way that rewards the total game time purchased by your recruits and not just the total number of players who were recruited. Watch this video to see the incredible benefits that await you and your recruits: HOW DOES IT WORK ? GET YOUR CODE Go to My Account, copy your Recruiter link and send it to your friends. RECRUIT A NOVEAN When your friends: create a Dual Universe account with your unique link (clicking on it will redirect your friend directly to the signup page), or enter your link in My Account before subscribing for the first time with an existing account, or enter your link in My Account before applying game time for the first time on an existing account, THEN, their accounts become linked to yours. GET THE REWARDS Every time a linked friend buys game time, it is added to your total and contributes toward unlocking new rewards. CHECK YOUR PROGRESS Go to My Account to check which rewards you have unlocked. Visit the Recruit a Friend page on our website for more information. You need to have an active subscription to qualify for the Recruitment Program.
×
×
  • Create New...