Author Topic: [MOD](v0.5.1) FleetControl - easy management of ship groups and more  (Read 26604 times)

Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
on: January 13, 2018, 04:36:01 AM
Yup, this works a charm. I'm currently ordering my three Salvagers squadrons to go collect some scrap with one click of the button: "Start Salvaging". Done? Click "Dock All Fighters". It's intense how much nicer this mod made controlling fighters, and I was already pretty satisfied with the vanilla micro-managing.
Shrooblord



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
on: January 28, 2018, 10:34:43 PM
FleetControl doesn't appear to function with Alliance ships. Is this intentional?
Shrooblord



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: January 29, 2018, 09:22:36 PM
im using the latest avorion version as of 1/29/18 and i copy the files to the directory , load the game, started a new galaxy, and when i type /fleetcontrol the icon doesnt appear also tried /fleetcontrol enable
Any ideas?



Ravien

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    250
    • View Profile
on: January 30, 2018, 12:22:03 PM
im using the latest avorion version as of 1/29/18 and i copy the files to the directory , load the game, started a new galaxy, and when i type /fleetcontrol the icon doesnt appear also tried /fleetcontrol enable
Any ideas?

I am having the same problem but I'm on the beta branch so that might be why.



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
on: January 30, 2018, 03:14:59 PM
I've run the latest version - 0.4 - basically since I've played Avorion, and never had an issue with it. I'm currently also running the latest Beta, and it works fine for me, also in new games.

Can you guys tell me your mod setup? How did you try and install this mod?

Note: although the first post says it won't overwrite any vanilla files, this is in fact not true. I think it's craftorders.lua that's included with the files, which would get overwritten by simply installing this mod.

I recommend you do your due diligence and use DiffChecker to compare differences between vanilla files and this mod's files, and change your own installation accordingly.

I know that's a grueling and slow process (believe me, I spent 1 hour and 40 minutes the other day installing all my mods again after updating to Beta), but that's the way it is right now, and it definitely is the most secure way to install mods without conflicts or overwriting new functionality with older versions of those same files, as long as you remain focused and careful about what you're editing where. I'm aiming to streamline this process, but that program will be a while off still.
Shrooblord



Ravien

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    250
    • View Profile
on: January 30, 2018, 08:12:30 PM
Ah I noticed when I installed it, no files were overwritten at all. The in game command /fleetcontrol is recognized and it says it's enabled when I type it but nothing else happens.

I'll have to figure it out later though.



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: January 31, 2018, 06:49:18 AM
I am not using the beta.
Same as above.I type /fleetcontrol enable and it says enabled but no icon appears.



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: January 31, 2018, 10:11:00 PM
I tried using the beta version.. same thing.. Ill uninstall and try again... if it wasn't such a great feature



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: January 31, 2018, 10:42:08 PM
i reinstalled and tried beta and regular version...it says it initializes but no icon appears



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: February 01, 2018, 01:46:00 AM
so when it works it says enabled then an icon appears in the upper right hand of the screen then you can click on that for fleet functions... how can it not work on this system and then work on yours...maybe dependences...what does this game need java or c++ library's are different.. doesn't make sense



falsetruth1988

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    2
    • View Profile
on: February 01, 2018, 02:20:12 AM
same /fleetcontrol enables but no icon



Lestat9

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    7
    • View Profile
on: February 01, 2018, 03:06:04 AM
here is the fix.

"Functions addShipUIScript and removeShipUIScript in data/scripts/player/fleetcontrol/manager.lua does a math check against shipidx which is a UUID (ex: 43214321231-312312-312321)

Removing the shipidx > 0 fix the issue." from Functions addShipUIScript and removeShipUIScript

Just download lua editor and find the file manager.lua in the player directory

works now



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
on: February 02, 2018, 01:01:45 PM
Hm, still intriguing given that I didn't need to do that to get it to work on my end. I really am curious what is causing this discrepancy.

Also, Lestat9, thank you for your effort and solving the issue - but could you please use the EDIT button instead of posting 4 times in a row? Thank you - just makes for a cleaner read on the forum. ;)
Shrooblord



RoMonGerr

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
on: February 06, 2018, 04:06:30 PM
here is the fix.

"Functions addShipUIScript and removeShipUIScript in data/scripts/player/fleetcontrol/manager.lua does a math check against shipidx which is a UUID (ex: 43214321231-312312-312321)

Removing the shipidx > 0 fix the issue." from Functions addShipUIScript and removeShipUIScript

Just download lua editor and find the file manager.lua in the player directory

works now

Ok I understand to go to file "data/scripts/player/fleetcontrol/manager.lua" and Edit
The part I do not understand is a bit unclear as what to do.
So, to Clear things up for other programing Noobs like me.
(who have to use Trial & Error) To save you some trouble.
Delete lines in "RED"

      {Section of File:}
(function onSectorEntered(playerIndex, x, y)

    Sector():registerCallback("onDestroyed", "onDestroyed")
    updateSectorPlayerShips()

end

function addShipUIScript(shipidx)

    -- add script to ship entity
  if shipidx and shipidx > 0 and lastCraft ~= shipidx then
        local entity = Entity(shipidx)
        if entity and valid(entity) then
            ensureEntityScript(entity, fc_script_controlui)
            lastCraft = entity.index
            -- push server config values to client UI script
            pushShipUIServerConfig(entity)
        end
    end

end

function pushShipUIServerConfig(entity)

    local sconfig = getConfig("server", getServerConfigDefaults())
    local svalues = {
        updatedelay = sconfig.updatedelay,
        debugoutput = sconfig.debugoutput, 
        enablehud = sconfig.enablehud
    }
    entity:invokeFunction(fc_script_controlui, "syncServerValues", svalues)

end

function removeShipUIScript(shipidx)

    -- remove scripts(s) from player ship
    if shipidx and shipidx > 0 then
        local entity = Entity(shipidx)
        if entity and valid(entity) then
            removeEntityScript(entity, fc_script_controlui)
            if shipidx == lastCraft then
                lastCraft = nil
            end
        end
    end
   
end
     
function removeAllScripts()

{File continues...}

Fixed it for me YAY!
Does Kibby Dance  <("<) -(")- _(")_ ~(")~ (>")> /(")\ \(")/
« Last Edit: February 06, 2018, 08:25:07 PM by RoMonGerr »



Shrooblord

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    578
    • View Profile
on: February 06, 2018, 09:22:06 PM
Cool. Thanks for your effort, RoMonGerr. If ever you want to compare two files again, before and after changes, a very easy-to-use and even easier-to-read tool is DiffChecker. Just copy both files into its two windows (the before on the left and the after on the right is conventional) and set its expiry date to never / make it permanent, and people all over the Internet who flock to this post will be able to enjoy the fruits of your labour, even after many updates of code changes. ;)

And the effort is much less on your side, too. It's literally like two copy-pastes and a couple of clicks.
Shrooblord