[MOD] Mules and Warehouses v4.0

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Scoob » Wed, 26. Jun 19, 00:29

Hi,

Just started using this - shudda listend to you sooner lol - the TravelMule looks like it meets my needs perfectly.

One thing though... Is there any way to have a Mule that's assigned to work for a station show in the Property list of said station? This is more for neatness than anything as I'm assigning my "normal" station-assigned M-Class Freighters as Mules now, and they're starting to clutter up my unassigned ship list, where they were neatly hidden before.

If this is at all possible, I think it'd keep things looking tidy and leave only ships that are truly unassigned in the Unassigned Ships list.

Note: I did try assigning a station assigned ship as a Mule, but it of course broke the hierarchy...unless perhaps I did something wrong?

Edit: I'm a numpty....I set the ship up as a Mule a second time, and this time it popped right into the Stations subordinates list! Go figure. Either I screwed up (nahhh lol) or that was some RAPID work by yourself ;)

Cheers,

Scoob.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Scoob » Wed, 26. Jun 19, 01:00

Wow, this "just works(tm)" doesn't it? The Travel Mule is exactly what the default station-assigned Freighter behaviour should be. Simple and easy to set up, and does what I want.

I wonder if a "Mining Mule" is in this mods future? Being able to tell ships exactly which resource to collect would be perfect. Default behaviour often goes nuts for a single resource, ignoring all others. It's better than it was for sure, but still needs work. Allowing the player to prioritise which resources to collect via ship assignment would be great.

Thought: Perhaps this is will be unpopular, but I feel that there should be penalties / bonuses based on Captain and Crews experience level. Nothing major, just something like low-level crews have a bit of a wait time between trade jobs - only for the Travel Mule though, as they're directly making profit. The "logistics" type Mules are fine as they are I suspect.

Scoob.

Ramokthan
Posts: 107
Joined: Fri, 22. Apr 16, 21:25
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Wed, 26. Jun 19, 15:21

For mining i think there are other mods which can handle the mining more intelligent.

While intelligence is not a property of the Mules.... Will likely never be.

SladeTalon
Posts: 5
Joined: Fri, 14. Jun 19, 13:42

Re: [MOD] Mules and Warehouses v4.0

Post by SladeTalon » Thu, 27. Jun 19, 14:34

using v4

when a StationMule is assigned to the factories as source and the warehouse as target, they do very little unless the another factory needs energy cells.
with the assign to source they just sit around most the time even tho almost all factories are full.
if i take the assign to source off they start filling the build storage. but if its on nothing...
they will buy from the warehouse but will not sell to the warehouse.

things i noticed.
i found a few that had a few pieces of cargo, emptied it and they seem to start working just not with the warehouse.
my warehouse shows on map it will buy just smart chips and drone parts. but sells everything inside.
every warehouse has 2 SM all declare the target as warehouse all using seller priority some set to trade med,food, EC.
The warehouse is made pretty much of only containers of all 3 types attached to a deference station

Every factory has 5 to 10 mill credits and the warehouse 90 mil.

any thoughts?

ThePiercdPrnc
Posts: 18
Joined: Fri, 21. Jun 19, 08:25

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Thu, 27. Jun 19, 22:23

SladeTalon, do you have the other mod that allows you to decide what is being sold at your warehouse? Players and warehouses (iirc) I generally use that one to set up the buy/sell order then my mules do their thing. Ive got 27 factories and they all move things to and from the warehouse. Ive currently got 2 medium and one large mule per factory, other than my ice and EC because those things make HUGE amounts of materials so I have a ton of mules for those. My warehouse has about 300m CR in it and it still wont buy water or EC but it still gets moved even though it says it doesnt buy it. Don't put liq/solid storage on your warehouse it's a waste of time, the mules cant move miner only goods only container goods. Also, this might be a dumb question but...do you have managers at all your stations inc the warehouse? If not mules won't do anything.

ThePiercdPrnc
Posts: 18
Joined: Fri, 21. Jun 19, 08:25

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Fri, 28. Jun 19, 08:03

Better example down below so removing this information
Last edited by ThePiercdPrnc on Sat, 29. Jun 19, 09:54, edited 1 time in total.

SladeTalon
Posts: 5
Joined: Fri, 14. Jun 19, 13:42

Re: [MOD] Mules and Warehouses v4.0

Post by SladeTalon » Fri, 28. Jun 19, 13:14

ThePiercdPrnc wrote:
Thu, 27. Jun 19, 22:23
SladeTalon, do you have the other mod that allows you to decide what is being sold at your warehouse? Players and warehouses (iirc) I generally use that one to set up the buy/sell order then my mules do their thing. Ive got 27 factories and they all move things to and from the warehouse. Ive currently got 2 medium and one large mule per factory, other than my ice and EC because those things make HUGE amounts of materials so I have a ton of mules for those. My warehouse has about 300m CR in it and it still wont buy water or EC but it still gets moved even though it says it doesnt buy it. Don't put liq/solid storage on your warehouse it's a waste of time, the mules cant move miner only goods only container goods. Also, this might be a dumb question but...do you have managers at all your stations inc the warehouse? If not mules won't do anything.
Yes, i have a manger in all the warehouses and the player and warehouse mod with the g mod. i built a new factory today and the mules filled it so it can produce. but they still wont fill the warehouse, making me think the buy orders are not set properly.

Scoob
Posts: 9921
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Scoob » Sat, 29. Jun 19, 01:24

Hello again :)

I think I may have found a very minor issue...

I had to M-Class Freighters assigned to my station, this satisfied the "Assign Subordinate: Trade Ship" mission at said station. Nice.

However, since I changed those Freighter to be Travel Mules, this mission has popped up again as unsatisfied. So, despite the Freighters being subordinate to the station (though I did have an odd issue with this initially you might recall) they're NOT satisfying the mission requirements.

Hopefully this minor issue can be resolved for tidiness, it irks me to have invalid open missions like this lol.

Cheers,

Scoob.

ThePiercdPrnc
Posts: 18
Joined: Fri, 21. Jun 19, 08:25

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sat, 29. Jun 19, 09:42

Here is one example of some of the issues I'm having, this particular one is where the trade gets stuck. Meaning it won't actually do the trade it just keeps repeating the same command over and over again until I drop the cargo. Now mind you it says I have no EC left to trade, that's not true its got a full load. Another part of this whole thing is the mule that is selling random things to other stations belongs to a station that ACTUALLY needs the things it's selling elsewhere. (Engine part factory wants 700k EC yet my mule is selling 1EC to Hull parts). The similar issue is my mule will take a max load of energy from a station (not my solar plants or Trading station but a production station) then try to sell like 6 EC to another station and then another 6 to another station. This second issue it'll actually do the trade but then my stations fill up with product that isn't getting moved then my trading station cant sell the intermediate items to the other stations and production halts on those stations. I've currently got about 30 stations and 350m CR in the trading station. All other stations have 1m cr (to make it easy to see if it moves). I've got about 230 various mules at least 2 medium (demeter vanguard) and 1 lrg (selene vanguard) for every station plus some have more if they need it. But the Selene's seem to be the ones that bug out more often than the demeters, they MOST of the time actually do what they are supposed to but I'm trying to avoid needing like 10 of those per station by using some L size freighters as well.

Also to clarify, all my managers are 5 star and my captains are 4+ star so that's definitely not the problem. I could see things being less efficient with crappy workers.

TL:DR
  • Mules selling things they shouldn't to stations they shouldn't
  • Mules getting stuck attempting to sell things to stations they should (Repeated failed trades)
  • Result Mules not trading the intermediate products to main warehouse to allow for other ships to grab and bring to production factories
Example image for clarity
Show
Image

Ramokthan
Posts: 107
Joined: Fri, 22. Apr 16, 21:25
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sat, 29. Jun 19, 23:55

Im messing a bit with the station mule, troubleshooting why he sometimes denys delivering anything despite there are wares to deliver...

Really hard to understand that code... i'd say messy if i dare. :|
That loop can be somehow avoided i guess, it makes the thing really hard to track.

And you desperately need to implement logging.

just some tips.

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Browser_ice » Sun, 30. Jun 19, 18:15

What is again the requirement for a station mule to start moving ?

I had a few that were just docked at one of my station it is supplying and doing nothing. Some of them had been told the target is another station of mine.

I noticed that as soon as I increase storage for the other station, the mules for it started moving. So I guess the requirement is a certain % of the station ware inventory to be reached???

Also one odd thing. One time I saw cargo drones going between my source station and my yard station. They are in the same sector but it takes at least one turbo boost to go between them.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

Buzz2005
Posts: 2184
Joined: Sat, 26. Feb 05, 01:47
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Buzz2005 » Sun, 30. Jun 19, 18:42

there is something wrong with how mules see trade offers

If you setup some modules to build and go check the build storage trade offers with a mule trade ship it does not see all the offers or nothing at all

but if you check with any other ship that is not a mule all is correct

and btw ware exchange with cargo drones is possible if the stations are in the same zone but its not reliable or consistent
Fixed ships getting spawned away from ship configuration menu at resupply ships from automatically getting deployables.

Ramokthan
Posts: 107
Joined: Fri, 22. Apr 16, 21:25
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Mon, 1. Jul 19, 00:06

@LegionOfOne Do you mind when i publish my mules as a sister mod to this one?

They have so much differences to your Mules code and functionality wise but they are still the same family of course.

I'd reference your mod as main mod and i can maintain my mule versions.

skullwarrior
Posts: 32
Joined: Fri, 2. Jun 17, 17:22

Re: [MOD] Mules and Warehouses v4.0

Post by skullwarrior » Mon, 1. Jul 19, 13:27

a question, if I want a Mule to buy from a Station and sell to any other of my station?
I should set the source station and left the target station unset?
for example I had a "Solar Power Plant" and I want to sell the energy cells to the warehouse and also directly to other stations, this way I need to have at least 1 mule with the source("Solar Power Plant") and the target("Warehouse") set an at least another mule with only the source set?
did I get it right?

SladeTalon
Posts: 5
Joined: Fri, 14. Jun 19, 13:42

Re: [MOD] Mules and Warehouses v4.0

Post by SladeTalon » Tue, 2. Jul 19, 14:11

so i found my UI/right click API wasn't working properly.

after that was corrected, my warehouse started half way working. the newest factory sells/buys wheat and meat with the warehouse but will only sell the rest of the wears there.

Is their a minimum amount of stock the warehouse needs to trigger buy orders(i have 1-100 of each)? all the factory's will send to other factory's to keep them running but eventually max out.
could i have an old version of the player warehouse mod?

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Mules and Warehouses v4.0

Post by LegionOfOne » Wed, 10. Jul 19, 17:01

Hi everyone.

Sorry I went AWOL for a while, the heat wave was not kind to my aging computer.

I can't run X4 until I get all the new parts, in a few weeks.

Until then :
Ramokthan wrote:
Mon, 1. Jul 19, 00:06
Do you mind when i publish my mules as a sister mod to this one?
You are entirely and absolutely free to publish new Mules, and I thank you for it :) .
I am always happy to see new members of the family, and I am not 'territorial' about such things.

If I like them, I may include them in the main mod, with your approval, or include it in a steam workshop collection, something like that.
When I can test them and mod again, that is.


SladeTalon wrote:
Tue, 2. Jul 19, 14:11
Is their a minimum amount of stock the warehouse needs to trigger buy orders
could i have an old version of the player warehouse mod?
No minimum stock, but enough budget to cover all that the warehouse wants to buy : for a 600 Million cubic meter warehouse, I needed about 400 million credits in operating budget.
The warehouse mod is still compatible with the 0.31 version of the G_Workaround, and is not dependent at all on the right-click api. All you need is the G_work_around folder.

Ramokthan
Posts: 107
Joined: Fri, 22. Apr 16, 21:25
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Wed, 10. Jul 19, 20:51

I published the Mod in nexus and steam, you find the link to the thread in forum in my signature, if you want to have a look onto it.

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Browser_ice » Tue, 16. Jul 19, 20:46

Just out of curiosity, when your script modification executes, does it first do a scan to make a list of all possible player owned stations?

I am asking because I remember you said if there are too many station mules, it may slow down a bit.

So if both above are true, then its probably that initial scan you do each time that slows it down. Running even running a small scan can slow down things if it is ran +10 times per seconds (or hundreds per second???)

So how about creating that list elsewhere. Like when its the first time your script runs and/or there are no such list + everytime the player builds a station module it will make sure that station is part of that list. That way you have looping through stations to find out which ones are player owned or not.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

Browser_ice
Posts: 485
Joined: Sun, 5. Feb 06, 17:15
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Browser_ice » Thu, 18. Jul 19, 15:12

I think no one answered about those major error messages in the log I am getting from this MOD. Since then, I had many other game sessions. I just checked the logs and I keep having them.

Will you look at them?
Had those 795 times in a X4 time period from 580726.25 to 581547.65

[General] 580727.25 ======================================
[=ERROR=] 580727.25 Error in AI script travelmule on entity 0x18da7: Property lookup failed: $sourceStation.tradewares
* $sourceStation == component.{0x1ccccL} (name='My Warehouse', class=station)
* Expression: not $sourceStation.tradewares == []
[General] 580727.25 ======================================

My Warehouse is a station that has lots of containers + the bear necessities to supply for the workforce. One other station of mine is station muling to it.
Steam X-Superbox, XR, playing X4
WIndows-10
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: [MOD] Mules and Warehouses v4.0

Post by LegionOfOne » Sun, 21. Jul 19, 15:17

Browser_ice wrote:
Thu, 18. Jul 19, 15:12
Will you look at them?
When I can run the game again, yes :)

Also, even a lot of Mules and a lot of stations should not slow down the game too much.
In any case, it will slow the game much less than if all these Mules were regular traders.

I can't actually save a 'station list', because I look at your station's trade offers directly, and those can change dramatically between two trade runs.
So not a solution, I am afraid.

I'm always looking for ways to optimize though, so thanks for the suggestion anyways.

Post Reply

Return to “X4: Foundations - Scripts and Modding”