UI modding - support thread

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

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

stefanEgo
Posts: 545
Joined: Thu, 11. Apr 13, 14:12
x4

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

FantasyWarrior
Posts: 29
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: 141
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: 72
Joined: Fri, 24. Jul 15, 17:47
x4

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: 255
Joined: Wed, 26. Jan 05, 17: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
Posts: 545
Joined: Thu, 11. Apr 13, 14:12
x4

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

Ovni
Posts: 141
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: 255
Joined: Wed, 26. Jan 05, 17: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
Posts: 545
Joined: Thu, 11. Apr 13, 14:12
x4

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

User avatar
eliseeff
Posts: 255
Joined: Wed, 26. Jan 05, 17: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.

stefanEgo
Posts: 545
Joined: Thu, 11. Apr 13, 14:12
x4

Post by stefanEgo » Fri, 25. May 18, 12:39

@eliseeff: That's not quite correct. There's no performance difference expected in your case regardless of whether you use bytecode or plain Lua scripts. Only the initial load time of your script would be impacted in that case but we'd be talking here a range of milliseconds which should hardly be relevant for your use case, should it?
To profile your script and determine the main performance relevant sections, you can also make use of DebugProfileStart() and DebugProfileStop().
DebugProfileStop() returns the time in ms since DebugProfileStart() was called (I took the chance to update the documentation for these function shere: https://www.egosoft.com:8444/confluence ... n+overview ).
Stefan Hett

FRSTR
Posts: 2
Joined: Wed, 19. Dec 18, 14:20

Re: UI modding - support thread

Post by FRSTR » Wed, 19. Dec 18, 14:42

Hi @stefanEgo
I have a question on UI modding, if you don't mind and still here.

I've been updating XPL/Lua files as discussed earlier in this thread to resize the menus, and it worked pretty well for Options Menu and for Main Menu in the left sidebar (I know tha modifying those files directly is not ideal, but al least it works).
Though the issue is that I cannot find the config parameters for rendering text in communication dialog (for example, when in cockpit and use F key for a ship or station and there is info or docking options around the cursor) and text for objects flying around, e.g. the distance to this object displayed inside a rectangle.
I actually managed to resize some of the icons next to those texts, but not the texts itself.

Could you point where to find those configs?

FRSTR
Posts: 2
Joined: Wed, 19. Dec 18, 14:20

Re: UI modding - support thread

Post by FRSTR » Wed, 19. Dec 18, 16:35

Holy moly! When I thought I looked everywhere I could (though I'm new to modding and X rebirth) I actually was able just increase the font size of the text element with one new line in menu activation function. The forum must have magic aura.

gamesemailvp
Posts: 18
Joined: Tue, 5. Feb 19, 23:11

Re: UI modding - support thread

Post by gamesemailvp » Thu, 7. Feb 19, 16:57

Hello!
Would you help me create a mod?
I want to add the order of patrol, minimum ability of a star, but I do not give ..
What have I done wrong???

<?xml version="1.0" encoding="iso-8859-1" ?>
<diff>
<add sel="//aiscript/order/skill/">
<skill min="20"/>
</add>
</diff>

AR_Starfighter

Re: UI modding - support thread

Post by AR_Starfighter » Mon, 10. Jun 19, 06:12

Hello all. I have advanced programming skills and been reading up on UI scripting. I'm overwhelmed by the complexity of the code and need help.

I've already done a mod to 'combat rank bailout'. Now, the updates to points don't clutter up the logbook. It's just a window that pops up 20% of the time. The combat updates are now a percent. Not bad for a first timer. :)

I need someone to walk me through how to do this mod.

When you contact traders in the buy sell menu, you have press the change key then set the amount. It's usually buy all or sell all. It's get repetitive and annoying.

How do I add a 'buy all' and 'sell all' button One on either side of the 'change' button?

Thanks.

Fisken
Posts: 11
Joined: Mon, 24. Jul 17, 14:50

Re: UI modding - support thread

Post by Fisken » Tue, 23. Jul 19, 13:00

Hey

I have a question for you people who can mod out there, my basic knowledge of computing is roughly in the range of knowing how to turn on the computer and play the games on it, now i would like to have a mod made on topp of that, the mod I would like to have help with or find out if someone is willing to help me with is as following:

I would like it to be possible to build from one of the existing dual cargo ships in the Devrise dockyard but with the possibility to chose what kind of cargo they would be able to carry, say there is a step added in the built chain before you chose turrets and shelds where you chose what cargo the ship should carry.

Is this even possible to do, and by a complet nob?
Or maybe someone could even do it for me? :oops:

Fredrik

xxlotosxx
Posts: 1
Joined: Sat, 16. Oct 21, 18:14

Re: UI modding - support thread

Post by xxlotosxx » Sat, 16. Oct 21, 19:24

how can I remove these circles and leave only arrows like X4 https://imgur.com/p9fuplI

Post Reply

Return to “X Rebirth - Scripts and Modding”