UI modding - support thread

The place to discuss scripting and game modifications for X Rebirth.

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

FantasyWarrior
Posts: 27
Joined: Sun, 24. Jul 16, 18:43

Post by FantasyWarrior » Mon, 25. Jul 16, 08:55

OMG it work !!! :o

Thanks a lot :D


Well, this game is interesting and elitist about modding and of course i like it, i return back soon...
I have a lot of work with the HUD ^^

FantasyWarrior
Posts: 27
Joined: Sun, 24. Jul 16, 18:43

Post by FantasyWarrior » Fri, 5. Aug 16, 00:55

Please, it is possible to modify a material like "cockpit_eventmonitor" (i would a transparent effect for the radar) or it is hard coded ? :l

And i 've tried to change the shield icon too, it work but the bars are deactivated...

Maybe the same ui script for cockpit_eventmonitor / shield icon, if i place a patch with new textures, these elements are broken...


edit, maybe it's in a patch...

stefanEgo
EGOSOFT
EGOSOFT
Posts: 453
Joined: Thu, 11. Apr 13, 14:12
xr

Post by stefanEgo » Mon, 8. Aug 16, 17:43

Modding the eventmonitor and/or ship status panel is unsupported, unfortunately.

That said, as a workaround you could try making use of substitution catalog files to replace the corresponding textures/scripts (the Lua scripts can be replaced by copying the *.lua file to *.xpl). The downside would be that for each version update, you'd have to provide an update for your mod, since these scripts could be changed in a patch release. Also be aware that this is a completely unsupported process which might be broken by any following update!

The eventmonitor panel is more complicated than you might expect. There is not just one material involved but rather different layers/materials. One material is the cockpit_eventmonitor (and for another cockpit the cockpit_eventmonitor_cockpit_b). You can try tweaking its parameters to see if you can get somewhere for your case.

With regards to the issue with replacing the shield icons: Take a look at the debug log in game. I'd expect you see some error output related to the broken shield/hull bars there.
Stefan Hett, UI Engine Architect

FantasyWarrior
Posts: 27
Joined: Sun, 24. Jul 16, 18:43

Post by FantasyWarrior » Sun, 14. Aug 16, 18:15

Thank you !

I have discovered everything you said by myself ^^ lua file, ect...

I was try to make a patch for Cockpit Shipstatus.lua, maybe something like

Code: Select all

<diff>
 < replace>
   </replace>
</diff>

And...a lot of other things , folders...


Well Actualy, I LOVE this game :!:

Of course, the modding is not simple :l i've just made :
80% of the textures hd, sounds, musics, reworked cockpit_b, and i have a lot of other mods.


0 % of B-U-G !!!!!

Now, i just need to put the new shield icon, add a glass for cockpit b, if i can rework the cockpit b a little more...

:!: For info : no crash with windows 7/ 64 bits 8G RAM and 80% of new textures 2048 -> 4096, and the same performances !



edit: my version, with the holographic hud ^^ (not finished).


http://tw.greywool.com/i/D_9R3.jpg
http://tw.greywool.com/i/F5kI2.jpg
http://tw.greywool.com/i/8yEgm.jpg
http://tw.greywool.com/i/Um-hX.jpg
http://tw.greywool.com/i/V-eGl.jpg


Edit: removed img-tags from oversized images. Please check the forum rules for the allowed sizes. X2-Illumintus

Edit :

OK !

Finaly, i just need to add a glass for cockpit_b !

I think the best solution is replace a material/element by a new one, but i think it's not so simple :l

For ex the "blue screen" (actualy deactivated) -> become the big glass from cocpit_1...

assets/units/player/units_player_cockpit_b.xml
(Blue_screen)

Code: Select all

<connection name="Connection08" tags="part iklink animation nocollision  " parent="anim_blocker_01">
<!--ect...-->
							<materials>
									<material id="1" ref="arcp1.cp1_fight_window_bluescreen"/>
								</materials>
<!--ect...-->
And by a patch...

Code: Select all

	 <replace sel="/components/component[@name='units_player_cockpit_b']/connections/connection[@name='Connection08']/offset/parts/materials">
								<materials>
									<material id="1" ref="arcp1.cp1_window"/>
								</materials>
	 </replace>		

Not work actualy...

KlausM
EGOSOFT
EGOSOFT
Posts: 571
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by KlausM » Tue, 16. Aug 16, 15:01

Hi FantasyWarrior,

it doesn't work because the XPath in the sel attribute isn't correct. This is the original connection element:

Code: Select all

<connection name="Connection08" tags="part iklink animation nocollision  " parent="anim_blocker_01">
	[...]
	<parts>
		<part name="anim_blocker_01_blue">
			<lods>
				<lod index="0">
					<materials>
						<material id="1" ref="arcp1.cp1_fight_window_bluescreen"/>
					</materials>
				</lod>
			</lods>
			[...]
		</part>
	</parts>
</connection>
So the XPath should be:

Code: Select all

sel="/components/component[@name='units_player_cockpit_b']/connections/connection[@name='Connection08']/parts/part[@name='anim_blocker_01_blue']/lods/lod/materials"

stefanEgo
EGOSOFT
EGOSOFT
Posts: 453
Joined: Thu, 11. Apr 13, 14:12
xr

Post by stefanEgo » Tue, 16. Aug 16, 15:28

FantasyWarrior wrote:Thank you !

I have discovered everything you said by myself ^^ lua file, ect...

I was try to make a patch for Cockpit Shipstatus.lua, maybe something like

Code: Select all

<diff>
 < replace>
   </replace>
</diff>

And...a lot of other things , folders...
As stated above, modifying these Lua files is unsupported atm. The workaround given above should do the trick atm though, but isn't guaranteed to keep working in the future (aka: replace the whole file (and the xpl-variant) with your own version using the substitution catalog files).
Stefan Hett, UI Engine Architect

FantasyWarrior
Posts: 27
Joined: Sun, 24. Jul 16, 18:43

Post by FantasyWarrior » Fri, 19. Aug 16, 09:34

Thank you !!!

And thank you so much for this A---W---E---S---O---M---E GAME :twisted:

Ovni
Posts: 111
Joined: Sun, 6. May 12, 23:42
xr

Post by Ovni » Mon, 29. Aug 16, 09:30

I was wondering whether modding the station icons to be visible through the station's geometry would be possible (while I'm at it I'm probably gonna set different icons for scanned/unscanned components instead of the greyed out and full versions)?

If it is, any pointers would be appreciated. Otherwise, consider this a feature request for a game option or at least mod possibility next update :twisted: .

Andy_MB
Posts: 70
Joined: Fri, 24. Jul 15, 17:47
xr

Post by Andy_MB » Wed, 31. Aug 16, 09:43

@stefanEgo. Hi! I read about that change / add hotkeys is imposible. (gameoptions.lua - cant be changed)
If I can't add hotkeys, maybe there is any possibility to track pressing or releasing a button?
For example:
I want to track press "Shift + J" for my MOD "Emergency jump for player ship"
Can I add to librarys/contexts.xml and inputmap.xml

Code: Select all

<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <add sel="libraries/inputmap/action[@id='INPUT_ACTION_OPEN_PLAYER_INVENTORY_MENU']" pos="after">
    <action id="INPUT_ACTION_OPEN_PLAYER_AMB_JUMPDRIVE" source="INPUT_SOURCE_KEYBOARD" code="INPUT_KEYCODE_J_SHIFT" sinceversion="52" />
  </add>
  
  <add sel="libraries/inputcontexts/context[@id='INPUT_CONTEXT_MENUS']/action[@id='INPUT_ACTION_OPEN_ZONE_MAP']" pos="before">
    <action id="INPUT_ACTION_OPEN_PLAYER_AMB_JUMPDRIVE"/>
  </add>
</diff>
and how to track event pressing Shift+J? (from *.xml or *.lua file)

Code: Select all

if action == "INPUT_ACTION_OPEN_PLAYER_AMB_JUMPDRIVE" then
_____________

User avatar
eliseeff
Posts: 245
Joined: Wed, 26. Jan 05, 18:17
x4

Post by eliseeff » Wed, 23. May 18, 06:39

Andy_MB wrote:Can I add ...
You can't add INPUT_ACTION, because list of INPUT_ACTIONs is hard-coded in the exe-file.

stefanEgo
EGOSOFT
EGOSOFT
Posts: 453
Joined: Thu, 11. Apr 13, 14:12
xr

Post by stefanEgo » Wed, 23. May 18, 15:43

For some reason I completely missed the last two questions back from 2016.

Since it'd be better to answer a question late than never, here we go:

@Ovni: The icons used for the target elements are referenced in libraries/icons.xml (f.e. see sections mission offer icons). You'd be able to patch these entries in a mod and direct that to replacement textures.

@Andy_MB: eliseeff is right. The ability to modify actions is unfortunately quite restricted. You can't add new actions/states. You'd be able to hack around the limitations to some degree however. It'll be quite tricky though to manage this. The contexts.xml file defines which input actions/states/ranges are active in which context. If you find a suitable context for your need you'd be able too hook into the corresponding action by defining it in the addon's bindings.xml file. The corresponding feature request is on record here: https://www.egosoft.com:8443/jira/browse/XRUIMOD-20

Unfortunately we didn't manage to get this in any previous release yet (at least I added your vote to the list now).
Stefan Hett, UI Engine Architect

Ovni
Posts: 111
Joined: Sun, 6. May 12, 23:42
xr

Post by Ovni » Wed, 23. May 18, 22:21

stefanEgo wrote: @Ovni: The icons used for the target elements are referenced in libraries/icons.xml (f.e. see sections mission offer icons). You'd be able to patch these entries in a mod and direct that to replacement textures.
Thanks. I figured that changing the icons wouldn't be complicated, but what about the seeing them through objects part? (Assuming the game doesn't do it at this point, haven't played in a while.)

User avatar
eliseeff
Posts: 245
Joined: Wed, 26. Jan 05, 18:17
x4

Post by eliseeff » Thu, 24. May 18, 02:30

stefanEgo wrote: If you find a suitable context for your need you'd be able too hook into the corresponding action by defining it in the addon's bindings.xml file. The corresponding feature request is on record here: https://www.egosoft.com:8443/jira/browse/XRUIMOD-20

Unfortunately we didn't manage to get this in any previous release yet (at least I added your vote to the list now).
Thanks! I am very interested in this issue too. I would very much like to add a hotkey for my "Mods Options" menu.

But we still have to do something with the impossibility of binding for custom addons.

Binding nodes is only written in the coreaddon.xsd file. In addon.xsd file there is none. And for custom addons, binding is ignored.

stefanEgo
EGOSOFT
EGOSOFT
Posts: 453
Joined: Thu, 11. Apr 13, 14:12
xr

Post by stefanEgo » Thu, 24. May 18, 13:34

@Ovni: The exact behavior of how/when/if target elements are obstructed by other geometry is quite a bit complex to explain in detail. In your case I'd get started by looking into the targetsystem.lua script where you'd be able to control/change the obstruction behavior of target elements. Unfortunately we didn't get to a point where modifying this script would be done in a from our side official supported way. You'd however be able to change it using the substitution catalog approach.

@eliseeff: You are right of course there. Recalling this was a last minute decision we had to take since we didn't get the integration/handling to the point where this would be usable by mods reliably. FWIW: I added you to the list of voters.
Stefan Hett, UI Engine Architect

User avatar
eliseeff
Posts: 245
Joined: Wed, 26. Jan 05, 18:17
x4

Post by eliseeff » Thu, 24. May 18, 15:26

stefanEgo wrote:@eliseeff: You are right of course there. Recalling this was a last minute decision we had to take since we didn't get the integration/handling to the point where this would be usable by mods reliably. FWIW: I added you to the list of voters.
Thank you so much!

Another "Wishlist": the ability to use bytecode and a utility to compile. I explain why: I have a desire to modify the Property menu by sorting stations by clusters and sectors (with expanding sections for them). However, with a sufficiently large number of ships and stations, the menu begins to noticeably slow down. This is caused by the specificity of this menu: multiple execution of functions, in particular - menu.addContainerRow, quite large in volume.

The possibility of using bytecode would speed up the work.

Post Reply

Return to “X Rebirth - Scripts and Modding”