Author Topic: [MOD] Goods Hauler (Automatically buy/sell/move goods!)  (Read 41392 times)

bit

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    22
    • View Profile
on: September 18, 2018, 04:01:40 AM
I too am having some trouble finding the latest (or any) copy of the mod. Is  it hosted separately?






bit

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    22
    • View Profile
on: September 21, 2018, 01:55:09 AM
Thanks! Just turned out I wasn't logged in while I was looking.



kirknay

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    6
    • View Profile
on: September 24, 2018, 09:10:50 AM
I'm trying to run this on a server, and I keep getting an error saying I don't have permission to use this command. Any hope on fixing that? The files that are used have been completely reorganized for modifying files compared to what I'm seeing in the original post, as well, so I don't know if I'm installing it correctly or not.



Devious

  • Hero Member
  • *****
  • Status:
    Offline
    Posts:
    579
  • Have you seen Rusty?
    • View Profile
    • Rusty's Universe and Community
on: September 30, 2018, 01:22:52 PM
I'm trying to run this on a server, and I keep getting an error saying I don't have permission to use this command. Any hope on fixing that? The files that are used have been completely reorganized for modifying files compared to what I'm seeing in the original post, as well, so I don't know if I'm installing it correctly or not.

To use this on a server the permission to use the command needs to be added to the default group in the admin.xml



kirknay

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    6
    • View Profile
on: October 01, 2018, 12:07:22 AM
Hm... I have been trying that, but the command isn't showing up in my admin list, and adding it manually ends up with it being removed when I bring the server back up. Is it possibly an issue with my install of shipscript loader?



nutcase840

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    1
    • View Profile
on: November 04, 2018, 08:43:53 PM
for version 18.3 if your haulers are getting to stage 3 in the console and just sitting still and not dropping off the goods here a fixed version

for those who dont want the haulers to be undocked by the stations
Spoiler: show

got to data\scripts\entity\ai\haulgoods.lua and add -- or comment out the 2 lines starting with DockAI.flyAwayFromDock
Code: [Select]
at line 390 --DockAI.flyAwayFromDock(ship, haulGoodsRoute[1])
and line 423 --DockAI.flyAwayFromDock(ship, haulGoodsRoute[2])







unbekannt1984

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    164
    • View Profile
on: January 11, 2019, 02:26:21 PM
Hi,

Goods Hauler is still working in the current beta-branch versions 0.20.x. At least, if some updates didn't break stuff, my Goods Hauler still says
Code: [Select]
local VERSION = "v0.9.2"in entity/ai/haulgoods.lua



Salminar

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    92
    • View Profile
on: January 24, 2019, 10:49:53 AM
Not working at all for me (Using the beta branch).

In 1.82 it's stuck in stage 3 .
In 1.83 it's stuck in stage 1, saying he should trade something getting close to the station that sells the goods and never docks. But he is nice and move his ass to let other traders dock when they are close to him lol.



Salminar

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    92
    • View Profile
on: January 26, 2019, 04:21:29 AM
If someone can assure it still works then i'll try to make an update on it to change the version number and put the files inside a mod directory so it do not mess with the rest of the file and don't interfere with future game update.

But it dont seem to work on my game so i don't know if it's worth updating now. If someone can notify me.



unbekannt1984

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    164
    • View Profile
on: February 04, 2019, 04:07:12 PM
Hi,

Beam me up, Scotty...

Patch-Notes:
- Bumped Version to v0.9.3
- simplified/cleaned code
- Added Feature: Docking using Transporters (code feels a little quick'n'dirty)
  - fixes "ships with Transporters are unable to do any business"

Requires Avorion 0.20.2 or later

LLAP



unbekannt1984

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    164
    • View Profile
on: February 05, 2019, 10:00:01 AM
Hi,

I've been thinking about further improvements of Goods Hauler. What would you think about some kind of priority queue instead of the current list of traderoutes?
Well, since that requires some kind of sorting, it would need a little more CPU-time, compared to the current system.

Have you got other ideas for the Mod?



Salminar

  • Jr. Member
  • **
  • Status:
    Offline
    Posts:
    92
    • View Profile
on: February 05, 2019, 03:39:47 PM
Lovely, it fixed my bug



unbekannt1984

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    164
    • View Profile
on: February 12, 2019, 10:58:27 PM
Hi,

spoiler-alert :)
Spoiler: show

Code: [Select]
2019-02-12 22-15-20| Goodshauler v0.10.0-alpha1 12.02.2019 22:15:20 (Frachter 2) : haulGoodsGetRoute (Stage 1) finished. Starting to transport 420 Platinum from Goldgrube 1 to Prozessorfabrik
2019-02-12 22-17-58| Goodshauler v0.10.0-alpha1 12.02.2019 22:17:58 (Frachter 2) : BuyGoods Data: 420 Platinum size 0.5 requested, 97 in the cargobay, room for 2939 more. Decided to buy 323 more.
2019-02-12 22-21-06| Goodshauler v0.10.0-alpha1 12.02.2019 22:21:06 (Frachter 2) : Finished trade from Goldgrube 1 to Prozessorfabrik
Well, that's all the default-level logging of the current development-version (of a successful trade-run)... Server-Admins will love it :)

If anybody is interested, I could share the latest dev-version.
Disclaimer: This is experimental software, you can expect some unintended behavior.



unbekannt1984

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    164
    • View Profile
on: February 13, 2019, 09:50:38 PM
Hi,

Shrooblord had to wait more then a year for a reply now...
Sometimes Goods Haulers try to do one or both of the following problematic things:
  • Buy more goods than the Cargo Hauler has stock for, usually as simple as 1 over the total amount they could carry.
  • Push more goods to the receiving Station than that Station has space for.

Whenever they decide they want to do either, they don't let up and continue to try and perform this behaviour somewhere between 5 and 10 times in a row, which spams both the Console and the main game screen itself full of error messages (Console says something along the lines of "Expected to buy 5 goods but bought only 4", while the game screen shows an error in the typical red "You can't do that" message with a red cross, on the right) every second or so. With multiple Goods Haulers at work in one Sector, this gets very spammy very quickly, but more importantly, your Goods Haulers aren't doing anything, because they load up their Cargo Bays with goods they can now no longer push, because the receiving Station doesn't accept more goods of that type anymore.

Is there anything you can do to include some sort of check that wouldn't trigger this behaviour anymore? It's made me steer clear of giving my craft the Goods Hauler orders inside my own Sector, because they keep trying to push Aluminium from my Alu Mine to my Shipyard, which doesn't want it anymore, instead of acting as my handy cargo shuttle between production chains as I intended for them to do.

Furthermore, Goods Haulers with cargo already with them will never try and push these items for profit, which I think isn't in the spirit of how this mod operates.

"Buys more then fits into the cargobay"
The dispatcher decided in 0.9.x versions of Goods Hauler how much to buy. That data is simply old at some point.

"Push more goods to the receiving Station than that Station has space for."
Goods Hauler always tries to sell as much as possible. That's not a bug, it was the only way for the 0.9.x versions to try to keep the cargobay free. Well, I'm not going to change that.

"Whenever they decide they want to do either, they don't let up and continue to try and perform this behaviour somewhere between 5 and 10 times in a row, ..."
That's actually a bug, the 0.9.x versions were missing 2 "undocking" stages - one after buying and one after selling stuff - , so the updateServer-function ran the same code again and again.

"...your Goods Haulers aren't doing anything, because they load up their Cargo Bays with goods they can now no longer push, because the receiving Station doesn't accept more goods of that type anymore."
Well, 0.10.0-alpha1 took a look at the cargobay before buying anything, so it should maximize free cargospace over time. Problem is: It still relied on old (inaccurate) data.
0.10.0-alpha2 now updates the amount of goods in the cargobays of your ship, selling station and buying station and decides then how much to transport.

So, now I'm talking about 0.10.0 again... alpha2 is still missing features I'd like in the final 0.10.0, but in hours of testing I didn't come across a single bug, it works much better then the old 0.9.x versions. What has changed? - Spoiler :)
Spoiler: show

These changes should slowly free your cargospace - or at least keep the cargobay free as good as possible:
 Ships don't buy stuff that's already in the cargobay
 Amount of goods to transport is determined just before buying - previous versions used the dispatcher-information (old data - very likely wrong)
 
Added limitation to transporterrange (35km range should be enough - or do people equip ships with 10 legendary Transporter-Software now?)
Changed docking distance calculation for ships with transporters

Introduced Log-Levels, haulGoodsLogThreshold (default 2):
 5 and higher values should suppress all messages,
 choose 4 for Errors,
 choose 3 for Errors and Warnings,
 choose 2 for Errors, Warnings and Notifications,
 choose 1 for all the beauty of console- and log-spamming that you know from previous versions: Errors, Warnings, Notifications and the rest of the Spam.
Also changed Log-Entry format.
 
Ships without transporters: Properly resetting DockAI.dockStage and .undockStage, and waiting until ships are fully undocked
 Fixes: Ships without transporters are sometimes going mad and fly thousands of kilometers away
 
Added additional stages for undocking - this reduces spamming of buy- and sell-stages


EDIT: Removed old 0.10.0-alpha2 version of the Mod.
« Last Edit: February 17, 2019, 07:42:43 PM by unbekannt1984 »