Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rinart73

  1. Avorion: 0.15.x (maybe even older) - 0.31.1

    File: data\scripts\entity\merchants\factory.lua

     

    Function "getFighterStartErrorMessage" incorrectly processes "FighterStartError.FighterNotFound", because it double checks for "FighterStartError.MaximumFightersStarted" instead (Line 2010):

     

    function Factory.getFighterStartErrorMessage(code)
    
        if code == FighterStartError.NoError then
            return "No error."%_T
        elseif code == FighterStartError.NoHangar then
            return "No hangar!"%_T
        elseif code == FighterStartError.SquadNotFound then
            return "Squad not found!"%_T
        elseif code == FighterStartError.SquadEmpty then
            return "Squad empty!"%_T
        elseif code == FighterStartError.NoStartPosition then
            return "No start position!"%_T
        elseif code == FighterStartError.MaximumFightersStarted then
            return "Maximum fighters started!"%_T
        elseif code == FighterStartError.MaximumFightersStarted then
            return "Fighter not found!"%_T
        elseif code == FighterStartError.NoPilots then
            return "Not enough pilots!"%_T
        elseif code == FighterStartError.NoCrew then
            return "Not enough crew!"%_T
        elseif code == FighterStartError.NoFighterFound then
            return "No cargo shuttles!"%_T
        end
    
        return "Unknown error"%_T
    end

     

    Should be:

     

    function Factory.getFighterStartErrorMessage(code)
    
        if code == FighterStartError.NoError then
            return "No error."%_T
        elseif code == FighterStartError.NoHangar then
            return "No hangar!"%_T
        elseif code == FighterStartError.SquadNotFound then
            return "Squad not found!"%_T
        elseif code == FighterStartError.SquadEmpty then
            return "Squad empty!"%_T
        elseif code == FighterStartError.NoStartPosition then
            return "No start position!"%_T
        elseif code == FighterStartError.MaximumFightersStarted then
            return "Maximum fighters started!"%_T
        elseif code == FighterStartError.FighterNotFound then
            return "Fighter not found!"%_T
        elseif code == FighterStartError.NoPilots then
            return "Not enough pilots!"%_T
        elseif code == FighterStartError.NoCrew then
            return "Not enough crew!"%_T
        elseif code == FighterStartError.NoFighterFound then
            return "No cargo shuttles!"%_T
        end
    
        return "Unknown error"%_T
    end

  2. I too think that recharge time should depend on a ship size. 15-slot huge capital ships should have significantly bigger recharge time even if heavilly equipped with Hyperspace upgrades. This will force players to use smaller ships which will give some chances for the NPC. Right now players just build huge ships that outscale NPC ships.

     

    Lowering cooldown in empty sectors kinda makes sense game-wise (so people wouldn't get bored) but this creates a problem - now it's much easier for players to beeline to the barrier ignoring all iron-trinium content.

     

    jump calculation time

    Jump calculation time is actually sector loading/generation. It depends on server hardware.

  3. New Ship Generator looks awesome.

    I have a few questions:

    [*]Will new Ship Generator apply to station generation as well? And if yes, will stations have slightly different style/set of styles in order to better distinguish them and just because logically there is a difference between moving battleship and a habitat?

    [*]Will new Ship Generator do better job at creating fully capable ships? Because the current one often creates plans that lack thrust, rotation or acceleration and while it would be logical for a trader ship, slow military ships aren't very effective :)

    [*]Speaking of military ships and stats - current generator doesn't care about protecting vulnerable important blocks like generators and batteries. Is there a chance that new generator will try to protect them will hull or armor (at least for military ships and military outpost stations)?

  4. Avorion: 0.29.6 (also probably earlier versions too)

     

    1. Have looong combo box (tried with value combo box) with a bunch of items (for example the goods list)

    2. Select something close to the end (like "Warhead")

    3. Clear the combo box and add less items to list but include the selected one.

    4. Re-select "Warheads" via code.

    5. Get the result - unscrollable list, impossible to select something else.

     

    UPD: Apparently the source of the problem is that setting index/value of a ValueComboBox/ComboBox doesn't scroll it to the selected item. And if current scrolling position is further than new maximum, the scrolling gets stuck

     

    UPD: ListBox has the lighter version of the same problem - once use tries to scroll, the element fixes itself. But still, the problem exists.

     

    Suggestion: Make so setting index or value (ValueComboBox) via Lua would forcibly scroll combo box to the selected position. This would solve the issue and make Combo Boxes more user-friendly.

    avorion-combo-box-bug.jpg.22f2102df302f39176460546540559c7.jpg

  5. Avorion: 0.26.1

    OS: Debian 10 64bit

    Hardware: Ryzen 3700x, 64GB RAM DDR4

     

    Server crashed two times with following errors:

    === STACKTRACE =====================================
    #1: ut::signalBacktrace(int) [0xdd551e]
    #2: [ext] ?? [0x7fea3190c840]
    #3: [ext] ?? [0x7fea3190c7bb]
    #4: [ext] ?? [0x7fea318f7535]
    #5: [ext] ?? [0x7fea31ce2983]
    #6: [ext] ?? [0x7fea31ce88c6]
    #7: [ext] ?? [0x7fea31ce8901]
    #8: [ext] ?? [0x7fea31ce963f]
    #9: Galaxy::setFactionRelationStatus(int, int, RelationStatus, bool, bool) [0x565d8b]
    #10: Galaxy::getPirates(unsigned int) [0x56628d]
    #11: ScriptGalaxy_script_detail::member_getPirateFaction(lua_State*) [0x4fe8b0]
    #12: ?? [0xe8a52d]
    #13: ?? [0xe9f064]
    #14: ?? [0xe8acb9]
    #15: ?? [0xe89ba9]
    #16: ?? [0xe8afe1]
    #17: ?? [0xe82438]
    #18: std::vector<LuaValue, std::allocator<LuaValue> > lua::State::doCall<std::vector<LuaValue, std::allocator<LuaValue> > >(unsigned int) [0x4021e2]
    #19: void GameCallbackSender::safeCallback<double&>(std::string const&, double&) [0x4a008b]
    #20: CreateSectorWorkPacket::load() [0x49c676]
    #21: CreateSectorWorkPacket::run() [0x49c9c0]
    #22: ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > >::workSinglePacket() [0x45efda]
    #23: std::thread::_Impl<std::_Bind_simple<ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > > ()> >::_M_run() [0x45fdd0]
    #24: [ext] ?? [0x7fea31d11e50]
    #25: [ext] ?? [0x7fea31a9dfa3]
    #26: [ext] ?? [0x7fea319ce4cf]
    ===================================================

     

    and

     

    === STACKTRACE =====================================
    #1: ut::signalBacktrace(int) [0xdd551e]
    #2: [ext] ?? [0x7f96f2e3d840]
    #3: GameScript::checkCallbackSafety(GameCallbackSender&) [0x8658df]
    #4: void GameCallbackSender::safeCallback<std::tuple<int, int>&>(std::string const&, std::tuple<int, int>&) [0x5a1051]
    #5: DelayedCallbackSender::sendDelayedCallbacks() [0x839776]
    #6: ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > >::workSinglePacket() [0x45efda]
    #7: std::thread::_Impl<std::_Bind_simple<ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > > ()> >::_M_run() [0x45fdd0]
    #8: [ext] ?? [0x7f96f3242e50]
    #9: [ext] ?? [0x7f96f2fcefa3]
    #10: [ext] ?? [0x7f96f2eff4cf]
    ===================================================

     

    I'd like to send full logs in private because we're playing on CorePVP server.

  6. Avorion: 0.26.1

     

    Script "data\scripts\player\events\headhunter.lua"  - function "HeadHunter.findNearbyEnemyFaction"

    "Player().craftFaction" is occasionally "nil", this breaks the script.

     

    I suggest to replace line 106:

    local player = Player().craftFaction

    with

    local player = Player()
    player = player.craftFaction or player

  7. Avorion: 0.26.1

    OS: Debian 10 64bit

    Hardware: Ryzen 3700x, 64GB RAM DDR4

     

    We have a big multiplayer server (40 people max, usually around 25). Server logs are messed up, it's either something with threads in general or just the logs. We have a bunch of messages like this:

    SectorDatabase: Loading Sector (-42Creating sector at :444()-50

    :440)

    SectorDatabase: Loading Sector (6:466SectorDatabase: Loading Sector )(

    -3:454)

    Creating sector at Creating sector at ((-78:182-79):

    186)

    Creating sector at Creating sector at ((2623::416413))Creating sector at

    (

    20:416)

  8. Avorion: 0.26.1

    Ubuntu, 64GB RAM

     

    Server occasionally completely freezes when people try to generate new sectors. We're getting following error:

    bad_alloc thrown for a size of 139883699040224
    === STACKTRACE =====================================
    #1: operator new(unsigned long) [0xdb1a79]
    #2: [ext] std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) [0x7f396d734c79]
    #3: [ext] std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) [0x7f396d735aeb]
    #4: [ext] std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) [0x7f396d7361cc]
    #5: Script::makeExecutionContext(std::string const&) [0xc61289]
    #6: void GameCallbackSender::safeCallback<std::tuple<int, int>&>(std::string const&, std::tuple<int, int>&) [0x5a1069]
    #7: DelayedCallbackSender::sendDelayedCallbacks() [0x839776]
    #8: ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > >::workSinglePacket() [0x45efda]
    #9: std::thread::_Impl<std::_Bind_simple<ut::Worker<ut::queue<std::shared_ptr<ut::WorkPacket> > > ()> >::_M_run() [0x45fdd0]
    #10: [ext] ?? [0x7f396d71fe50]
    #11: [ext] ?? [0x7f396d4abfa3]
    #12: [ext] ?? [0x7f396d3dc4cf]
    ===================================================Exception in Game WorkPool worker thread 0: std::bad_alloc

  9. Avorion: 0.26.1

    Windows 10 x64

     

    I get the following error:

    Error constructing Entity: Entities can only be created in context of a scene
    on line:

    local entity = Entity()

     

    My code:

    local data = {}
    --- other code
    function Buffs.secure()
        local entity = Entity()
        -- save energy and shield
        data.shield = entity.shieldDurability
        if entity:hasComponent(ComponentType.EnergySystem) then
            data.energy = EnergySystem(entity).energy
        else
            data.energy = nil
        end
    
        return data
    end

  10. I found the source of the problem.

     

    For players: https://steamcommunity.com/sharedfiles/filedetails/?id=1868721180

     

    For developers:

    "data\scripts\entity\ai\mine.lua"

    Replace "AIMine.canContinueMining()" function with this one:

    function AIMine.canContinueMining() -- overridden
        -- prevent terminating script before it even started
        if not miningMaterial then return true end
    
        return valid(minedLoot) or valid(minedAsteroid) or not noAsteroidsLeft
    end

     

    Both orderchain.lua and mine.lua perform checks every second. There is a moment where a ship finished mining an asteroid and collected all loot, but didn't find the next asteroid yet. So the function returns "false" there and the orderchain stops the script.

    "canContinueMining" should return false only if there are no asteroids left.

     

    The same thing for salvaging:

    function AISalvage.canContinueSalvaging() -- overridden
        -- prevent terminating script before it even started
        if not salvagingMaterial then return true end
    
        return valid(minedLoot) or valid(minedWreckage) or not noWreckagesLeft
    end

  11. Avorion: 0.25.2 (and earlier) - 0.26.1 0.29.6

     

    data\scripts\lib\galaxy.lua

    function Balancing_InsideRing(x, y)
        local d2 = x * x + y * y
        return d2 < blockRingMin * blockRingMin
    end
    

     

    "<" should be replaced with "<=", otherwise if we're in the sector (147:0) (which IS inside ring), "Balancing_InsideRing" returns "false"

  12. Can we get a serverside variant of a Player's callback "onAllianceChanged(allianceIndex)"? Otherwise I have to attach "onNewMember" and "onMemberLeft" callbacks to every alliance and it's not great since Alliances get unloaded.

    So if Alliance is unloaded and player accepts an invitation, "onNewMember" won't fire.

  13. Avorion: 0.26.1

     

    I'm trying to globally track whenever a player joins an alliance.

    So I registered an "onNewMember" callback for every alliance in the "main.lua":

    function onNewMember(playerIndex, rank)
        local player = Player(playerIndex)
        print(string.format("Player %i joined the alliance %s", playerIndex, tostring(player.allianceIndex)))
    end
    

     

    But "player.allianceIndex" is nil. So apparently this callback happens BEFORE player's allianceIndex gets a value.

  14. Currently it's impossible to get some basic ship stats before they were affected by bonuses. Stats in "BlockStatistics" are either incomplete or require to use some formula that modders don't know.

    • Hyperspace Reach - "BlockStatistics" has hyperspacePower and it seems that it's hyperspace calculation power from blocks. What does it mean? Is there some formula to transform it into hyperspace reach? (Nvm it's cubic root of "hyperspacePower")
    • Hyperspace Cooldown - No stat or formula
    • Hyperspace Recharge Energy - No stat or formula
    • Shield Recharge Rate - No stat or formula
    • Velocity - When it comes to Avorion stats, velocity is the max speed you can get. No stat or formula
    • Acceleration - I thought that it's "trust" from "BlockStatistics" but I'm getting some weird numbers there
    • Loot Collection Range - Tests show that it's somewhere between 0.95km and 1 km
    • Radar Reach - It seems that default radar reach is 14?

  15. Avorion: 0.26

     

    During "xsotantransformed.lua" sector generation it picks random generator script, executes it and then destroys everything so it looks like it was an actual sector before. The problem is this part of the code (line 176-178):

    for _, script in pairs(sector:getScripts()) do
        sector:removeScript(script)
    end
    

     

    It removes ALL scripts, even the ones that shouldn't be removed like relationchanges, spawnpersecutors, boardingutility, warzonecheck and radiochatter+ modded scripts that should be persistent.

     

    My suggestion is replacing that code with this one:

     

    for _, script in pairs(sector:getScripts()) do
        sector:removeScript(script)
    end
    -- restore basic scripts
    include("data/scripts/sector/init.lua")
    

     

    This way sector will get back it's persistent scripts.

×
×
  • Create New...