Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rinart73

  1. Currently relations with an Equipment Dock faction doesn't matter.

     

    I suggest to give the ability to remove permanent upgrades only if relations between ship owner faction and station owner faction are positive ( > 0 ).

    • This is logical, because most of the other station services aren't available for enemies.
    • This will motivate players to have good relations with NPC factions.
    • This will give the owners of the station and their allies an advantage in defending it in PVP. Because defenders will have the ability to swap permanent upgrades and attackers will not.

  2. [both sides] [0.18.3 - 0.19]

     

    Features

    • Detects Energy Signature Suppressors in the current sector and shows the max time before they will burn out.

    The data is updated when player enters the sector and every 29 seconds. You can adjust the value in the "mods\MoveUI\scripts\player\EnergySuppressorDetector.lua" file.

     

    Installation

    1. Install the MoveUI mod

    2. Unpack the module in the "Avorion" folder

    3. Add following line in the file "mods\MoveUI\config\MoveUIConfig.lua" before the line "return MoveUIConfig":

    MoveUIConfig.AddUI("EnergySuppressorDetector", false)

    4. Toggle the module on in the MoveUI interface.

     

    Changelog

     

     

    1.1.0

    • Improved: Now updates when Energy Signature Suppressor is created or destroyed in the sector

    1.0.0

    • Initial release

     

    MoveUI-EnergySuppressorDetector-1.0.0_0.18.3-0.19.zip

    MoveUI-EnergySuppressorDetector-1.1.0_0.18.3-0.19.zip

  3. due to the negativity it can bring

    I'm soo negative! Those devs are actually working to fix bugs and improve the game  ;D

     

    show how much effort they actually put into the game, especially regarding ignoring and adressing the big issues of the game

    Yeah, you're right. If serious, I think that previous years brought more quality updates, but maybe it's just my perspective.

     

    Anyway thanks for the explanation.

  4. Public bugtracker would help both sides. You (devs) will know which bugs are not fixed and will also get an abilty to categorize them and we, players, will know which bugs were already reported and being worked on.

    Because some (even small but annoying) bugs were reported a long time ago and still aren't fixed.

  5. [both sides] [0.18.3 - 0.19]

     

    Features

    • Fixes clientside bugs that sometimes caused wrong mine or factory types to be selected and created ("Silver & Gold" instead of "Silver & Platinum" for example)
    • Fixes serverside bug that prevented mine title from being translated

    Both of these bugs were reported here.

     

    Installation

    [*]Make a backup of the files "data\scripts\entity\minefounder.lua" and "data\scripts\entity\stationfounder.lua"

    [*]Unpack the mod in the "Avorion" folder

     

    Uninstallation

    [*]Restore the files "data\scripts\entity\minefounder.lua" and "data\scripts\entity\stationfounder.lua" from backup

     

    Changelog

     

     

    1.1.0

    • Improved: Mine founding fix
    • Added: Factory founding fix, because it has the same bug

    1.0.0

    • Initial release

     

    MineFoundingFixes-1.0.0_0.18.3-0.19.zip

    FoundingFixes-1.1.0_0.18.3-0.19.zip

  6. DrMasik, Hi. I disagree. There a plenty of examples when Entity scripts registered Sector callbacks. So why registering Server callbacks from Sector script is incorrect?

     

    If you want to canch player enternce to sector - try to use Sector():onPlayerEntered() and Sector():onPlayerLeft().

    No, I specifically need to react when player logins/logoffs.

     

    I already found the solution: Server callbacks can be successfully registered in the first update tick.

  7. Also, currently there is no cheat-proof way for server-side to know when sector is loaded on client-side.

    Callbacks like "onPlayerEntered" and other fire when player changes sector on server-side.

     

    Maybe you could prevent any actions from player until they will confirm that sector is loaded on their side and make a callback out of it? It would be useful, for example modders could use it to protect ships after jump while player is loading.

  8. Starting from verison 0.18.3 Alliance:getMembers() returns a set of player indexes. But in the API docs I see the old description:

    function table<int, Member> getMembers()

     

    So basically instead of doing this:

    for pIndex, _ in pairs(Alliance(allianceIndex):getMembers()) do
        -- something
    end
    

    Now modders need to do this:

    for _, pIndex in pairs({Alliance(allianceIndex):getMembers()}) do
        -- something
    end
    

     

    I guess you just forgot to update API docs. But it still was a very frustrating experience :)

  9. I have a script that is attached to sector. And I need to do stuff immediately after player login/logoff.

    if onClient() then return end
    
    -- namespace SectorTest
    SectorTest = {}
    
    function SectorTest.initialize()
        local server = Server()
        server:registerCallback("onPlayerLogIn", "onPlayerLogIn")
        server:registerCallback("onPlayerLogOff", "onPlayerLogOff")
    end
    
    function SectorTest.onPlayerLogIn(playerIndex)
        print("onPlayerLogIn", playerIndex)
    end
    
    function SectorTest.onPlayerLogOff(playerIndex)
        print("onPlayerLogOff", playerIndex)
    end
    

     

    But when I'm trying to register these callbacks nothing happens when player enters/leaves the game. And if server is launched from bat file, following message appears in server logs:

    warning: tried unregistering a callback from server to script mods/ServerGuard/scripts/sector/deferredtest.lua in sector (200:200), which is being generated

     

    Why it's not allowed? We can call other Server functions like "isOnline(playerIndex)" from Sector scripts just fine.

     

    Of course, I can just check if each player is online/offline every 10 seconds. But it will not produce immediate reponce and will not be performance-friendly.

     


     

    UPD: Apparently it works if you'll register callbacks after "initialize" function (in first update for example). But why? It's implied that Sector initialize function is called after everything is loaded.

     

    if onClient() then return end
    
    local callbacksRegistered = false
    
    -- namespace SectorTest
    SectorTest = {}
    
    function SectorTest.updateServer()
        if callbacksRegistered then return end
        local server = Server()
        server:registerCallback("onPlayerLogIn", "onPlayerLogIn")
        server:registerCallback("onPlayerLogOff", "onPlayerLogOff")
        callbacksRegistered = true
    end
    
    function SectorTest.onPlayerLogIn(playerIndex)
        print("onPlayerLogIn", playerIndex)
    end
    
    function SectorTest.onPlayerLogOff(playerIndex)
        print("onPlayerLogOff", playerIndex)
    end
    

  10. I need to know which ship fired the shot. So, I register a callback:

    function MyMod.initialize()
        Sector():registerCallback("onStartFiring", "onSomeoneFired")
    end
    
    function MyMod.onSomeoneFired(turretId)
        local turret = Entity(turretId)
    end
    

     

    And now what? There is no way to get "parent entity" of other entity.

  11. Found two bugs in the "data\scripts\entity\minefounder.lua" and one in the "data\scripts\entity\stationfounder.lua".

     

    1. Sometimes when you want to create "Silver & Platinum" mine, "Silver & Gold" will be created instead. This happens because of typical "Lua doesn't care about the order in 'for in pairs'". Also because factories is categorized by goods but there is no check if current good is the first output.

    How to fix:

    Line 123-125, replace:

    for _, productions in pairs(productionsByGood) do
    
            for index, production in pairs(productions) do
    

    with

    local production
    
        for _, productions in pairs(productionsByGood) do
    
            for index = 1, #productions do
                production = productions[index]
    

     

    Line 138-142, replace:

    if levels[result.level] ~= nil and not usedProductions[production.index] then
        usedProductions[production.index] = true
        table.insert(possibleProductions, {production=production, index=index})
    end
    

    with

    if _ == production.results[1].name then
        if levels[result.level] ~= nil and not usedProductions[production.index] then
            usedProductions[production.index] = true
            table.insert(possibleProductions, {production=production, index=index})
        end
    end
    

     


    2. When you found a mine, it will have untranslated title.

    How to fix:

    Line 290, replace:

    station:invokeFunction("factory", "setProduction", production, 1)
    

    with

    station:invokeFunction("factory", "setProduction", production, 1)
    station:invokeFunction("factory", "updateTitle")
    

    And remove lines 281-285:

    if goodName == "Raw Oil" then
        station.title = "Oil Rig"%_t
    else
        station.title = "${good} Mine"%_t % {good = goodName}
    end
    

     


    --------

    3. Also, the same bug (wrong factory) can happen when founding stations. Just do the same in the "data\scripts\entity\stationfounder.lua" file:

    Line 335-338, replace:

    for _, productions in pairs(productionsByGood) do
    
            for index, production in pairs(productions) do
    

    with

    local production
    
        for _, productions in pairs(productionsByGood) do
    
            for index = 1, #productions do
                production = productions[index]
    

     

    And Line 342-336, replace:

    if levels[result.level] ~= nil and not usedProductions[production.index] then
        usedProductions[production.index] = true
        table.insert(possibleProductions, {production=production, index=index})
    end
    

    with

    if _ == production.results[1].name then
        if levels[result.level] ~= nil and not usedProductions[production.index] then
            usedProductions[production.index] = true
            table.insert(possibleProductions, {production=production, index=index})
        end
    end
    

  12. If you'll move inventory, systems, alliance windows from C++ to the Lua it will help to improve the game, because modders will be able to customize the main UI.

    From what I see, all these windows use the same UI elements that are accessible in the Lua API.

     

    Examples:

    1. I'd like to add one more Alliance-storage into Alliance window and make it a Recruit-storage.

    So basically in the vanilla storage we'll have high-value items and in the new storage we'll have a basic set of things that will help Recruits while they gain out Alliance trust. It's a more-less common practice that I saw in few games and I like it: clan-storage and clan-safe.

    Of course, I can make a mod right now, but this new Alliance-storage will be separated from the Alliance window and this will look stupid.

     

    2. Several modders (myself included) always wanted to customize inventory window, to make it more user-friendly: Highlighting suspicious/illegal goods, moving multiple items between Alliance-storage and player-storage at once e.t.c

     

    3. Modify system upgrades UI to add quickly interchangeable presets. This was already done as a mod, but it's better to keep related things in one place instead of clogging right upper corner of the screen with icons.

  13. Well, if you want to disable some type of damage in certain sectors (collision for example), I think you can use this code. But keep in mind that it's a dark magic and anything could happen :)

    Few important moments:

    • You will still see as your health decreases. I guess it's a visual bug because in reality you take no damage. Health bar will return to the normal state in few seconds.
    • While "invincible = true", you take no damage from any weapon. In theory, if you press against an asteroid while enemies shoot at you, you will receive less damage.

     

    -- namespace TestMod
    TestMod = {}
    
    local collisionCounter = 0
    
    function TestMod.initialize()
        Entity():registerCallback("onDamaged", "onDamaged")
    end
    
    function TestMod.onDamaged(objectIndex, amount, inflictor, damageType)
        if damageType == DamageType.Collision then
            Entity().invincible = true
            collisionCounter = collisionCounter + 1 -- each time collision happens we increase counter
            deferredCallback(0, "undoInvincibility") -- and plan to call function that will undo invincibility
        end
    end
    
    function TestMod.undoInvincibility()
        -- we need counter to ensure that we undo invincibility after all collisions happened
        collisionCounter = collisionCounter - 1
        if collisionCounter == 0 then
            Entity().invincible = false
        end
    end
    

  14. No, it's not overwriting. There is a difference between predefined functions (such as initialize, update, secure..) and callbacks.

    You just need to add predefined function and it will be detected and called by the game.

     

    But when it comes to callbacks, you need to register them item via:

    Entity():registerCallback(string callbackName, string functionName) 

     

    And actually you can use any function name, for example:

    function MyModNamespace.initialize()
        Entity():registerCallback("onBlockDamaged", "onSomeBlockSuddenlyDamaged")
    end
    
    function MyModNamespace.onSomeBlockSuddenlyDamaged(objectIndex, blockIndex, inflictorId, damage, damageType)
        local entity = Entity(objectIndex)
        entity:heal(damage, blockIndex, vec3(), entity.factionIndex) 
    end
    

×
×
  • Create New...