[HELP] Surface Objects not showing in Building Menu

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

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

JasonX2000
Posts: 208
Joined: Thu, 2. Oct 14, 15:04
x4

[HELP] Surface Objects not showing in Building Menu

Post by JasonX2000 »

Hello,

i have a mod, where you can build your own K and I Ships and Surface Parts of Xenon on all other Ships and also
Surface Parts from all factions on Xenon Ships.

The mod worked finde pre 5.0

But since 5.0 neither are the parts from the factions showing up for building on a Xenon Capital nor can i build
Surface Parts on other Capital ships.

Also for S Ships, the Lasers from the xenon are not showing up in the building list.
I checked wares, baskets, waregroups,components and macron indexes the macros themself and cannot find any clue what changed with 5.0 to get my mod to work.

I made extra wares for the player usable xenon parts, i made a research tree to unlock the blueprints. It says, i did unlock if i
research the blueprints, but they are not showing up.

Maybe someone has a clue where i should also check, i put hours in checking and tried some fixes without any solution.

thats how my wares are looking like on example xenon s laser:

Code: Select all

<diff>
	<add sel="/wares">
		<!-- ######################################## Weapons ############################################## -->
		<!-- Xenon S Laser -->
		<ware id="weapon_xen_s_laser_01_mk1_jx" name="{20105,1004}" description="{20105,1002}" group="weapons" transport="equipment" volume="1" tags="equipment weapon">
			<price min="778" average="864" max="950"/>
			<production time="4" amount="1" method="default" name="{20206,101}">
				<primary>
					<ware ware="energycells" amount="5"/>
					<ware ware="ore" amount="2"/>
					<ware ware="nividium" amount="20"/>
					<ware ware="weaponcomponents" amount="5"/>
				</primary>
				<research>
					<ware ware="res_highenergyweapons"/>
				</research>
			</production>
			<component ref="weapon_xen_s_laser_01_mk1_jx_macro" amount="1"/>
			<restriction licence="generaluseequipment"/>
			<use threshold="0"/>
			<owner faction="civilian"/>
		</ware>
		<ware ... 
		
and thats the macro i build for the s lasers:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<macros>
  <macro name="weapon_xen_s_laser_01_mk1_jx_macro" class="weapon">
    <component ref="weapon_xen_s_laser_01_mk1_jx" />
    <properties>
      <identification name="{20105,1414}" basename="{20105,1411}" shortname="{20105,1415}" makerrace="xenon" description="{20105,1412}" mk="1" />
      <bullet class="bullet_xen_s_laser_01_mk1_macro" />
      <heat overheat="10000" cooldelay="1.13" coolrate="2000" reenable="9500" />
      <rotationspeed max="101.4" />
      <rotationacceleration max="50.7" />
      <reload />
      <hull integrated="1" />
    </properties>
  </macro>
</macros>
Up until 5.0 it was enough to make it apear in the building list.

macro.xml and components.xml

Code: Select all

macros.xml:
<diff>
    <add sel="/index">
		<entry name="weapon_xen_s_laser_01_mk1_jx_macro" value="extensions\JX_Xenon_Blueprints_SA\assets\props\weaponsystems\standard\macros\weapon_xen_s_laser_01_mk1_jx_macro" />
		...
    </add>
</diff>

components.xml
<diff>
    <add sel="/index">
		<entry name="weapon_xen_s_laser_01_mk1_jx" value="extensions\jx_xenon_blueprints_sa\assets\props\WeaponSystems\standard\weapon_xen_s_laser_01_mk1_jx"/>
		...
    </add>
</diff>
Thank you in advance!
Jason
Juan Javier Amador Salina
Posts: 26
Joined: Tue, 29. May 07, 06:14
x4

Re: [HELP] Surface Objects not showing in Building Menu

Post by Juan Javier Amador Salina »

a little bit late but have you double checked your tags????

i yesterday was modding some xenon ships and got into this problem and noticed something odd with the tags defined in the ship macros vs the turret/weapon definition XML so with that in mind i looked at post regarding tags and found this:

viewtopic.php?p=5253466#p5253466

TBH i think Egosoft should write a good tutorial on how tags work cause there is a little to no details on this, there is a an article on the wiki listing some tags and what they are using them for but is clearly outdated and there are obviosuly certain logic around their implementation that is documented nowhere.

For example that post i just share explains that in order for a weapon to be compatible with a weapon slot in a given ship, all the tags of the weapon must be covered by the tags listed by the weapon slot on the ship with the exception of the "component" tag which is ignored by this logic (which implies there are additional logical rules not documented about how the tags work)
Rothank
XWiki Moderator
XWiki Moderator
Posts: 93
Joined: Mon, 11. Aug 14, 22:48
x4

Re: [HELP] Surface Objects not showing in Building Menu

Post by Rothank »

Juan Javier Amador Salina wrote: Tue, 26. Nov 24, 01:46 For example that post i just share explains that in order for a weapon to be compatible with a weapon slot in a given ship, all the tags of the weapon must be covered by the tags listed by the weapon slot on the ship with the exception of the "component" tag which is ignored by this logic (which implies there are additional logical rules not documented about how the tags work)
Tags are really, really simple if you pay close attention to them.
Tags on the component are a "requirement", while tags on the ship are "compatible".
Example - if a turret has:

Code: Select all

component turret large missile
then the ship-side connection needs to have at minimum

Code: Select all

turret large missile


It can have more in order to allow additional compatibilities (like some TER S weapons being faction-locked to only Terran ships through the use of "highpower" tag) example:
TER-only S weapon:

Code: Select all

component weapon small highpower
TER S ship:

Code: Select all

weapon small platformcollision standard highpower missile
You'll notice the ship has both "highpower" and "standard", making it compatible with both TER-unique and cross-compatible weapons (as well as missile launchers).

Exceptions:
Component-only exceptions:
"component" - used to indicate the connection which acts as a "mount point" of the surface object, which is why it is not needed on the ship's end.

Ship-only exceptions:
"platformcollision" is only on the ship end, because it is physics related and irrelevant for the weapon itself. NOT having it won't cause any issues with the weapon itself, it'll just miss the collisions when landed at a pad.
"symmetry" tags - too much to write, but it is explained in great detail in the Wiki article
Image Image
Image
Juan Javier Amador Salina
Posts: 26
Joined: Tue, 29. May 07, 06:14
x4

Re: [HELP] Surface Objects not showing in Building Menu

Post by Juan Javier Amador Salina »

Rothank wrote: Tue, 26. Nov 24, 01:56
Juan Javier Amador Salina wrote: Tue, 26. Nov 24, 01:46 For example that post i just share explains that in order for a weapon to be compatible with a weapon slot in a given ship, all the tags of the weapon must be covered by the tags listed by the weapon slot on the ship with the exception of the "component" tag which is ignored by this logic (which implies there are additional logical rules not documented about how the tags work)
Tags are really, really simple if you pay close attention to them.
Tags on the component are a "requirement", while tags on the ship are "compatible".
Hey Rothank thanks for your reply, but im afraid I came across evidence that there is something else under the hood that is not properly documented, and for I that refer to evidence B...... as in XENON B, (also known as "ship_xen_m_corvette_01")

This ship has 4 weapon slots with the tags COMBAT, MEDIUM, MISSILE, WEAPON and XENON (obviously im ignoring the reserved tags)

Code: Select all

<connection name="con_weapon_01" tags="combat medium missile weapon xenon symmetry symmetry_left symmetry_1 ">
<offset>
<position x="-29.48705" y="-0.4538212" z="-11.1086"/>
</offset>
</connection>
<connection name="con_weapon_02" tags="combat medium missile weapon xenon symmetry symmetry_left symmetry_2 ">
<offset>
<position x="-24.95523" y="-0.4538212" z="-11.1086"/>
</offset>
</connection>
<connection name="con_weapon_03" tags="combat medium missile weapon xenon symmetry symmetry_right symmetry_2 ">
<offset>
<position x="25.06409" y="-0.4538212" z="-11.1086"/>
</offset>
</connection>
<connection name="con_weapon_04" tags="combat medium missile weapon xenon symmetry symmetry_right symmetry_1 ">
<offset>
<position x="29.5959" y="-0.4538212" z="-11.1086"/>
</offset>
</connection>
meanwhile the xenon M plasma beam (weapon_xen_m_beam_01_mk1) has the tags COMBAT, MEDIUM WEAPON and XENON

Code: Select all

<connection name="con_weapon_01" tags="combat component medium weapon xenon "/>
so far it all matches with the explanation provided however what happens if we for example we try to make the xenon B capable of equipping highpower weapons?.

based on the rules listed all we need to do is to make sure the tags used in the M highpower weapons like the meson stream Mk2 listed below (weapon_ter_m_beam_01_mk1):

Code: Select all

<connection name="WeaponCon_01" tags="component weapon medium highpower "> 
are covered by the Q's weapon slots:

Code: Select all

<replace sel="/components/component/connections/connection[@name='con_weapon_01']/@tags">combat medium missile weapon highpower xenon symmetry symmetry_left symmetry_1 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_02']/@tags">combat medium missile weapon highpower xenon symmetry symmetry_left symmetry_2 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_03']/@tags">combat medium missile weapon highpower xenon symmetry symmetry_right symmetry_2 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_04']/@tags">combat medium missile weapon highpower xenon symmetry symmetry_right symmetry_1 </replace>

however the only thing one achieves with that code is to make the Q incompatible with any weapon at all and yet if we follow the same approach on the Xenon F (ship_xen_s_heavyfighter_01):

Code: Select all

<diff>
<replace sel="/components/component/connections/connection[@name='con_weapon_01']/@tags">combat platformcollision small highpower weapon xenon symmetry symmetry_left symmetry_1 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_02']/@tags">combat platformcollision small highpower weapon xenon symmetry symmetry_right symmetry_2 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_03']/@tags">combat platformcollision small highpower weapon xenon symmetry symmetry_right symmetry_1 </replace>
<replace sel="/components/component/connections/connection[@name='con_weapon_04']/@tags">combat platformcollision small highpower weapon xenon symmetry symmetry_right symmetry_2 </replace>
</diff>
it works like a charm!!!!!

so why the rules work with F but not with B?
im pretty sure there is something there either hardcoded or not properly documented that is messing this logic (that or im getting blind like a mole and im missing something really bad in those lines of code)

(edited to remove unnecessary tech related quotes and minor grammar fixes)

Return to “X4: Foundations - Scripts and Modding”