[MOD] Mules and Warehouses v4.0

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

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

Post Reply
ThePiercdPrnc
Posts: 16
Joined: Fri, 21. Jun 19, 08:25

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sat, 22. Jun 19, 23:14

Well I know that seller priority = sell what the factory has most of, so it's selling your energy cells because you have excess according to the script. And if your warehouse needs them the most it will likely attempt to fill it up with the excess. I would suggest having a bigger solar plant and pushing more ECs to the warehouse. I have an 18 solar cell plant and I never have any factories trying to sell off my ECs, just buy them from the warehouse. Also add more mules and they should pick up more things, some of my mules grab medical supp, some grab food, some grab snails from my life support factory for example.

Buzz2005
Posts: 1282
Joined: Sat, 26. Feb 05, 02:47
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Buzz2005 » Sat, 22. Jun 19, 23:30

I have a few issues and "complaints", great mod btw its all I use now

So I have 50 mules on my HQ plex muleing for all npcs shipyards and wharfs, and my own wharf its all working good but:

1 issue is stay docked, they stay dormant long bc im still building modules to supply all, if I use them to supply my build storage manually queueing orders from npcs (don't have enough im my hq plex) they stay docked on the build storage clogging the dock for the rest of the ships

2 issue is they are all subordinates of the plex and I cant see the buy orders directly, I can only go to transfer wares option
This issues is I think bc of the assign to station option

Azran_Zala
Posts: 69
Joined: Tue, 13. Mar 18, 01:25
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Azran_Zala » Sat, 22. Jun 19, 23:33

ThePiercdPrnc wrote:
Sat, 22. Jun 19, 23:14
Well I know that seller priority = sell what the factory has most of, so it's selling your energy cells because you have excess according to the script. And if your warehouse needs them the most it will likely attempt to fill it up with the excess. I would suggest having a bigger solar plant and pushing more ECs to the warehouse. I have an 18 solar cell plant and I never have any factories trying to sell off my ECs, just buy them from the warehouse. Also add more mules and they should pick up more things, some of my mules grab medical supp, some grab food, some grab snails from my life support factory for example.
My warehouse should have required nothing, as the settings I screen shot where the first attempt to ever set up a warehouse. (though that has added it as a ware now).
As mentioned I've tried the same without any other settings (aka without checking 'seller priority') with same results, beyond that expected behavior of having 'Include energy cells' un-selected is well, I'd expect not to haul e-cells.
Posting observations, to find out if either a bug or if I've misunderstood something.

I'll let it fill up the warehouse with e-cells I guess, as no harm there; once filled I'm guessing it will ignore and move onto the other stuff.

Actually come to think of it; would be cool to be able to select specific wares with the station mule as with the Travel mule. hauling intermediates like graphite ect. would be a waist of space in my case.

Edit: replacing the section:



<do_if value ="($someOuter.ware.id == 'energycells') and not $incEgry and (not $someOuter.owner.class == class.buildstorage)">
<set_value name="$wareName" exact="'NOPE'" />
</do_if>

With :

do_if value ="not $incEgry">
<do_if value ="$someOuter.ware.id" exact="'energycells'">
<set_value name="$wareName" exact="'NOPE'" />
</do_if>
</do_if>

Seems to have solved the issue for me, although I don't have any build resource requirement in the target station, so I suspect something iffy about that if statement for supplying build storage.
However I'm too drunk right now (and probably not smart enough of on my best day), to follow half of whats going on. kudos to the author though.

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

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sun, 23. Jun 19, 00:43

I second the "specific wares for mules" option. Because right now my mules keep moving things back and forth, one sells refined metals to the warehouse, the next one takes it back to my refined metals factory because it actually needs them. Same with maja snails, spices and a few other assorted items. There is a workaround if you use the additional mod that allows you to pick your buy prices for items, you can tell it to remove from the warehouse and it will stop buying/ selling it. Then you can just manually move the materials until they are out of the warehouse and it won't send them anymore. This is how I got ice out of my warehouse due to an accidental transfer. It will automatically adjust all the other wares size instead of wasting a ton of expected space on things you don't want in there in the first place.

And I've also noticed the ignore energy cells, food/meds options dont seem to do anything because my mules are keeping all my factories topped up even if those are checked or not.

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

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sun, 23. Jun 19, 02:07

I got my BuyerMule and my SupplierMule finished. :-)

<Scripts and Description moved to a standalone Mod (External Link, Nexusmods)>
Last edited by Ramokthan on Mon, 1. Jul 19, 21:37, edited 31 times in total.

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

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sun, 23. Jun 19, 10:59

Hey Ram, added your code to a buyer mule.xml but i can't figure out how to make it do anything. Can i get a basic rundown of how it works. I tried to look at the code, but alas I'm no programmer, even though I am starting to get a basic grasp of how the scripts work and how to fiddle with them for my own needs. Like you apparently managed to do.

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

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sun, 23. Jun 19, 11:04

Did the job already show up in your menu?

if yes.. well it may be a bit buggy still.
Yesterday it worked perfectly, now i started a new game to test it a bit more.
Right now i am having an issue too, the mule doesnt find trade partners even tho there are.

What setting did you do?

Usually setting up a home station and wares is enough.
Tho you cant make it buy wares a station has not as tradewares when its a factory. when its a warehouse it doesnt matter, it will add the selected wares to the warehouse.

The Max Trades is there to limit it trades per run.
So if its is 10 it only accept selloffers which at least fill its cargo for 10%, so its cargo is full after at maximum 10 trades and then returns to home.

"Own stations" is there to force the mule to buy at owned station only obviously, kinda a specialized station mule that collects the needed resources out of your station network if applicable.

Edit:
I changed the buyer script to "Alpha" i found some bugs and space for improvement, sitting on it. but it works on own stations, Ai stations casue problems.

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

Re: [MOD] Mules and Warehouses v4.0

Post by LegionOfOne » Sun, 23. Jun 19, 12:28

Ramokthan wrote:
Sat, 22. Jun 19, 18:30
Is is possible to implement the sector bans or do threy already respect them?
It is certainly possible, but it isn't done yet.
I think only the TravelMule would need it.

I'll have to see how blacklists work, haven't looked yet.

Buzz2005 wrote:
Sat, 22. Jun 19, 23:30
1 they stay docked on the build storage clogging the dock for the rest of the ships
OK, that is bad, and a bug. I only intended them do stay 'docked' on stations, not 'parked' at a build storage.
I'll try to fix it.
Buzz2005 wrote:
Sat, 22. Jun 19, 23:30
2 issue is they are all subordinates of the plex and I cant see the buy orders directly, I can only go to transfer wares option
That I didn't understand. What are you trying to do, that doesn't work ?


Given a few comments, there may be a problem with E-cells getting delivered when they are disallowed.
I'll look into it, and maybe add a selectable ware list to the StationMule.

Also, the thread took on a life of its own !
I'm glad you seem to enjoy the Mule family.

I'll have to take a look at that beta Buyer Mule.

I will probably have the next version up in a week, maybe ten days.

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

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sun, 23. Jun 19, 13:13

Im currently fiing some little bugs with the new Mule, but since i need it myself i am working today till it works sufficiently XD

i already implemented the sector bans to the buyer mule. :-)

Buzz2005
Posts: 1282
Joined: Sat, 26. Feb 05, 02:47
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Buzz2005 » Sun, 23. Jun 19, 13:51

LegionOfOne wrote:
Sun, 23. Jun 19, 12:28
Buzz2005 wrote:
Sat, 22. Jun 19, 23:30
2 issue is they are all subordinates of the plex and I cant see the buy orders directly, I can only go to transfer wares option
So my hq build storage has trade offers for hull parts and if I click on a mule and then go to the build storage trade offers I dont see them its all 0

I only testes with a mule that has assign to station option, cant test anymore since I dont have any offers now

If I remove the mule behavior then I see it all ok

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

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sun, 23. Jun 19, 14:22

Updated the BuyerMule.

Please try it again. :-)

Edit:
Another minor Update.

A little picture where the BuyerMule buys muliple wares in one run and selling them at its target station:
Spoiler
Show
Image

Browser_ice
Posts: 394
Joined: Sun, 5. Feb 06, 18:15
x4

Re: [MOD] Mules and Warehouses v4.0

Post by Browser_ice » Sun, 23. Jun 19, 21:39

Hi, started using your MOD yesterday but I am having some issues. Most of my trader ships are not doing anything on Station Mule and Distribute Mule. Out of 5 traders, only one was doing anything and that was on Station Mule; the others seam to just stay there doing nothing. Travel Mule seams to be working but I only used it on one trader.

It is the only MOD I use.

I have 3 stations in the same sector:
- one shipyard not yet fully built but has a manager and ship trader
- one yard not yet fully built but has a manager and ship trader
- one fully built producing every parts 2x needed for both above and self sufficient

I checked the logs and found the followings below. First timestamp = 417199.29, ending timestamp = 427590.12

Minor errors:
Logfile started, time Sun Jun 23 13:32:00 2019
[General] 0.00 ======================================
[=ERROR=] 0.00 File I/O: Could not find file '.\extensions\increasedlongrangescan\content.xml.sig'
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 File I/O: Could not find file '.\extensions\stationmule\content.xml.sig'
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 File I/O: Could not find file '.\extensions\stationmule\content.xml.sig'
[General] 0.00 ======================================
[General] 0.00 File I/O: Failed to verify the file signature for file '.\extensions\stationmule\content.xml' (error: 14)
[General] 0.00 'GeForce GTX 1060 6GB' NVidia-driver v417.35.0 (Vulkan 1.1.84) check=1
[General] 417199.29 ======================================
[=ERROR=] 417199.29 File I/O: Could not find file '.\extensions\stationmule\aiscripts\orders.base.xml.sig'
[General] 417199.29 ======================================
[General] 417199.29 File I/O: Failed to verify the file signature for file '.\extensions\stationmule\aiscripts\orders.base.xml' (error: 14)
[General] 417199.29 ======================================
[=ERROR=] 417199.29 File I/O: Could not find file '.\extensions\stationmule\aiscripts\distributionmule.xml.sig'
[General] 417199.29 ======================================
[General] 417199.29 File I/O: Failed to verify the file signature for file '.\extensions\stationmule\aiscripts\distributionmule.xml' (error: 14)
[General] 417199.29 ======================================
Warnings ones:
found 2 times in the whole logfile:
Line 22: [=ERROR=] 417199.29 extensions\stationmule\aiscripts\distributionmule.xml(99): Warning while parsing expression: Possibly unintended use of 'not' with higher precedence than arithmetic/comparison operator; Use parentheses for clarification
Line 27: [=ERROR=] 417199.29 extensions\stationmule\aiscripts\distributionmule.xml(102): Warning while parsing expression: Possibly unintended use of 'not' with higher precedence than arithmetic/comparison operator; Use parentheses for clarification
Found 1 time in the whole logfile:
Line 36: [=ERROR=] 417199.29 extensions\stationmule\aiscripts\stationmule.xml(196): Warning while parsing expression: Possibly unintended use of 'not' with higher precedence than arithmetic/comparison operator; Use parentheses for clarification
found 2 times in the whole logfile:
Line 45: [=ERROR=] 417199.29 extensions\stationmule\aiscripts\travellingmule.xml(91): Warning while parsing expression: Possibly unintended use of 'not' with higher precedence than arithmetic/comparison operator; Use parentheses for clarification
Line 50: [=ERROR=] 417199.29 extensions\stationmule\aiscripts\travellingmule.xml(94): Warning while parsing expression: Possibly unintended use of 'not' with higher precedence than arithmetic/comparison operator; Use parentheses for clarification
Major ones:
found over 19000 times in the whole logfile:
[General] 417200.29 ======================================
[=ERROR=] 417200.29 Error in AI script distrimule on entity 0x722f: Property lookup failed: $sourceStation.tradewares
* $sourceStation == component.{0x7719L} (name='All main production parts', class=station)
* Expression: not $sourceStation.tradewares == []
[General] 417200.29 ======================================
[General] 417200.29 ======================================
[=ERROR=] 417200.29 Error in AI script distrimule on entity 0x722f: Property lookup failed: $sourceStation.products
* $sourceStation == component.{0x7719L} (name='All main production parts', class=station)
* Expression: not $sourceStation.products == []
[General] 417200.29 ======================================
Unknown if caused by script or patch or planetary alignements:
found over 35000 times (this below is just an example as only the timestamp and ship name is different on those occurenses):
[Scripts] 422939.02 *** aicontext<order.trade.perform,0x176ad>: 422939.02 'Magnetar (Mineral) Sentinel'(job: '') TRADE RUN FAILED! Error: ERR_CANNOT_DOCK
I do have a station where there is a lot of incoming NPC trader traffic .... could be planetary alignment ....
Steam X-Superbox, XR, playing X4
WIndows-7
Intel I7-3770
16Gb Memory
Nvgidia GTX-1060

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

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sun, 23. Jun 19, 21:55

Browser_ice wrote:
Sun, 23. Jun 19, 21:39
Hi, started using your MOD yesterday but I am having some issues. Most of my trader ships are not doing anything on Station Mule and Distribute Mule. Out of 5 traders, only one was doing anything and that was on Station Mule; the others seam to just stay there doing nothing. Travel Mule seams to be working but I only used it on one trader.

It is the only MOD I use.

I have 3 stations in the same sector:
- one shipyard not yet fully built but has a manager and ship trader
- one yard not yet fully built but has a manager and ship trader
- one fully built producing every parts 2x needed for both above and self sufficient
How much money do you have in your budget and do you have buy orders for the things you need in your warehouse? I had an issue where my mules wouldn't move product it was due to not having enough money in the budget. I have a warehouse with 85m storage and i need about 150m in the budget to get them to move everything sufficently. The factories have a budget of 1m credits (to make it easy for me to keep track if it moves) and they buy from the warehouse just fine. But the warehouse needs a large budget due to all the different wares I'm sending to it.

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

Re: [MOD] Mules and Warehouses v4.0

Post by ThePiercdPrnc » Sun, 23. Jun 19, 22:29

Ramokthan wrote:
Sun, 23. Jun 19, 14:22
Updated the BuyerMule.

Please try it again. :-)
It seems to be working this time :D I've got one buyer picking up Claytronics and the queue filled up immediately and off he went. So far he's bought from a couple stations and should deliver to home. Thanks for this, its such a pain in the ass to wait on claytronics from NPCs, I've got hull and EC covered locally but CT is gonna cost me another like 700m CR to get the factories running. So currently it's a no go.

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

Re: [MOD] Mules and Warehouses v4.0

Post by Ramokthan » Sun, 23. Jun 19, 22:31

You can ignore that script warnings, they do not affect the functionality.
Its just "code style".


The major ones... well... did you select a station?
If you run the distrimule without selecting a station this error occurs

Btw @Author.
I suggest to wind up the recheck timers a lot... if a lot mules are working and a lot of them are not finding any trade it has a heavy performance impact if you let them check every second.

@ThePiercdPrnc
Thanks for confirming its working.. i use them a lot now too... i started a new game again. I had my ships built in no time on argon wharf bc the buyer mule supplied the wharf with the needed resources. So good.
Hope it will be useful for more people. Leve suggestions and bug reports whenever applicable. :-)

A tip for BuyerMule usage: if you experience cases in which they dont seem to find any trades, play around with the max trades. if the highest trade volume he can find is lower then its max cargo divided by max trades he wont trade anything. So either pick a ship with less cargo space or increase max trades. of course increasing max trades can cause it to do a lot more trades before returning home, resulting in a long run. Play around with that as you please.

every trade he attemps has to have the minimum volume of Shipcargo divided by maxtrades, except the last trade which will fill its cargo to ~ 100%, for this last trade he accepts a trade half as big as normal, but nothing like 20 wares trade just to get the cargo full.
Last edited by Ramokthan on Sun, 23. Jun 19, 23:28, edited 1 time in total.

Post Reply

Return to “X4: Foundations - Scripts and Modding”