[MOD] Shipyard Shortage Workaround

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

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

User avatar
MegaJohnny
Posts: 2195
Joined: Wed, 4. Jun 08, 22:30
x4

[MOD] Shipyard Shortage Workaround

Post by MegaJohnny » Tue, 18. Dec 18, 23:24

A lot of players still have shipyards which can't build anything due to resource shortages, and this causes all sorts of headaches like dying war activity and players being unable to buy new ships. It's great that shortages can happen, but personally I would rather have shipyards just work until the underlying supply issues are fixed.

So here's a little script that cheats in wares to stalled shipyards, so they can always build ships. Every 10 seconds it checks every (non-player-owned) shipyard and wharf in the game. If a shipyard is stalled on any builds because of resource shortages, this script cheats in the exact amount for that shipyard to finish all of its current build queue.

If a shipyard doesn't have a shortage of something, it won't be cheated in, so wares can still be consumed naturally as usual.

I can't promise there are no side effects, due to station managers having their stock levels altered magically, or anything like that. But boy, I can tell you a lot of jobships were waiting to be built in my game.

The mod operates as long as it is installed - there is no need (or ability) to configure it in-game. You can customise how often the mod operates by changing the 'delay' tag of the 'TimerLoop_Reset' cue in the script.

Download
Nexusmods

Changes
1.0 - 2018-12-18
  • Initial release
Last edited by MegaJohnny on Sun, 23. Dec 18, 19:02, edited 3 times in total.

Nerophos
Posts: 22
Joined: Fri, 4. Nov 11, 11:40
x3tc

Re: [MOD] Shipyard Shortage Workaround

Post by Nerophos » Tue, 18. Dec 18, 23:49

Nice idea, will try it out asap, I hope that also works for the paranit shipyard that vanished my 5k engine part's

arknor1981
Posts: 62
Joined: Sat, 16. Nov 13, 23:05

Re: [MOD] Shipyard Shortage Workaround

Post by arknor1981 » Wed, 19. Dec 18, 00:03

nice I can use it to test something

LIVIGO
Posts: 12
Joined: Thu, 15. Oct 15, 19:43

Re: [MOD] Shipyard Shortage Workaround

Post by LIVIGO » Wed, 19. Dec 18, 00:30

Awesome! its the 10 seconds mandatory or can it set be manually to another value?
~ I'm a X Series Noob so bear with me, and english is not my native tongue :p ~

celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [MOD] Shipyard Shortage Workaround

Post by celludriel » Wed, 19. Dec 18, 00:52

Great idea ! Ever since I read they were using a real simulation I was weary and with reason. We do not have the Enterprise-E computer to drive an AI to do the right thing and get a supply chain in order. I think let the ai cheat is the only way to go !

Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Kadatherion » Wed, 19. Dec 18, 01:54

I'm afraid this is gonna be needed for a long, long time. They may fix one thing in the economy, but the next imbalance will just show itself immediately after, finding the perfect spot will take them a lot of testing and trial and error. In any case, thanks. Right now I've just almost finished building an engine parts/smart chips megacomplex, and I want to see what happens in the universe with that running, if it's still not gonna be enough (or if I start a new game where I sure as hell don't want to have to do the same babysitting over and over again), this is going straight into my mod folder.

Varien101
Posts: 63
Joined: Fri, 7. Dec 18, 02:08

Re: [MOD] Shipyard Shortage Workaround

Post by Varien101 » Wed, 19. Dec 18, 02:03

Xeno's included in this?

Without the shipyard economy... That leaves only the illegal economy... ROGERRRRR Drug Lord operations commencing.

User avatar
paris_england
Posts: 34
Joined: Wed, 3. Oct 18, 01:32
x4

Re: [MOD] Shipyard Shortage Workaround

Post by paris_england » Wed, 19. Dec 18, 04:05

Thank you!

User avatar
paris_england
Posts: 34
Joined: Wed, 3. Oct 18, 01:32
x4

Re: [MOD] Shipyard Shortage Workaround

Post by paris_england » Wed, 19. Dec 18, 04:56

Paranid shipyard: Demeter was built, watched it reach 100% ... then it disappeared. :gruebel: Wondering if somehow ownership was changed to HOP as I've had this happen before.

One the bright side, it WAS built :)

Nerophos
Posts: 22
Joined: Fri, 4. Nov 11, 11:40
x3tc

Re: [MOD] Shipyard Shortage Workaround

Post by Nerophos » Wed, 19. Dec 18, 07:26

I also got a ship stuck at Paranit Space: M Class 3 resources wehere missing and after 30 sec all res where there, and ship didnt disappear
Also all shipyards/spacedocks with shortage got there res so working fine here thx for the workaround

Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Kamuchi_ » Wed, 19. Dec 18, 07:33

Station hack vs no game, that's a rather easy choice :lol:

Thank you! :D

User avatar
MegaJohnny
Posts: 2195
Joined: Wed, 4. Jun 08, 22:30
x4

Re: [MOD] Shipyard Shortage Workaround

Post by MegaJohnny » Wed, 19. Dec 18, 11:00

Kadatherion wrote:
Wed, 19. Dec 18, 01:54
I'm afraid this is gonna be needed for a long, long time. They may fix one thing in the economy, but the next imbalance will just show itself immediately after, finding the perfect spot will take them a lot of testing and trial and error. In any case, thanks. Right now I've just almost finished building an engine parts/smart chips megacomplex, and I want to see what happens in the universe with that running, if it's still not gonna be enough (or if I start a new game where I sure as hell don't want to have to do the same babysitting over and over again), this is going straight into my mod folder.
Right? I usually progress in X games very slowly, so I couldn't do the babysitting myself if I wanted to. And that's not to mention the chance of getting the bug some have where shipyards don't have buy offers for the thing they're missing, or their allocated storage is below what's needed for a build etc etc...

There seems to be a lot of cool stuff in X4 in terms of NPC fleet action. I just want to see it all unfold without being bottlenecked.
LIVIGO wrote:
Wed, 19. Dec 18, 00:30
Awesome! its the 10 seconds mandatory or can it set be manually to another value?
You can configure it :) Look for the MD script in the md/ folder of the mod, and look for an XML element called "delay". It should be fairly obvious how you can change it from there.
Varien101 wrote:
Wed, 19. Dec 18, 02:03
Xeno's included in this?

Without the shipyard economy... That leaves only the illegal economy... ROGERRRRR Drug Lord operations commencing.
It checks Xenon too, but I had some debug output when developing this mod, and it never reported any Xenon shipyards as being stuck.

But either way, the wares shipyards are low on (engine parts etc) should still have a high selling price, because the mod only supplies shipyards with the exact missing amount. If a shipyard needs 200 engine parts to finish its builds, but it only has 50, the mod supplies it with 150 and all 200 are used up. So the shipyard ends up with no engine parts in stock at all, which should result in a high buying price. The mod doesn't spawn in any wares it isn't short on, so it should use up excess resources as normal.

Spacecop42
Posts: 26
Joined: Fri, 14. Dec 18, 18:45
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Spacecop42 » Wed, 19. Dec 18, 11:33

Does this ignore the maximum storage limit when the shipyard has full storage but not enough space for the needed hull parts for example?

Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Kamuchi_ » Wed, 19. Dec 18, 11:39

Spacecop42 wrote:
Wed, 19. Dec 18, 11:33
Does this ignore the maximum storage limit when the shipyard has full storage but not enough space for the needed hull parts for example?
Yes, space magic ftw! :D

User avatar
MegaJohnny
Posts: 2195
Joined: Wed, 4. Jun 08, 22:30
x4

Re: [MOD] Shipyard Shortage Workaround

Post by MegaJohnny » Wed, 19. Dec 18, 12:05

It can't help if the storage modules are packed to the brim, but it should ignore the per-ware soft limit set by the manager. If Kamuchi has found this to be the case, then that's great.

Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Kamuchi_ » Wed, 19. Dec 18, 12:57

MegaJohnny wrote:
Wed, 19. Dec 18, 12:05
It can't help if the storage modules are packed to the brim, but it should ignore the per-ware soft limit set by the manager. If Kamuchi has found this to be the case, then that's great.
Atleast I think so?
Will take a closer look at all the stations later but when enabling the mod HOP was building ships again, even my sentinel got finished while befor it's storage was full of junk.

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [MOD] Shipyard Shortage Workaround

Post by argon_emperor » Wed, 19. Dec 18, 14:50

MegaJohnny wrote:
Wed, 19. Dec 18, 12:05
It can't help if the storage modules are packed to the brim, but it should ignore the per-ware soft limit set by the manager. If Kamuchi has found this to be the case, then that's great.
Maybe extend this a little further then? If per-ware storage is greater than 80% of its allowance, make the wares disappear until it's back down to 80%? That way They should always have some room for all wares, and then also helps provide more moving of goods from factories to docks?
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: [MOD] Shipyard Shortage Workaround

Post by morbideth » Wed, 19. Dec 18, 15:23

Perhaps counteract its effects on the economy by make it so that it removes wares if the shipyard is full?

User avatar
MegaJohnny
Posts: 2195
Joined: Wed, 4. Jun 08, 22:30
x4

Re: [MOD] Shipyard Shortage Workaround

Post by MegaJohnny » Wed, 19. Dec 18, 15:23

argon_emperor wrote:
Wed, 19. Dec 18, 14:50
Maybe extend this a little further then? If per-ware storage is greater than 80% of its allowance, make the wares disappear until it's back down to 80%? That way They should always have some room for all wares, and then also helps provide more moving of goods from factories to docks?
Good suggestion. This should be easy enough to do, so I'll check it out tonight.

Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

Re: [MOD] Shipyard Shortage Workaround

Post by Kamuchi_ » Wed, 19. Dec 18, 15:42

argon_emperor wrote:
Wed, 19. Dec 18, 14:50
MegaJohnny wrote:
Wed, 19. Dec 18, 12:05
It can't help if the storage modules are packed to the brim, but it should ignore the per-ware soft limit set by the manager. If Kamuchi has found this to be the case, then that's great.
Maybe extend this a little further then? If per-ware storage is greater than 80% of its allowance, make the wares disappear until it's back down to 80%? That way They should always have some room for all wares, and then also helps provide more moving of goods from factories to docks?
That won't help because all traders will start hauling stuff and if the engine/hull factories aren't near the shipyard then the traders will start hauling the junk again befor getting to the actual parts that it's short on, in essense just making it worse.
What MegaJohnny did with injecting the missing parts into the yard to force finish construction is pretty much the best way to deal with this untill the devs figured out how to limit wares while keeping a balance.

Post Reply

Return to “X4: Foundations - Scripts and Modding”