Changing the HUD; what am i doing wrong?

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

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

stevierof
Posts: 3
Joined: Thu, 13. Dec 18, 19:39
x4

Changing the HUD; what am i doing wrong?

Post by stevierof »

Hi,

I am trying to get rid of the inward-rotating HUD elements, as to me they seem to be out of place on a resolution of 3440x1440.
So, i tried to figure out if i could make the HUD panels flat.

As my first attempt in modding any x-game the following was done.
I figured out that assets\ui\ui_screen_positions.xml should contain the elements.

For testing i took the con_messageticker element. Which is the left panel on your HUD.

So i figured to adust the quaternion & position like so:

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <replace sel="/components/component/connections/connection[@name='con_messageticker']/offset">
		<position x="-0.1983831" y="-0.1410382" z="0.3524311"/>
		<quaternion qx="-0.1096581" qy="0.2646199" qz="-3.486944E-02" qw="-0.957463"/>
  </replace>      
</diff>
The above are the original position and quaternion. However, when i run this, the element is no longer rendered.
The debuglog is telling me that the 'con_messageticker' is not found anymore.

Am i doing something wrong?
Testing seems so slow as i need to shutdown and restart the game to see any changes. I've tried using \reloadui but that doesn't seem to work for reloading the extension or something.


Thanks in advance,
stevie
User avatar
nonnex
Posts: 366
Joined: Wed, 28. Aug 13, 12:42
x4

Re: Changing the HUD; what am i doing wrong?

Post by nonnex »

are there additional debug information?
Maybe your Xml diff is not correct.

may it be that it is not "@name" but "@id" ?

- <replace sel="/components/component/connections/connection[@name='con_messageticker']/offset">
+ <replace sel="/components/component/connections/connection[@id='con_messageticker']/offset">
stevierof
Posts: 3
Joined: Thu, 13. Dec 18, 19:39
x4

Re: Changing the HUD; what am i doing wrong?

Post by stevierof »

Hi,

The selector seems to work appropriate:

The following snippet comes from the original xml:

Code: Select all

<connection name="con_messageticker" tags="uianchor_messageticker">
	<offset>
		<position x="-0.1983831" y="-0.1410382" z="0.3524311"/>
		<quaternion qx="-0.1096581" qy="0.2646199" qz="-3.486944E-02" qw="-0.957463"/>
	</offset>
</connection>
There are no other error being logged about this. I find it strange that as soon as I add the diff the panel element is removed in game.
User avatar
MegaJohnny
Posts: 2239
Joined: Wed, 4. Jun 08, 22:30
x4

Re: Changing the HUD; what am i doing wrong?

Post by MegaJohnny »

I think the XPath in your diff is probably fine - but bear in mind you're replacing the offset element itself, and not just the elements inside it. See if this gives you any luck:

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <replace sel="/components/component/connections/connection[@name='con_messageticker']/offset">
        <offset>
            <position x="-0.1983831" y="-0.1410382" z="0.3524311"/>
            <quaternion qx="-0.1096581" qy="0.2646199" qz="-3.486944E-02" qw="-0.957463"/>
        </offset>
  </replace>      
</diff>
stevierof
Posts: 3
Joined: Thu, 13. Dec 18, 19:39
x4

Re: Changing the HUD; what am i doing wrong?

Post by stevierof »

MegaJohnny wrote: Thu, 20. Dec 18, 10:51 I think the XPath in your diff is probably fine - but bear in mind you're replacing the offset element itself, and not just the elements inside it. See if this gives you any luck:
Perfect! That did it.
I was figuring that xpath selected the element!

Image

Really happy!
Now off to see if i can add some padding :)

stevie
WampaSauce
Posts: 2
Joined: Fri, 28. Dec 18, 15:26
x4

Re: Changing the HUD; what am i doing wrong?

Post by WampaSauce »

stevierof would you share how you get it to work? I'm playing around with similar things and it would help a lot to see a working example.
FlynTie
Posts: 36
Joined: Wed, 12. Dec 18, 01:42

Re: Changing the HUD; what am i doing wrong?

Post by FlynTie »

WampaSauce wrote: Wed, 2. Jan 19, 16:53 stevierof would you share how you get it to work? I'm playing around with similar things and it would help a lot to see a working example.
Since stevierof pointed me with this thread in the right direction i had a go with it.
https://www.nexusmods.com/x4foundations/mods/180

You can ignore the subst_01.cat it's just an image.

Return to “X4: Foundations - Scripts and Modding”