[FIX][4.1 beta] UI breaks for custom components - modding issue after update - Fix in a future build.

This forum provides information on obtaining access to Public Beta versions of X4: Foundations allowing people running those versions to provide feedback on their experiences.

Moderator: DevNet Public Moderators

Post Reply
User avatar
Shuulo
Posts: 1431
Joined: Mon, 14. Apr 08, 17:03
x4

[FIX][4.1 beta] UI breaks for custom components - modding issue after update - Fix in a future build.

Post by Shuulo » Mon, 14. Jun 21, 22:48

Hi,
It seems that beta patch has broken menu_ship_configuration LUA for custom components with the following errors:

Code: Select all

[=ERROR=] 7906.90 Error while executing onEvent script for event: onDropDownConfirmed.
Errormessage: P:\SVN\temp\menu_ship_configuration.lua:2799: attempt to compare nil with number

[=ERROR=] 7906.90 Error while executing onEvent script for event: onHide.
Errormessage: P:\SVN\temp\menu_ship_configuration.lua:2799: attempt to compare nil with number
Unfortunately thats all I get from the debug on this issue, there is no messages what exactly is broken and this makes it very hard to narrow down. At first I thought that connection tag can be the cause, but I ahve other shields that work fine with the similar tags (tags="shield xxx")

I currently narrowed it down to custom shield that worked fine in 4.0, but it doesnt now, here is the component entry for it

Code: Select all

<?xml version="1.0"?>
<components>
	<component name="shield_r2_s_standard_01_mk1" class="shieldgenerator">
		<source geometry="extensions\starwarsmod_m1\assets\props\SurfaceElements\shield_r2_s_standard_01_mk1_data"/>
		<layers>
			<layer>
				<waypoints/>
				<lights/>
			</layer>
		</layers>
		<connections>
			<connection name="container" tags="contents" value="0"/>
			<connection name="position" tags="position" value="1"/>
			<connection name="Connection02" tags="part animation nocollision detail_xl forceoutline  ">
				<offset>
					<position x="0" y="0" z="0"/>
				</offset>
				<animations>
					<animation name="loop" start="1" end="1000"/>
				</animations>
				<parts>
					<part name="detail_xl_anim">
						<lods>
							<lod index="0">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexturer2head"/>
								</materials>
							</lod>
						</lods>
						<size>
							<max x="0.3290309" y="0.967819E-02" z="0.3290309"/>
							<center x="2.328306E-10" y="-4.267484E-02" z="0"/>
						</size>
						<size_raw>
							<max x="0.3271706" y="0.967818E-02" z="0.3290308"/>
							<center x="2.328306E-10" y="-4.267484E-02" z="-1.192093E-07"/>
						</size_raw>
					</part>
				</parts>
			</connection>
			<connection name="Connection03" tags="part nocollision forceoutline detail_xl  ">
				<offset>
					<position x="0" y="0" z="0"/>
				</offset>
				<parts>
					<part name="part_decals">
						<lods>
							<lod index="0">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexturer2head"/>
								</materials>
							</lod>
						</lods>
						<size>
							<max x="0.4142256" y="0.1245926" z="0.43413"/>
							<center x="-2.980232E-08" y="0" z="-0.1414686"/>
						</size>
					</part>
				</parts>
			</connection>
			<connection name="Connection04" tags="part platformcollision forceoutline  ">
				<offset>
					<position x="0" y="0" z="0"/>
				</offset>
				<parts>
					<part name="part_main">
						<lods>
							<lod index="0">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexturer2body"/>
								</materials>
							</lod>
							<lod index="1">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexture2body"/>
								</materials>
							</lod>
							<lod index="2">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexture2body"/>
								</materials>
							</lod>
							<lod index="3">
								<materials>
									<material id="1" ref="generic.generic_p1_hulltexture2body"/>
								</materials>
							</lod>
						</lods>
						<size>
							<max x="0.4358274" y="0.2855501" z="0.488354"/>
							<center x="0" y="0.2853922" z="1.056111E-02"/>
						</size>
					</part>
				</parts>
			</connection>
			<connection name="Connection01" tags="shield astromech">
				<offset/>
			</connection>
		</connections>
	</component>
</components>
One of macros that uses it:

Code: Select all

<macros>
<macro name="shield_s_r2astro_macro" class="shieldgenerator">
<component ref="shield_r2_s_standard_01_mk1" />
<properties>
<identification name="{999840, 301510}" basename="{999840, 301520}" shortname="{999840, 301520}" description="{999840, 301530}"/>
<recharge max="450" rate="25" delay="0" /> 
<effects>        
<explosion ref="none" />        
<sefx_damage_low ref="none" />        
<sefx_damage_medium ref="none" />        
<sefx_damage_high ref="none" />        
<sefx_shield ref="none" />
</effects>

<hull integrated="1" />
</properties>
</macro>
</macros>
and connection in the SHIP component that should be compatible with that shield, note the tags match and it works fine in 4.0:

Code: Select all

			<connection name="con_shield_03" tags="shield astromech ">
				<offset>
					<position x="0" y="1.673" z="-2.14735"/>
					<quaternion qx="-0" qy="-0.7071065" qz="-0" qw="-0.707107"/>
				</offset>
			</connection>

User avatar
Shuulo
Posts: 1431
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update

Post by Shuulo » Wed, 16. Jun 21, 13:20

Small update on this one, it seems to break ALL mods with custom shield components (that have tags and/or connection names that differ from vanilla), so its really CRITICAL thing to fix.

Issue is, its totally unclear from the debug what is broken, all I get is this:

Code: Select all

[=ERROR=] 69.04 Error while executing onEvent script for event: onDropDownConfirmed.
Errormessage: P:\SVN\temp\menu_ship_configuration.lua:2799: attempt to compare nil with number
[General] 69.04 ======================================
[General] 71.92 ======================================
[=ERROR=] 71.92 Error while executing onEvent script for event: onHide.
Errormessage: P:\SVN\temp\menu_ship_configuration.lua:2799: attempt to compare nil with number

User avatar
Shuulo
Posts: 1431
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update

Post by Shuulo » Wed, 16. Jun 21, 13:28

It seems to be connected to this part of LUA code that, as i understand, tries to order equipment slots according to their sizes:

Code: Select all

						for slot, slotdata in ipairs(menu.slots[entry.mode]) do
							if not slotdata.isgroup then
								if (not curslotsizepriority) or (config.slotSizeOrder[slotdata.slotsize] < curslotsizepriority) then
									curslotsizepriority = config.slotSizeOrder[slotdata.slotsize]
									overrideSlot = slot
								end
							end
						end
But custom components in may mods do not have assigned size tag (small, medium) as this will give access for this slot to all components with this tag and should not happen.

It seems to be something similar that happened with 4.0 when it just went into beta, please check this thread from back then

florianlt
EGOSOFT
EGOSOFT
Posts: 1105
Joined: Mon, 22. Aug 11, 14:05
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update

Post by florianlt » Thu, 17. Jun 21, 08:58

Should be fixed in an upcoming build.

User avatar
Shuulo
Posts: 1431
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update

Post by Shuulo » Thu, 17. Jun 21, 17:31

florianlt wrote:
Thu, 17. Jun 21, 08:58
Should be fixed in an upcoming build.
This is very appreciated :)
Thank you

NightmareNight91
Posts: 263
Joined: Sun, 7. Feb 16, 18:28
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update - Fix in a future build.

Post by NightmareNight91 » Fri, 18. Jun 21, 13:46

Thank boso lol, ive been trudging on in my VRO game with no ability to obtain S or M ships, i have to buy sats with a L ship and transfer them to smaller ships lol.

Scoob
Posts: 8198
Joined: Thu, 27. Feb 03, 23:28
x4

Re: [4.1 beta] UI breaks for custom components - modding issue after update - Fix in a future build.

Post by Scoob » Thu, 24. Jun 21, 18:26

Hi,

I didn't see it in the update notes - though I did just skim them on a small screen - but the issue appears to be fixed. I just ordered a Nemesis to re-equip at a Wharf and it's working ok.

Thanks for sorting this ES.

Scoob.

Post Reply

Return to “X4: Foundations - Public Beta Feedback”