Question about matchextension in jobs

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

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

Post Reply
Hornet108
Posts: 343
Joined: Thu, 15. Nov 12, 13:46
x4

Question about matchextension in jobs

Post by Hornet108 » Sun, 22. Dec 19, 15:08

Hi Guys

In the breaking changes doc, the matchextension keyword talks about only only spawning objects in areas of the map that are added by the extension in which that entry is defined

I'd just like some clarity about the word spawning - does that mean only ships that are set to actually spawn in at a gate, or ships that are built at a station?

IE, if I add a job for Argon Prime that is built at a station in my mod, will it not work without the matchextension = true flag set as my mod did not add Argon Prime?

Thanks!

Mysterial
Posts: 645
Joined: Wed, 6. Nov 02, 20:31
x4

Re: Question about matchextension in jobs

Post by Mysterial » Sun, 22. Dec 19, 16:28

Short version: Yes you still need it.

All job ships, even those built at a shipyard, have a job zone. It's the location that their orders are set unless overridden by faction logic. For spawned ships it's also related to where the ship pops into existence but they are separate topics. Even if your ship is normally rebuilt by faction logic (as with most traders) and is therefore given a job zone by the AI, at game start the normal job engine selection applies and it will need a default zone. If you do not have matchextension="false" in there then only areas added by your extension are eligible, which for most mods means jobs cannot work.

In almost all cases mod authors should just get used to putting matchextension="false" in every job definition. In the rare event that's not actually what you want, you'll probably know that ahead of time.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13093
Joined: Sat, 9. Nov 02, 11:45
x4

Re: Question about matchextension in jobs

Post by Xenon_Slayer » Sun, 22. Dec 19, 16:36

In the current 3.0 beta, it controls where a ship will spawn on gamestart or where its 'home' zone is, known as the jobmainzone in scripts. matchextension doesn't currently affect which shipyards are selected to build a ship.

If you add an Argon Prime job but use matchextension = true, I don't expect that job will spawn as it will not find a suitable space to be its jobmainzone. If you are not adding new areas of space, matchextension should be false.

If you are adding new areas of space in the mod and have matchextension = true, there may be the case where a ship is constructed in a base-game shipyard, but then flies to a sector of the extension. We may look into tweaking that to prevent odd situations and make the behaviour a bit more predictable.
Come watch me on Twitch where I occasionally play several of the X games

Post Reply

Return to “X4: Foundations - Scripts and Modding”