UI modding - support thread

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

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

Phipsz
Posts: 335
Joined: Mon, 23. Apr 12, 23:56
x4

Post by Phipsz » Wed, 25. Feb 15, 00:00

maybe I'm just stupid, but how do I pack the files for workshop? I just don't get it...

User avatar
wysiwyg
Posts: 585
Joined: Thu, 26. Feb 04, 00:08
x4

Post by wysiwyg » Wed, 25. Feb 15, 00:02

Phipsz wrote:maybe I'm just stupid, but how do I pack the files for workshop? I just don't get it...
Having the same trouble here - I've just filed a bug report on the tracker.

Mod works fine unpacked, but when packed up the game can't see either the ui.xml file or any lua files.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Wed, 25. Feb 15, 00:13

Phipsz wrote:maybe I'm just stupid, but how do I pack the files for workshop? I just don't get it...
If it helps, your ui stuff for Multiassignment is packed in a subst_01.cat/dat again. When the files were packed in ext_01.cat/dat, the mod worked fine.

Phipsz
Posts: 335
Joined: Mon, 23. Apr 12, 23:56
x4

Post by Phipsz » Wed, 25. Feb 15, 00:17

@wysiwyg: phew, kind of glad I'm not the only one here... was almost going crazy. nice example btw :)

@w.evans: obviously isn't relevant atm, I had a different structure when the ui.xml was in the ext.cat/dat as that was before I ported to the official structure. I won't revert my mod to the old structure, as it will break. I'll wait with this new structure until it is fixed

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Wed, 25. Feb 15, 00:20

Ah, ok. Sorry, don't speak lua so didn't look in there.

User avatar
BigBANGtheory
Posts: 3168
Joined: Sun, 23. Oct 05, 12:13
x4

Post by BigBANGtheory » Wed, 25. Feb 15, 12:50

stefanEgo wrote: I suggest you just ask directly how to solve a certain use-case, if in doubt, and we'll see how this can be done. Especially, if there are cases where you managed to do something with version 3.20 and don't know how to do it with 3.50, please let us know directly.
I have a number of new UI related use cases so I appreciate any pointers from modders or Egosoft even if you believe it is not currently possible. To avoid swamping anyone I'll try to limit these to no more than 1 per month.

Tactical UI Use Case 1.0 (feb2015)
The goal here is for certain player interactions with the holomap (or a modified version of it) to be visible as a means to identify objects of interest and assist with the 3D nature of space being presented on a 2D plane/viewport/monitor.

The trigger would be the players use of the cursor in combination with the players physical controller keeping a key or button pressed in a 'drag action' commonly used in MS Windows applications. So when the player 'drags' the cursor within the holomap from a selected object the UI will draw common shapes around that object e.g. a line extending from the object to the current cursor position and a circle whose radius extends from the object to the current cursor position. You can see an example of this in my signature below...

Will basic Lua graphics commands/functions work in response to the players actions e.g. drawLine, drawArc, fillPolygon
Last edited by BigBANGtheory on Thu, 26. Feb 15, 11:59, edited 1 time in total.

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

Post by stefanEgo » Wed, 25. Feb 15, 14:35

@all: To let you know, we've just added documentation regarding the FFI/Lua interface and handling of universeIDs to the UI modding documentation thread here: http://forum.egosoft.com/viewtopic.php?t=377561
@wysiwyg: Nice work on documenting how you migrated the addon to 3.50b1. Note that the UI documentation thread is unlocked for any posts. Maybe you wanna post your description there too, since I think that several other modders will benefit from that.
@wysiwyg/Phipsz: Thanks for adding to the bugtracker --- it's already beeing checked out atm - http://www.egosoft.com:8282/jira/browse/XRUIMOD-10
@BigBANGtheory: You co
Last edited by stefanEgo on Wed, 25. Feb 15, 17:32, edited 1 time in total.
Stefan Hett

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

Post by stefanEgo » Wed, 25. Feb 15, 16:30

@wysiwyg/Phipsz: We've identified a bug in the engine which could have caused the problem you described. To be 100% certain, could u provide us with ur extension files to confirm the issue was also fixed? Best to attach it to the issue in the bugtracker. http://www.egosoft.com:8282/jira/browse/XRUIMOD-10
Stefan Hett

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

Post by stefanEgo » Thu, 26. Feb 15, 12:26

@wysiwyg/Phipsz: Just wanted to let you know that we just confirmed that the bugfix also solved the issue you have atm with the mt_enhanced_money_transfer mod. The fix should be in the next version.
Stefan Hett

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

Post by stefanEgo » Fri, 27. Feb 15, 15:14

Just to give you a heads-up of the latest change: Issues in the bugtracker will now also reflect if they are being worked on (showing: In progress).
We hope that this will also improve the information flow slightly for modders.
Stefan Hett

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

Post by stefanEgo » Fri, 27. Feb 15, 22:38

3.50 Beta 2 was just released and should fix the problem with distributing mods in the catalog files as well as several incompatibilities between FFI-IDs and LuaIDs.

Here's the list of UI modding issues fixed in 3.50 Beta 2: http://www.egosoft.com:8282/jira/issues ... ity%20DESC

Breaking changes in 3.50 Beta 2 - see http://forum.egosoft.com/viewtopic.php? ... 23#4498023
  • IsComponentValid() renamed to IsValidComponent()
Stefan Hett

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Sat, 28. Feb 15, 12:58

Hi Stefan, thanks for bringing us 3.5 beta 2. As promised before I tried a few things and I have to say I am quite happy with the new possibilites. Adding and removing objects from the menu is working out fine and having all the little helper functions which have been local before available makes things much more accessible compared to beta 1.

There is one improvement which I like to mention at the moment. It is not really a feature request but rather a suggestion for a general improvement of the code and I am aware that it is not that easy to change without putting in some effort.

At the moment there are some functions with a lot of code lines (e.g. menu_trading_offers -> menu.displayMenu() has roughly 300 lines). If you want change something right in the middle of such a function this can get quite challenging because one has to handle all the things which depend on the changed part.

For example I am working on adding an additional filter to the trade menu that automatically filters the list based on the cargo type of the selected ship (see http://forum.egosoft.com/viewtopic.php?t=373397 for the old version compatible to 2.51). If the code to filter and sort the trades would be separate functions instead of being part of menu.displayMenu() it could be changed without touching the rest of the menu structure. Right now I am trying to take the final trade menu as returned by menu.displayMenu() and remove those lines which are not applicable to my ship. But it would be much easier if the filter could be changed before the wares are added to the menu.

Have a nice weekend and I am looking forward to your feedback.

Edit: I have added a feature request in JIRA http://www.egosoft.com:8282/jira/browse/XRUIMOD-16

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

Post by stefanEgo » Mon, 2. Mar 15, 10:33

@blackmilan: We'll consider simplifying adjusting the filter logic in the tradeoffer menu by modders. Unfortunately we can't afford the resources to go through all the Lua scripts and simplify whatever feels worth the effort to us.
It would take quite a while to go through everything and then we end up with only a handful of things we overhauled actually being used by modders in the end. This would be quite some waste of time which would have better been invested in other work, in our opinion.

I hope you understand this. I suggest that you simply create a JIRA issue, if you run into a case where you feel it could be simplified (also a list of cases which you want to use is fine with us - but these should be concrete examples). We will then consider doing that at some point.

For future script changes we will obviously also better keep an eye on splitting functionality in certain functions for the purpose of simplifying the modders work, but be aware that we can't give a guarantee here.

So the best way would be to report limitations to us while you run into them. That way we won't invest time in things which nobody needs and can rather concentrate on stuff which is not only potentially useful to everybody, but actually really used in the end.

I've updated ur JIRA issue and limited the scope to the trading offers menu filtering logic. Feel free to create subsequent JIRA issues for other cases, if you think there are more which would help you.
Stefan Hett

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

Post by stefanEgo » Mon, 2. Mar 15, 11:28

I'm glad to be able to reveal another surprise as part of the upcoming 3.50 release to you: We now opened-up our Wiki-system. All UI modding documentation is now accessible directly from our internal wiki system: https://www.egosoft.com:8444/confluence ... dding+Home

We hope that this more direct distribution of modding documentation benefits you in that you get updated documentations faster (since we no longer need to port them to the Forum) as well as improve the readability of the documentation, since the Wiki system allows for better formatting than what is possible here in the Forum.

The documentation thread will still be kept in this Forum with the main purpose of other modders being able to add their own documentation there.
Stefan Hett

User avatar
YorrickVander
Posts: 2705
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Mon, 2. Mar 15, 17:14

Loving the new modding wiki :) Stefan - do you folks have any plans to allow the use of lua as a function, or as a mod 'script' in it's own right outside the use of menus? What I have in mind is the way C code can be integrated into python.

EDIT : I'm aware we can directly call lua via debug command line but that's not very user friendly for a released mod.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Mon, 2. Mar 15, 18:14

Another surprise? I have to say Christmas for modders is really early this year :-) The Wiki looks great!

I am totally fine with your approach. Thanks for updating my JIRA ticket and considering an update of the filter functionalityin the trade menu. This is the only concrete case I have right now and I agree you should not waste time on code which is not used in mods.

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

Post by stefanEgo » Tue, 3. Mar 15, 11:05

@blackmilan: XRUIMOD-16 should be fixed in the next version
@YorrickVander: What exactly do you mean by "Lua as a function or as a mod 'script'"? Are you suggesting a facility which allows you to copy/paste Lua code into the game directly and have it executed? If so, then this should in principle be achievable by writing your own mod. The only thing which might be missing would be a function to paste the text into the game (atm only copying to the clipboard is possible). Is that what you have in mind?
Stefan Hett

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

Post by stefanEgo » Tue, 3. Mar 15, 13:42

We've also just added a page which shows the changelog of UI modding changes as a shortcut to get a quick overview of what's going on atm as well as what was done in older versions: https://www.egosoft.com:8444/confluence ... /Changelog
Stefan Hett

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

Post by stefanEgo » Tue, 3. Mar 15, 15:50

@wysiwyg: in the next build we added support for single addons to run in multiple environments and also specify dependencies based on the environment. That should restore (and actually even extend) the same functionality which was possible in 3.20.

Please note that this will impose a breaking change of existing addons unfortunately, since we changed the ui.xml format slightly. The change is recorded here: https://www.egosoft.com:8444/confluence ... .50+Beta+2
Stefan Hett

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

Post by stefanEgo » Tue, 3. Mar 15, 16:35

@Phipsz/wysiwyg: The described workaround (adding a subdirectory called ui/addons/ego_xxx/ui.xml) doesn't seem to work here. Can you provide test-files which work for you?
Stefan Hett

Post Reply

Return to “X Rebirth - Scripts and Modding”