How to make a clean world?

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

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

cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

How to make a clean world?

Post by cgw »

I want to make a clean map without any stations and ships.
Delete all stations and all ships from the game that are on the map.
And play by myself. (Having built 1 universal base with cheats.)
And then just develop myself.
Mine ore, build bases and the like, and so that all sorts of NPCs don't interfere with me in this.

I wrote a mod to delete all stations
listing them all from libraries/god.xml
with these lines
path libraries/god.xml
<remove sel="//god/stations/station[@id='tradestation_argon_01']" />
...
and it worked.

But when I tried to delete them from DLC, for example Boron and Terran.
then nothing works (this method does not delete Stations).
I tried to put the file in folders.
extensions/ego_dlc_boron/libraries/god.xml
and so
ego_dlc_boron/libraries/god.xml
and so
libraries/god.xml
and nothing works for DLC.

The question is how to delete all stations and all ships from the game.
So that I can play only 1.
What is impossible to get is obtained from the menu with the iseeu0 cheat menu mod.
Yes, I can destroy everything with this iseeu0 cheat menu (but only 1 object), but it takes a very long time (All stations can be deleted in 7 days, and all ships in 1 year).
I also noticed that even if you delete them, they reappear over time.
Maybe there is some magic line like

Remove all stations from the map at once, including DLC
<remove sel="//god/stations/station[All Stations]" />

Remove all ships from the map at once, including DLC
<remove sel="//god/stations/station[All Ship]" />

And prohibit them from building again.

Help write something like this.
It's a pity that the game doesn't have such a ready-made scenario (Clean world where i mine ore and only build your station).
Last edited by cgw on Sun, 22. Sep 24, 22:40, edited 1 time in total.
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31741
Joined: Fri, 16. Apr 04, 19:21
x4

Re: How to make a clean world?

Post by Alan Phipps »

Moving this over to S&M forum from vanilla gameplay forum as you will have more gamecode experts see this here.
A dog has a master; a cat has domestic staff.
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: How to make a clean world?

Post by sprIder »

Hi cgw,

If you look at the god files of the extensions, you'll see that they "diff" the base game god.xml. So everything you want to change is the base game god.xml at \libraries.

My easiest way to remove nearly all stations in god.xml would be

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <remove sel="/god/stations"/>
  <remove sel="/god/products"/>
</diff>
In my short test set up, there are still some stations left:
Spoiler
Show
all Khaak stations, the Alliance Wharf and the Hall of Jugdement
I think this is through the game starts or universe initialization. The Cheat Mod could help here.

Ships are created via libraries\jobs.xml. Since the game needs at least one job, my easiest way would be

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
	<replace sel="//jobs">
		<jobs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="libraries.xsd">
			<job id="dummy_job" startactive="false">
				<expirationtime min="60" max="3600"/>
				<orders>
					<order order="Recon" default="true"/>
				</orders>
				<modifiers rebuild="false" commandeerable="false"/>
				<quota galaxy="1"/>
				<location class="galaxy" macro="xu_ep2_universe_macro"/>
				<ship>
					<!--should never actually be used-->
					<select faction="argon" tags="[fighter]" size="ship_s"/>
					<loadout>
						<level min="0" max="0.4"/>
					</loadout>
					<owner exact="argon" overridenpc="true"/>
				</ship>
			</job>
		</jobs>
	</replace>
</diff>
I recommend using a custom gamestart. There will definitely problems with stations from game starts and with missions.

I hope that helps.

Best regards
sprIder
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

Hi sprIder
sprIder wrote: Thu, 19. Sep 24, 18:05 ...
The point is to remove all ships and all stations from the map. Unfortunately, your method does not work at all,
it does not remove anything at all, even from the base game.
mod/libraries/jobs.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <remove sel="//jobs/job"/>
</diff>
mod/libraries/god.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <remove sel="//god/stations"/>
  <remove sel="//god/products"/>
  <remove sel="//god/object"/>
</diff>
It doesn't delete anything from DLC either, the same code for DLC in folders
mod\extensions\ego_dlc_boron\libraries\god.xml
mod\extensions\ego_dlc_boron\libraries\jobs.xml

mod\extensions\ego_dlc_pirate\libraries\god.xml
mod\extensions\ego_dlc_pirate\libraries\jobs.xml

mod\extensions\ego_dlc_split\libraries\god.xml
mod\extensions\ego_dlc_split\libraries\jobs.xml

mod\extensions\ego_dlc_terran\libraries\god.xml
mod\extensions\ego_dlc_terran\libraries\jobs.xml

I tried and as you wrote, with one slash, it also doesn't work.

Code: Select all

  <remove sel="/god/stations"/>
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: How to make a clean world?

Post by sprIder »

1. Did you try it with an existing save game, or did you start a new game?
My suggested code only works on new games. If you want to remove all ships and stations in an existing save game, you would need a md-script.

2. Your code for the jobs.xml will not work, since the path in the diff code is unspecific.
Debuglog wrote:[=ERROR=] 0.00 Multiple matching nodes for path '//jobs/job' in patch file 'extensions\mod\libraries\jobs'. Skipping node.
3. Please don't worry about the dlcs. You do no have to change the dlc god.xml directly. As I wrote, their god.xml adds things to the base game god.xml. It is not a file on its own, like ships from a dlc. And if you want to change the dlc added stuff of god.xml you have to change the base game god.xml.

4. But I am surprised that your god.xml does not work. Your mod is also really in X4 Foundations\extensions ? -> X4 Foundations\extensions\mod\libraries\god.xml
I think it is not necessary, but: did you try it with adding dependencies to the dlcs in your content.xml?

Code: Select all

<dependency id="ego_dlc_split" optional="false" name="Split Vendetta"/>
<dependency id="ego_dlc_terran" optional="false" name="Cradle of Humanity"/>
<dependency id="ego_dlc_pirate" optional="false" name="Tides of Avarice"/>
<dependency id="ego_dlc_boron" optional="false" name="Kingdom End"/>
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Sat, 21. Sep 24, 10:53 1. Did you try it with an existing save game, or did you start a new game?
Yes, I have tried only the new game "Custom Game" editor creative. (the penultimate tab.)

I turned off all mods (except for the cheat menu to open the entire map) and it didn't change anything.
Mods were not guilty.
I always used these paths before.
X4\extensions\mod\libraries\god.xml
X4\extensions\mod\libraries\jobs.xml
X4\extensions\mod\extensions\ego_dlc...\libraries\god.xml
X4\extensions\mod\extensions\ego_dlc...\libraries\jobs.xml

I had 2 error:

1. I put everywhere <!-- comment --> before

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
I removed the <!-- comment --> at the beginning god.xml и jobs.xml
The problem with the mod not working was in the comments
<!-- This Remove 90% Ships -->
<!-- This Remove 99% Stations -->

2. I removed the extension (There was a problem with this too, there were comments in them too)
X4\extensions\mod\extensions\ego_dlc_boron\libraries\god.xml
X4\extensions\mod\extensions\ego_dlc_pirate\libraries\god.xml
X4\extensions\mod\extensions\ego_dlc_split\libraries\god.xml
X4\extensions\mod\extensions\ego_dlc_terran\libraries\god.xml
X4\extensions\mod\extensions\ego_dlc_boron\libraries\jobs.xml
X4\extensions\mod\extensions\ego_dlc_pirate\libraries\jobs.xml
X4\extensions\mod\extensions\ego_dlc_split\libraries\jobs.xml
X4\extensions\mod\extensions\ego_dlc_terran\libraries\jobs.xml
sprIder wrote: Sat, 21. Sep 24, 10:53
Spoiler
Show

Code: Select all

<dependency id="ego_dlc_split" optional="false" name="Split Vendetta"/>
<dependency id="ego_dlc_terran" optional="false" name="Cradle of Humanity"/>
<dependency id="ego_dlc_pirate" optional="false" name="Tides of Avarice"/>
<dependency id="ego_dlc_boron" optional="false" name="Kingdom End"/>
3. I tried and X4\extensions\mod\content.xml

Code: Select all

<dependency id="ego_dlc_boron" optional="false" name="Kingdom End" />
<dependency id="ego_dlc_pirate" optional="false" name="Tides of Avarice" />
<dependency id="ego_dlc_split" optional="false" name="Split Vendetta" />
<dependency id="ego_dlc_terran" optional="false" name="Cradle of Humanity" />
But this also makes the mod non-working.
Last edited by cgw on Sat, 21. Sep 24, 19:50, edited 1 time in total.
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Sat, 21. Sep 24, 10:53 ...
And yes, it worked!

* Removed ~99% Stations. Only about ~7-10 stations will remain (depending on the settings of the starting game)
{ Translation from my language may not be entirely correct:
1 Acropolis of Justice (Tarka Gorge XXIV) can't be removed even by the cheat menu
1 Xenon Station (Matrix 101)
1 Xenon Station (Mu-Kai's Revenge)
2 Khaaki (Sanctuary of Darkness)
1 Xenon Station (Sanctuary of Darkness)
1 ALBION Alliance Port (Reliable Kush III Treasure)
1 Grand Exchange | Headquarters (Grand Exchange I)
1 Duke's Haven (Duke's Awakening VI)
1 Harrows Shipyard (Veliki Reef)
}

* Removed ~87% of ships
(In order to see this, I placed all the satellites at the start of the game in settings in almost all sectors.)
{ This indicator has already been tested several times.
there are 1-7 ships left for each sector. approximately 527 ships in total.
Without the mod this is approximately 30 ships per sector. Approximately 4000 ships in total.
}

In general, the working mod looks like this
(This also removes almost all ships and stations from all DLC):

X4\extensions\mod\content.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<content id="clearworldd" name="clearworldd" description="Remove All Station and Remove All Ships" author="i" version="7" date="2024-09-21" save="0" lastupdate="0000000007">
</content>
X4\extensions\mod\libraries\god.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/god/stations"/>
  <remove sel="/god/products"/>
  <remove sel="/god/object"/>
</diff>
X4\extensions\mod\libraries\jobs.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/jobs/job"/>
</diff>
Below I didn't see any difference with or without this
Spoiler
Show
X4\extensions\mod\extensions\ego_dlc_boron\libraries\jobs.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/jobs/job"/>
</diff>
X4\extensions\mod\extensions\ego_dlc_pirate\libraries\jobs.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/jobs/job"/>
</diff>
X4\extensions\mod\extensions\ego_dlc_split\libraries\jobs.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/jobs/job"/>
</diff>
X4\extensions\mod\extensions\ego_dlc_terran\libraries\jobs.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
  <remove sel="/jobs/job"/>
</diff>
The rest can be cleaned up by the chit menu from iseeu0

But still, it seems to me that there are still a lot of ships (500-600) to clean up.

I wonder if they are all cleaned up, will the ships reappear on their own?

sprIder thank you for help.
Last edited by cgw on Sun, 22. Sep 24, 22:37, edited 1 time in total.
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: How to make a clean world?

Post by sprIder »

Good to hear, that it works.

But, seriously, give it a try and use me suggested code for jobs.xml. Your code does not work. I think the ships are just less appearing because there are no stations which need ships.
Spoiler
Show
sprIder wrote: Thu, 19. Sep 24, 18:05 Ships are created via libraries\jobs.xml. Since the game needs at least one job, my easiest way would be

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<diff>
	<replace sel="//jobs">
		<jobs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="libraries.xsd">
			<job id="dummy_job" startactive="false">
				<expirationtime min="60" max="3600"/>
				<orders>
					<order order="Recon" default="true"/>
				</orders>
				<modifiers rebuild="false" commandeerable="false"/>
				<quota galaxy="1"/>
				<location class="galaxy" macro="xu_ep2_universe_macro"/>
				<ship>
					<!--should never actually be used-->
					<select faction="argon" tags="[fighter]" size="ship_s"/>
					<loadout>
						<level min="0" max="0.4"/>
					</loadout>
					<owner exact="argon" overridenpc="true"/>
				</ship>
			</job>
		</jobs>
	</replace>
</diff>
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Sat, 21. Sep 24, 20:56 ...
In general, this is not a good idea. with <remove sel="/jobs/job"/>
saved the game, exited, loaded the game and there are about 3*100=300 ships at my base, even the fps sags, and 5*20=100 ships at the acropolis of justice (tarka gorge XXIV).
In general, ships still appear out of nowhere and begin to build bases at a huge speed, so fast that I simply do not have time to delete them with cheats.

I haven't tried your code, I'll try it.
Last edited by cgw on Sun, 22. Sep 24, 22:10, edited 1 time in total.
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Sat, 21. Sep 24, 20:56 ...
At first I thought it was just a cut out from jobs.xml as an example, a sample of what's what in jobs and I didn't understand anything that was written there.

I pasted your code in
extensions\mod\libraries\jobs.xml

And Oh YES, the miracle 15 ships and 30 in 2 divisions = 45 ships in total on the entire map (And they are exclusively either plot or empty with 0 crew) Super, I didn't even dream of such a thing.
I really don't understand what is written in your code.
You are a genius. I would never have thought of writing it like that.
But it really works.
Even restarting the game does not spawn new ships.
Why didn't you publish your mod? I searched for it on Steam and NexusMod by the Clear World tags.
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: How to make a clean world?

Post by sprIder »

Well, it is a snippet of the original jobs.xml, the example dummy job. But with " <replace sel="//jobs"> " all jobs are replaced, in this case with this one dummy jobs, which is only activated when a md script or another jobs calls it (startactive="false").

Thank you!
I never thought of creating such a mod, that was your idea. I was just offering some help.
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Mon, 23. Sep 24, 10:16 ...
Please publish the mod or let me do it.
Very much thank for your help.
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: How to make a clean world?

Post by sprIder »

It is your mod, feel free to publish it! :)
If I were to publish the mod, I would need at least the weekend to really create an empty universe. I am not happy with the still existing Xenon and Khaak etc. stations.
cgw
Posts: 11
Joined: Mon, 21. Jan 19, 14:09
x4

Re: How to make a clean world?

Post by cgw »

sprIder wrote: Wed, 25. Sep 24, 16:18 It is your mod, feel free to publish it! :)
If I were to publish the mod, I would need at least the weekend to really create an empty universe. I am not happy with the still existing Xenon and Khaak etc. stations.
Here is the mod. Maybe someone needs it.
https://steamcommunity.com/sharedfiles/ ... 3341906789

Return to “X4: Foundations - Scripts and Modding”