[Mod/MDScript] Lost Ship Replacement Filters

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

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

User avatar
ChemODun
Posts: 436
Joined: Mon, 12. Feb 07, 21:58
x4

[Mod/MDScript] Lost Ship Replacement Filters

Post by ChemODun »

X4 - Lost Ship Replacement Filters for the Shipyards

This extension allows you to exclude some Shipyards from the list of available for the Lost Ship Replacement.
Filtering can be made by the ship class, i.e. per S, M, L, XL ships.

Image

Compatibility

Compatible with X4: Foundations 7.50 and upper. At least it has been written for feature introduced in this version.

Features
  • Possibility to configure exclusions of any Shipyards via the interface of any Ship Trader.
  • You can easily select which Shipyards are allowed to produce selected ship classes.
  • Support for the context menu, if any kind of the X4 Mod Support APIs is installed (Not required, but recommended for better user experience).
How it works

After installation, you will see a new button in the Ship Trader interface.
By clicking on it, you will have the possibility to go through all your shipyards and select which of them are allowed to produce selected ship classes.
When it is configured and some of your ships are destroyed, the appropriate shipyard will be selected for the Lost Ship Replacement based on the configuration and distance to the shipyard from the sector where the ship was destroyed.

Download

You can download the latest version via Steam client - Lost Ship Replacement Filters
Or you can do it via the NexusMods: Lost Ship Replacement Filters

Configuration

Without context menu support
  • Simply go to the Information window of any of your Shipyards and select the Crew tab.
Spoiler
Show
Image
Spoiler
Show
Image
  • There you will see the name of Ship Trader on that Shipyard, and can open the interface by pressing the right mouse button and selecting the option Comm.
Spoiler
Show
Image
  • In the open interface of interactions with NPC, you will see the new button Lost Ship Replacement Filters.
Spoiler
Show
Image
  • Then read the instructions below for the common steps.
With context menu support
  • If you have installed any kind of the X4 Mod Support APIs, you can access the Lost Ship Replacement Filters via the context menu of the Ship Trader.
Spoiler
Show
Image
  • Then read the instructions below for the common steps.
Common steps
  • By clicking on it, you will see the updated buttons, with the Shipyard name in the top left (disabled) one and then the buttons for each ship class. If you have more than one Shipyard, the last one, right-down button will show the next Shipyard name and ID.
Spoiler
Show
Image
  • By clicking on the ship class button, you will toggle the allowance of the Shipyard to produce ships of that class for Lost Ship Replacement.
Spoiler
Show
Image
  • And if you disable all classes for the Shipyard, it will be excluded from the Lost Ship Replacement.
Spoiler
Show
Image
  • If some classes can't be produced by the Shipyard, the button will be disabled. But in the configuration, that class will be allowed to be produced by the Shipyard. And when and if you enable that class, please don't forget to check the Shipyard for the possibility to produce that class.
Spoiler
Show
Image
Video

Video version of configuration

Video demonstration of the context menu support

Video demonstration of filtering result

Links

There is a thread on EgoSoft forum - [Mod/MDScript] Lost Ship Replacement Filters. Feel free to ask any questions or report issues there.
Last edited by ChemODun on Tue, 22. Jul 25, 00:20, edited 3 times in total.
Multiply entropy by absolute zero

Freedom in space
User avatar
ChemODun
Posts: 436
Joined: Mon, 12. Feb 07, 21:58
x4

Re: [Mod/MDScript] Lost Ship Replacement Filters

Post by ChemODun »

Changelog

[1.02] - 2025-07-21

Added
  • Added context menu support, if the of any kind of X4 Mod Support APIs is installed.
Improved
  • Improved the filtering of Shipyards by simplifying the code and applied diff to the fleet_reconstitution.xml file.
  • Some internal improvements. Get rid of storing configs under the player.entity.
Fixed
  • Naming of the Ship Traders in Readme.md
[1.01] - 2025-03-10

Fixed
  • If not all Shipyard Filters are set, the wrong one can accidentally be used.
[1.00] - 2025-03-07

Added
  • Initial version of the Shipyard Filters extension.
Last edited by ChemODun on Tue, 22. Jul 25, 00:21, edited 1 time in total.
Multiply entropy by absolute zero

Freedom in space
RyanHeart
Posts: 108
Joined: Sat, 29. Mar 25, 11:26
x4

Re: [Mod/MDScript] Lost Ship Replacement Filters

Post by RyanHeart »

Hi, thnx for the mod, can i have a request ? can you implement a filter for faction specific ships like this shipyard/wharf can only produce ships from this faction etc etc, this would be great because to differiatiate terran and commenwealth wharfs/shipyards thus reduce the logistic bottlenecks and open ways to roleplay, thnx :)
User avatar
ChemODun
Posts: 436
Joined: Mon, 12. Feb 07, 21:58
x4

Re: [Mod/MDScript] Lost Ship Replacement Filters

Post by ChemODun »

Excuse me, missed your comment.

Will look. But, for sure it will make it more complex ... from player point of view.
Multiply entropy by absolute zero

Freedom in space
User avatar
ChemODun
Posts: 436
Joined: Mon, 12. Feb 07, 21:58
x4

Re: [Mod/MDScript] Lost Ship Replacement Filters

Post by ChemODun »

[1.02] - 2025-07-22

Added
  • Added context menu support, if the of any kind of X4 Mod Support APIs is installed.
Improved
  • Improved the filtering of Shipyards by simplifying the code and applied diff to the fleet_reconstitution.xml file.
  • Some internal improvements. Get rid of storing configs under the player.entity.
Fixed
  • Naming of the Ship Traders in Readme.md
Video demonstration of the context menu support
Image
Multiply entropy by absolute zero

Freedom in space

Return to “X4: Foundations - Scripts and Modding”