Jump to content

Bix

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by Bix

  1. It's not something about number of players, 99.9% sure.

     

    The graphics of the UI don't freeze when moved, but the numbers do so yes it may be an overload of refreshes, but it shouldn't as we really don't have a lot of stations, and "only" on or two squads of cargo per station.

  2. Yes I did, but I'd really prefer to get the same color pattern as the vanilla. Red, orange, yellow, purple, blue, green.

     

    I know it's not the best for readability but that's faster to spot the different factions.

     

    edit : Since the most of color gradiants are between -10 000 and 10 000, I think it's not possible to do so as the code is setting colors by steps of 10 000, if I understand ^^'

     

    function GetRelationColor(relation)
        for _, RC in pairs(RelationColors) do
            local result = RC.Relation - relation
            --print(RC.Relation,relation,math.abs(result))
            if math.abs(result) < 10000 then
                return RC.R, RC.G, RC.B
            end
        end
    end

    ShipNotifier.lua.xml

  3. ybqybw8q

     

    As I said I have zero knowledge, what I did is to put your code just before the first local with "faction()" in it ^^:

     

        local faction = player or player.allianceIndex
        local playerFaction = Faction()

     

    function ShipNotifier.detect()
        if onClient() then
            invokeServerFunction('detect')
            return
        end
    
        local ships = {Sector():getEntitiesByType(EntityType.Ship)}
    local stations = {Sector():getEntitiesByType(EntityType.Station)}
    
        local faction = player or player.allianceIndex
        local playerFaction = Faction()
    
        ShipData = {}
        ShipData.Ships = {}
    
        for _, ship in pairs(ships) do
            local index = ship.index
            local name = ship.name
            local title = ship.translatedTitle
            local factionIndex = ship.factionIndex
            local civilship = ship:hasScript("civilship.lua")
            local relation = playerFaction:getRelations(factionIndex)
            
            local bulletin = ship:getValue("hasBulletin")
            
            if bulletin == 1 then
                bulletin = "[!] "
            else
                bulletin = ""
            end
            
            --print (tostring(name) .. " | " .. tostring(title) .. " | " .. tostring(factionIndex) .. " | " .. tostring(civilship) .. " | " .. tostring(relation))
            local shipData = {index = index, name = name, title = title, factionIndex = factionIndex, civilship = civilship, relation = relation, bulletin = bulletin}
            table.insert(ShipData.Ships, shipData)
        end
    
    for _, station in pairs(stations) do
            local index = station.index
            local name = station.name
            local title = station.translatedTitle
            local factionIndex = station.factionIndex
            local civilship = station:hasScript("civilship.lua")
            local relation = playerFaction:getRelations(factionIndex)
            
            local bulletin = station:getValue("hasBulletin")
            
            if bulletin == 1 then
                bulletin = "[!]"
            else
                bulletin = ""
            end
            
            --print (tostring(name) .. " | " .. tostring(title) .. " | " .. tostring(factionIndex) .. " | " .. tostring(civilship) .. " | " .. tostring(relation))
            local shipData = {index = index, name = name, title = title, factionIndex = factionIndex, civilship = civilship, relation = relation, bulletin = bulletin}
            table.insert(ShipData.Ships, shipData)
        end
    
        ShipNotifier.sync()
    end

  4. Ok Now I follow you.

     

    Lag is now completely unacceptable, despite our efforts to recycle turrets and systems. It's now, since we've crossed the great Barrier (maybe not related) (near) impossible to scroll or even give/take any item from the stash.

     

    We don't have a lot of ships nor a lot of stations. The fremerate is under 10fps (60 without menu)

    ya5tv99m

    "Fun" fact : the lag disappears when the window is beeing moved.

  5. Hey, I've tried your mod few days ago but uninstalled it right after.

    I made the mistake to contact the station and start researching items without beeing docked but the script gone crazy and I had to restart client and server, I can't keep this installed if it can hang everything like this, that's too bad because the auto research is a really nice feature !

     

    Also, as this overwrite the original script file, do players can run into bugs if having the script installed on server BUT not on their client ?

  6. From my (short) experience, menus get slower the more items you loot in alliance/player inventory. After some research and resell to clean up mdules, everything get fine again, at least for some time. The limit seems to sit around ~800 items on my server.

  7. Thanks for this mod, really, this is my number one favorite !

     

    One thing bother me thought, the alphabetic sorting, it's either on the ship.name and not useful at all (for me) or on the ship.title and then can flicker if there's two or more from the same type.

    Is it possible to sort by title and/then by name ?

     

    a bit like this :

    		local sort_func = function( a,b ) return a.title.name < b.title.name end
    	table.sort(ShipData.Ships, sort_func)

     

    But I don't think it would work, I have zero knowledge in coding.

     

     

    edit :

     

    OK ! I've found with some search !

     

    		local sort_func = function( a,b ) return (a.title < b.title) or (a.title == b.title and a.name < b.name) end
    	table.sort(ShipData.Ships, sort_func)

     

    Now everything is fine :D

    yb53jfm8

×
×
  • Create New...