Station quota modding question

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

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

ApoxNM
Posts: 779
Joined: Wed, 5. Dec 18, 06:17
x4

Station quota modding question

Post by ApoxNM » Sat, 6. Jan 24, 15:58

Hi guys,

I am working on a new mod that I don't quite know will work.

But the idea is to make spacefuel and spaceweed a requirement for habitats (workunits).
I have that part working and also added new jobs to fille in the factions space (SCA traders for spaceweed, which I am working on now).

But I have problems generating new stations.
This is my code in the god.xml:

Code: Select all

<diff>

	<add sel="/god/products">

        <product id="hat_spaceweed" ware="spaceweed" owner="hatikvah" type="factory">
            <quotas>
                <quota galaxy="4" />
            </quotas>
            <location class="galaxy" macro="Cluster_29_macro" matchextension="false" />
            <module>
                <select ware="spaceweed" race="teladi"/>
            </module>
        </product>

        <product id="hat_spaceweed_01" ware="spaceweed" owner="hatikvah" type="factory">
            <quotas>
                <quota galaxy="10" />
            </quotas>
            <location class="galaxy" macro="xu_ep2_universe_macro" faction="[hatikvah, scaleplate]" relation="self" comparison="ge">
                <economy max="0.7" maxbound="false" />
            </location>
            <module>
                <select ware="spaceweed" race="teladi"/>
            </module>
        </product>

	</add>

</diff>

But I get these errors:

Code: Select all

[=ERROR=] 0.00 [God Engine] God Entry ID: 'hat_spaceweed_01' no sectors in galaxy found, error in map?
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [God Engine] God Entry ID: 'hat_spaceweed_01' no sectors in galaxy found, error in map?
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [God Engine] God Entry ID: 'hat_spaceweed_01' no sectors in galaxy found, error in map?
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [God Engine] God Entry ID: 'hat_spaceweed_01' no sectors in galaxy found, error in map?
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [God Engine] God Entry ID: 'hat_spaceweed_01' no sectors in galaxy found, error in map?
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [GodProductionEntry] Error: GodEntryID: 'hat_spaceweed_01' is unable to find suitable locations for 10 remaining productions.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 ModuleDB::FindFactoryGenerator(): unable to find Module generator for ware Spaceweed, tags null, race null, factions [faction.hatikvah]
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 ModuleDB::FindFactoryGenerator(): unable to find Module generator for ware Spaceweed, tags null, race null, factions [faction.hatikvah]
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 ModuleDB::FindFactoryGenerator(): unable to find Module generator for ware Spaceweed, tags null, race null, factions [faction.hatikvah]

Before I tried this code and it gave the same error:

Code: Select all

        <product id="hat_spaceweed" ware="spaceweed" owner="hatikvah" type="factory">
            <quotas>
                <quota galaxy="8" />
            </quotas>
            <location class="galaxy" macro="xu_ep2_universe_macro" faction="[ownerless]" solitary="true" />
            <module>
                <select ware="spaceweed" race="teladi"/>
            </module>
        </product>

ApoxNM
Posts: 779
Joined: Wed, 5. Dec 18, 06:17
x4

Re: Station quota modding question

Post by ApoxNM » Sat, 6. Jan 24, 16:26

More errors I get after more tests:

Code: Select all

[=ERROR=] 0.00 [GodProductionEntry] God Entry ID: 'sca_spaceweed_02' station was not created for zone tempzone

[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in default context: FactoryGenerator: No Station generated using group/ref/macro null and Ware Spaceweed.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [GodProductionEntry] God Entry ID: 'sca_spaceweed_02' station was not created for zone tempzone

[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in default context: FactoryGenerator: No Station generated using group/ref/macro null and Ware Spaceweed.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [GodProductionEntry] God Entry ID: 'sca_spaceweed_02' station was not created for zone tempzone

[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in default context: FactoryGenerator: No Station generated using group/ref/macro null and Ware Spaceweed.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [GodProductionEntry] God Entry ID: 'sca_spaceweed_02' station was not created for zone zone002_cluster_12_sector001_macro

[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in default context: FactoryGenerator: No Station generated using group/ref/macro null and Ware Spaceweed.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 [GodProductionEntry] God Entry ID: 'sca_spaceweed_02' station was not created for zone tempzone

DeadAirRT
Posts: 1037
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Station quota modding question

Post by DeadAirRT » Sun, 7. Jan 24, 02:38

You have several errors so let me run through them.

1) anything you add in a mod to jobs or god, should have matchextension="false" in the location. The only exception is if you are specifically adding it for your own sectors.

2) Scaleplate do not own any sectors, so using

Code: Select all

faction="[hatikvah, scaleplate]" relation="self" comparison="ge"
is useless on the scaleplate side. It works for hatikvah because they actually own a sector.

3)

Code: Select all

[=ERROR=] 0.00 ModuleDB::FindFactoryGenerator(): unable to find Module generator for ware Spaceweed, tags null, race null, factions [faction.hatikvah]
This is because you are trying to use

Code: Select all

owner="hatikvah"
and

Code: Select all

<select ware="spaceweed" race="teladi"/>
. You need to actually be mindful of modules.xml and whether or not a faction even owns the blueprint for the module.

4) Do not use generic names for god entries. If you notice (feel free to look at my own code, just don't use my code and potentially create a conflict with my own mods), I use:

Code: Select all

  <add sel="/god/products">
    <product id="hat_spacefuel_da" ware="spacefuel" owner="hatikvah" type="factory">
      <quotas>
        <quota galaxy="8"/>
      </quotas>
      <location class="galaxy" macro="xu_ep2_universe_macro" faction="[hatikvah]" relation="self" comparison="exact" newzonechance="1.0" matchextension="false"/>
      <module>
        <select ware="spacefuel" race="argon" faction="hatikvah"/>
      </module>
    </product>
  </add>
I add _da to the ID because the likelyhood of someone else using my modding initials is lower than someone using hat_spaceweed_01.

5) To help you out, here is an example of how to add some scaleplate stations to sectors that are owned by people who do not want to kill scaleplate.

Code: Select all

<product id="sca_spaceweed_apoxnm" ware="spaceweed" owner="scaleplate" type="factory">
			<quotas>
				<quota galaxy="30" sector="4"/>
			</quotas>
			<location class="galaxy" macro="xu_ep2_universe_macro" faction="scaleplate" relation="enemy" comparison="gt" matchextension="false"/>
			<module>
				<select ware="spaceweed" race="teladi"/>
			</module>
		</product>
for hatikvah, you probably need to add a modules.xml entry since they do own the module in wares.xml. You can either diff and add them to prod_tel_spaceweed via

Code: Select all

<add sel="/modules/module[@id='prod_tel_spaceweed']/category"><extension faction="hatikvah"/></add>

ApoxNM
Posts: 779
Joined: Wed, 5. Dec 18, 06:17
x4

Re: Station quota modding question

Post by ApoxNM » Sun, 7. Jan 24, 06:39

DeadAirRT wrote:
Sun, 7. Jan 24, 02:38
You have several errors so let me run through them.

1) anything you add in a mod to jobs or god, should have matchextension="false" in the location. The only exception is if you are specifically adding it for your own sectors.

2) Scaleplate do not own any sectors, so using

Code: Select all

faction="[hatikvah, scaleplate]" relation="self" comparison="ge"
is useless on the scaleplate side. It works for hatikvah because they actually own a sector.

3)

Code: Select all

[=ERROR=] 0.00 ModuleDB::FindFactoryGenerator(): unable to find Module generator for ware Spaceweed, tags null, race null, factions [faction.hatikvah]
This is because you are trying to use

Code: Select all

owner="hatikvah"
and

Code: Select all

<select ware="spaceweed" race="teladi"/>
. You need to actually be mindful of modules.xml and whether or not a faction even owns the blueprint for the module.

4) Do not use generic names for god entries. If you notice (feel free to look at my own code, just don't use my code and potentially create a conflict with my own mods), I use:

Code: Select all

  <add sel="/god/products">
    <product id="hat_spacefuel_da" ware="spacefuel" owner="hatikvah" type="factory">
      <quotas>
        <quota galaxy="8"/>
      </quotas>
      <location class="galaxy" macro="xu_ep2_universe_macro" faction="[hatikvah]" relation="self" comparison="exact" newzonechance="1.0" matchextension="false"/>
      <module>
        <select ware="spacefuel" race="argon" faction="hatikvah"/>
      </module>
    </product>
  </add>
I add _da to the ID because the likelyhood of someone else using my modding initials is lower than someone using hat_spaceweed_01.

5) To help you out, here is an example of how to add some scaleplate stations to sectors that are owned by people who do not want to kill scaleplate.

Code: Select all

<product id="sca_spaceweed_apoxnm" ware="spaceweed" owner="scaleplate" type="factory">
			<quotas>
				<quota galaxy="30" sector="4"/>
			</quotas>
			<location class="galaxy" macro="xu_ep2_universe_macro" faction="scaleplate" relation="enemy" comparison="gt" matchextension="false"/>
			<module>
				<select ware="spaceweed" race="teladi"/>
			</module>
		</product>
for hatikvah, you probably need to add a modules.xml entry since they do own the module in wares.xml. You can either diff and add them to prod_tel_spaceweed via

Code: Select all

<add sel="/modules/module[@id='prod_tel_spaceweed']/category"><extension faction="hatikvah"/></add>
Hi DeadAirRT.

Thank you so much for this. I have been trying for hours to get it to work and could for the life of me not find the connection to the modules.xml.
It was driving me crazy.

I have one more question, if you don't mind.
I added this job for ARG region:

Code: Select all

<diff>
  <add sel="/jobs">
  <!-- ARGON FEDERATION -->
    <job id="scaleplate_smuggler_s_DA" name="{20204,10009}">
        <modifiers commandeerable="true"/>
        <orders>
            <order order="TradeRoutine" default="true">
                <param name="maxbuy" value="30"/>
                <param name="maxsell" value="30"/>
                <param name="usecover" value="true"/>
            </order>
        </orders>
        <category faction="scaleplate" tags="[trader]" size="ship_s"/>
        <quota galaxy="20"/>
        <location class="galaxy" macro="xu_ep2_universe_macro" faction="[argon, antigone, hatikvah]" relation="self" comparison="exact"/>
        <environment buildatshipyard="true" gate="true"/>
        <basket basket="spaceweed"/>
        <ship>
            <select faction="scaleplate" tags="[trader]" size="ship_s"/>
            <loadout>
                <level min="0" max="1.0"/>
            </loadout>
            <owner exact="scaleplate" overridenpc="true"/>
        </ship>
    </job>
  </add>
</diff>
It has not thrown any errors, so I think it should work.

Would that job be enough to have them trade spaceweed for all the sations? Or would I have to make further changes?
Do such trader jobs just trade with any stations, or are smugglers and SCA traders somehow limited to pirate bases and trade ports?

I did not get around to testing this part as I failed with the station generation.

DeadAirRT
Posts: 1037
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Station quota modding question

Post by DeadAirRT » Sun, 7. Jan 24, 15:50

That job should work assuming that the cover system isn't bugged in 6.2 but there are three things:

1) please don't have the id end with _DA

2) it has buildatshipyard="true" and gate="true". Usually gate is only used for spawning so I'm not sure whether it would build or spawn

3) anything you add to jobs or god should have matchextension="false" in location

ApoxNM
Posts: 779
Joined: Wed, 5. Dec 18, 06:17
x4

Re: Station quota modding question

Post by ApoxNM » Mon, 8. Jan 24, 06:23

DeadAirRT wrote:
Sun, 7. Jan 24, 15:50
That job should work assuming that the cover system isn't bugged in 6.2 but there are three things:

1) please don't have the id end with _DA

2) it has buildatshipyard="true" and gate="true". Usually gate is only used for spawning so I'm not sure whether it would build or spawn

3) anything you add to jobs or god should have matchextension="false" in location
Thank you! I have already changed the "DA", it was intended as "Drug Additions", but I get it and renamed it.

Out of curiosity, what does " matchextension="false" " stand and why do I need it?
And which other files need the extension matchextension="false" ?

DeadAirRT
Posts: 1037
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Station quota modding question

Post by DeadAirRT » Mon, 8. Jan 24, 15:46

Any entry you add in jobs and god need it, unless you also add sectors in that same mod and want your jobs to apply only to the matching sectors from your mod.

For example, any split vendetta xenon jobs without matchextension="false" will only ever appear in sectors added by split vendetta. They will not appear in vanilla, terran, or custom mod sectors.

Return to “X4: Foundations - Scripts and Modding”