X4: Foundations

X4: Foundations

26 ratings
RandomMine Delta
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
47.518 KB
28 Jan, 2023 @ 3:02am
1 Change Note ( view )

Subscribe to download
RandomMine Delta

Description
Disclaimer:
This is a modification of the original Mod RandomMine made by Andro.
He gave permission to modify his mod and to share it.

tl;dr;
This mod adds a new ship order for miners, which allows them to mine for player stations, which require ore they could mine. If it is unable to provide any player stations it will mine something first and then try to sell it to the player station or npc stations.

The long description:
The general idea is to have this mod solve all your mining needs for your stations and even provide a profit, when they are done doing that by mining for npc stations. This behaviour can be customized with the order parameters.

You can get started using the new mining order "RandomMine" with just a single ship.
Afterwards you expand to fleets, where you have one mining ship as the leader and this is where you set all your RandomMine order parameters.

Therefor the usual workflow is the following:
- Get some Mining ships. The ship size is not important here, but I use different fleets for M and L miners.
- Form a fleet with only miners.
- Set the Default order of the fleet commander to RandomMine
- if you use it with it's default options, it will only serve your stations and it will operate in the area centered around the ship position
- Check the "Update subordinates" option and hit confirm

What will happen then is, that the commander will set the default order for all of it's subordinates to randommine as well and copy it's own settings to it.
If you later add new subordinates or change settings on the commander and want to copy them again, then just check the Update option again or wait, since the order will automatically copy the settings once per hour to it's subordinates automatically. The copy action will only happen, when the current orders from the commander are done and it processes it's default order again. So if you want to speed it up, you can cancel the current orders the commander has and it will do the copy action immediatly.

Important:
The miner will select which station to serve based on the buy price of the station!
So I recommend to use set the buy price to auto, so that the buy price will serve stations with the least items first, instead of trying to get one station to 100% full and another is starving at 0% supplied.
In order for the buy order to even be visible to the mod make sure that the station has some funds!
It does not need the full estimated fund level, but just have an eye on it and if a station does not get any ore, then increase the funds that the station has.
Also, please make sure that you don't use this and the original RandomMine mod at the same time, since they will conflict! It should be possible, to switch between them.

Order Options / Parameters:
- Supplier: The ship will supply your own stations buyorders
- Free Miner: The ship will mine something first and then try to sell it to your own station and if none wants it to an npc.
You can enable both Supplier and Free Miner at the same time or only either one. It will prioritize the supplier role.
- MinerHome & HomeBound: Used to change the operation area of the mining ship. When disabled it will operate around the current ship position, when it tries to find new work. You can set it to a sector to bind it to an operation area.
- The three distance settings depend on the pilot level. The range will increase with it's level.
- Wares: here you can restrict it to specific wares or just leave it on the "All Wares" option and have it add all supported automatically.
- Factions: Here you can select, which factions it's allowed to sell wares to.

Sidenotes:
- I sometimes had the issue that ships got stuck on the mining order and didn't to anything, because the ore they mined was depleted. So I added a stuck ship detection logic, which will cancel the current mining order of the ship, if it has been stuck for an hour.
- The ships have information about what they did in their ship log.

Sourcecode:
I have published the source code of this mod at: https://github.com/Nivalux/X4Mods
Popular Discussions View All (1)
1
19 Oct, 2023 @ 7:44am
Spammed with "Cannot Sell" messages
Starsong
16 Comments
DatBoi302 5 Jun @ 4:41pm 
Whats the difference with this mod and the OG version?
Hebrux 7 Mar, 2024 @ 11:29am 
Does anyone know if this mod causes fps issues? I hope not
ThePunisher 4 Jun, 2023 @ 6:38am 
@Faryu I forgot to post here the solution, I had to delete both random mine mods (also the same issue was with randomsupply so this got me thinking) and re-download them from steam, now it gives that error to Andro's versions of the mods and yours are active.
Also I don't mind the "cheating" bcs I take it as a more advance AI that can use scan mode to find asteroids with yields, I mean to create a mine order and a sell order of 6 unit when there are 75 milions in system is stupid. Apparently Andro is aware of this with his mod and trying to fix it, whatever you are using and make my miners have full cargo works. Don't fix something if it's not broken. I tried with modifying the radius and broke the mod so whatever works it's fine :))
Faryu  [author] 4 Jun, 2023 @ 3:04am 
@ThePunisher To answer your question about the mining logic, I basically rewrote the entire part about how it locates suitable mining locations. It is a bit cheating, because it scans the ores in the sector, regardless of if you have it discovered by a resource probe or otherwise.
I first intended to have it work in tandem with an existing mod, that automatically finds good ore location and places resource probes there.
In the end I didn't do that, because it would be much more complicated and used the same ore finding methods in this mod.
Faryu  [author] 4 Jun, 2023 @ 3:00am 
@ThePunisher I think you might have to go to the mods directory and delete the affected directories manually.
I also had that issue once, where I tested the switch, and steam created a new directory with another number, because the mod name conflicted with the one from Andro.
So you probably need to look in the mods dir, find all conflicting mod directories, delete them and then subscribe to them again, to have steam download it again.
ThePunisher 1 Jun, 2023 @ 9:26am 
Deactivated and deleted Andro's mods (random trade/supply/mine) and on both of your mods I get a red text "location 'randomsupply/randommine' already used by another extension", I also tried deleting all of the mods except yours and it's the same thing, idk what I'm doing wrong tbh but something it's conflicting somewhere and I can't use these mods.
ThePunisher 1 Jun, 2023 @ 7:36am 
also I deactivated his mod and activated yours to try it out but it doesn't show in game and in extension I get on your mod a red ! and "Location 'randommine' already used by another extension" does this mod conflicts with random supply or random trade?
ThePunisher 1 Jun, 2023 @ 6:58am 
what did you modify from Andro's mod and how? I am currently using his mod and it worked well until I saw that the miners come with very low cargo, sometimes not even 100, I tried to modify their radius from <set_value name="$radius" min="0.0" max="$sector.size/2"/> to <set_value name="$radius" min="0.0" max="$sector.size/0.8"/> bcs they are all mining roughly in the same spot and from the moment the script starts I can see the ware reservation be like 60, or 1. For context, I have Factories in Venus and 30 L gas miners and 50 L Mineral miners to feed those, even tho Asteroid belt has like 70 millions of hydrogen and savage spur another 17 (I own the sector after kicking xenon out of it) and they don't even come to savage spur, 90% of them go to asteroid belt and some to mercury, and yes, they have enough range, like 10 gate distance to mine. After I modified the file and saved it I could no longer see this option in the game, mod was active but no RandomMine to choose.
ShadowDragon8685 22 Feb, 2023 @ 5:50am 
Is there any chance you might make a Delta update of RandomTrade?

I, too, use RandomTrade and it works well enough... But it's a bit dated, it won't handle new factions (such as the Vigor Syndicate), and also, there's a feature I thought that would be really really helpful for RandomTrade:

A player-configured option to automatically lower expectations if the RandomTrader fails to find a trade; if a RandomTrade comes up empty-handed, instead of sitting there holding their throttle, the ship tries again immediately to find another trade with a lowered profit margin expectation. Ideally this would be player-configurable, so the player could set a percentage drop to repeat (and also a minimum below which they don't want the trader to try further).
Radarhazard 15 Feb, 2023 @ 4:39am 
ZariusTBC 4 Feb @ 7:05am
Nevermind i figured it out need to put subordinates on defend not mimic for it to update.

This exactly the kind of thing I do. Thank you for finding this out and telling us! :cozytf2mug: