Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • News
    • General Discussion
    • Gameplay Discussion
    • Creations
    • Suggestions & Idea Voting
    • Troubleshooting
    • Multiplayer
    • User Guides
    • Mods
    • Bugs
    • Translations
  • Beta Branch
    • Beta Patch Notes
    • Feedback
    • Bugs
  • Off-Topic
    • General Off-Topic

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me

Found 6 results

  1. 2.2 overriden native Lua function table.concat: Avorion\data\scripts\lib\utility.lua function table.concat(tbl, add) for _, value in pairs(add) do table.insert(tbl, value) end end I ask you to change the function name because native table.concat ( http://lua-users.org/wiki/TableLibraryTutorial ) works in a completely different way. Your change breaks all mods that use this function and also confuses future modders who will expect native functions to behave in a same way.
  2. We can change sector name on the server-side: Sector().name = "Test" But we can't access it on the client-side. Please add readable "Sector().name" property.
  3. Currently we can get lots of info about player/alliance ships: cargo, systems, orders and even a bounding box. But we can't get one of the most basic but important properties - entity Uuid. It would be great to have following functions: local entityUuid = Player():getShipUuid(string name) local entityUuid = Alliance():getShipUuid(string name)
  4. Avorion is really missing 2D functions like "UIRenderer():renderCircle()" and "drawCircle()". Example from an actual mod: I need to draw bosses encounter areas on the galaxy map. They're circular. But Avorion API doesn't have a way to draw circles. So I draw a pseudo-circle using lots and lots of lines. It works, as you see, but the FPS drops from 60 to 40, because of that.
  5. I'm requesting a function that would allow to get all sectors controlled by a faction through influence (client-side and maybe server-side): local sectors = {Galaxy():getFactionControlledSectors(int factionIndex)} Why? Right now on both client & server we can get all sectors that are owned (have stations in them) by a faction (at least the ones that player/alliance know about): local sectors = {Player():getKnownSectorsOfFaction(int factionIndex)} But all owned sectors have influence that spreads in a circle shape around them. And currently there is no performance-friendly way to get list of sectors controlled by a faction through influence. Currently to get that list I have to do the following: Get all owned sectors of a faction Get the "influence" stat from their SectorView Transform this influence value into a radius (which is bigger than it actually is for some reason) local approximateRadius = math.sqrt(influenceValue / math.pi) Get all sectors that completely fit in that radius For each of them call this function: Galaxy():getControllingFaction(n, m) It takes 1-1.2 seconds to get this info for 1/7 of a galaxy. Not very fast, but right now there is just no other way to do this.
  6. It would be great to have a way of knowing text width & height (height is more important actually) before rendering it or creating an element for it. -- function getTextDimensions(text, fontSize, maxWidth, fontType, isBold, isItalic, isOutlined, isShadowed) -- Arguments: -- string text -- int fontSize -- int maxWidth (maximum text width, after exceeding it text should use new lines) -- FontType fontType (optional, default: FontType.Normal) -- bool isBold (optional, default: false) -- bool isItalic (optional, default: false) -- bool isOutlined (optional, default: false) -- bool isShadowed (optional, default: false) local w, h = getTextDimensions("The \\c(0d0)hideout\\c() is located in \\s(45:15)", 15, 400) Or maybe it would be easier to implement "textWidth" and "textHeight" read-only properties for TextField and Label elements that would tell the actual width and height of their assigned text, so we could instantly resize it after creating. Why? Here is an example. Let's say we have multiple rows with various text in a ScrollFrame. If we're using static pre-determined row heights, we will get empty spaces after text or text that goes out of the designated rectangle. Even with auto-resize (shrinking), huge amount of text would look ugly, being too small and unreadable (also auto-shrinking doesn't work with multi-line labels). Having a way to know the actual height of the text would allow to create rows that would fit the text no matter what. Why not just create this function in Lua? Because we would have to manually extract relative width for every character in Unicode font (TTF fonts support up to 65535 characters ) for every font (not just vanilla, but the modded ones too!) And because we would have to re-implement the Unicode Line Breaking Algorithm in Lua (which would have low performance)
  • Create New...