Shipyards, ware levels and dropped jobs.

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

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

Post Reply
Dr Reed
Posts: 76
Joined: Fri, 30. Nov 18, 00:05
x4

Shipyards, ware levels and dropped jobs.

Post by Dr Reed » Wed, 30. Jun 21, 19:41

I have been working on Mod that adds a few sectors to the galaxy with a new Teladi faction which inhabits some of them.
Whilst testing the faction economy and to stress it some more i added a few long range gate guarding missions where the Xenon and HOP ships would eat up the job ship ship spawns. But I seem to have ran into a problem where shipyards sometimes do not rebuild the job ships and on my last overnight run, all 6 suicide jobs stopped being rebuilt.

So my question is, does the game drop faction shipyard build jobs if the station runs for a few hours without enough wares to build the ships ?

arshiba
Posts: 48
Joined: Thu, 1. Jul 04, 15:30
x4

Re: Shipyards, ware levels and dropped jobs.

Post by arshiba » Thu, 1. Jul 21, 16:03

Dr Reed wrote:
Wed, 30. Jun 21, 19:41
So my question is, does the game drop faction shipyard build jobs if the station runs for a few hours without enough wares to build the ships ?
Indirectly - yes (I examined the ship building chain for my mod).
In short, after 40 min without materials, ships will be thrown out of the shipyard build queue. And without free build processors, waiting job ships can't be reassigned again.

Code: Select all

<!--Don't abort any builds that haven't been in the queue for 40 mins-->
<do_if value="$loopbuild.isshipbuild and $loopbuild.faction != faction.player and player.age gt $loopbuild.time + 40min">

Code: Select all

<debug_text text="$Faction.knownname + ' Ignoring shipyard: ' + $Shipyards.{$i} + ' ' + $Shipyards.{$i}.knownname + ' in ' + $Shipyards.{$i}.sector.knownname + ' as it does not have enough free build processors'" chance="$DebugChance"/>
<remove_value name="$Shipyards.{$i}"/>
Anyway you will have to check the entire chain by yourself.
1) md/job_helper.xml Faction logic script to add waiting job ships to the shipyard build queue
2) aiscripts/build.shiptrader.xml Shiptrader NPC managing build queue
Look at <find_waiting_job_ship ...> and object.builds.queued.

Dr Reed
Posts: 76
Joined: Fri, 30. Nov 18, 00:05
x4

Re: Shipyards, ware levels and dropped jobs.

Post by Dr Reed » Fri, 2. Jul 21, 20:34

Thanks for that info. I had a look throug the job_helper and the build.shiptrader xml files but they are waaay above my knowledge base.
I'm now not sure that a big hole can be placed in a factions production line for the player to fill as this could affect factions jobs being completed.

Looks like i'm gonna have to do a lot of runs to try and balance things.

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Shipyards, ware levels and dropped jobs.

Post by Shuulo » Sat, 3. Jul 21, 13:57

arshiba wrote:
Thu, 1. Jul 21, 16:03

In short, after 40 min without materials, ships will be thrown out of the shipyard build queue. And without free build processors, waiting job ships can't be reassigned again.
wait, it means that job ship will never be built at all if its not built in that 40 minutes? I assumed they will be ordered for construction again in some time.

arshiba
Posts: 48
Joined: Thu, 1. Jul 04, 15:30
x4

Re: Shipyards, ware levels and dropped jobs.

Post by arshiba » Sat, 3. Jul 21, 16:02

Shuulo wrote:
Sat, 3. Jul 21, 13:57
I assumed they will be ordered for construction again in some time.
Yes it is, I have not argued otherwise. Bring the missing resources to the shipyard to build some of the already queued ships, and the build processors will be freed up so the waiting job ships can queue. Without resources, those ships will wait (to be queued) for eternity.
PS Sketch diagram

Post Reply

Return to “X4: Foundations - Scripts and Modding”