UI modding - support thread

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

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

Post Reply
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13088
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Tue, 28. Apr 15, 11:46

The <add_holomap> action is paired with the <event_briefing_started> condition which has a param containing the render target. I don't think there's currently another way to get them in MD.

The render target which is used during the mission briefing holomap display is the string: "ui\core\presentations\widget_detailmonitor\widget_detailmonitor_recovered\detail_monitor-rendertarget"

Unfortunately, beyond making use of it, I don't really know if that will help you extend it to something else.

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

Post by BigBANGtheory » Fri, 29. May 15, 17:02

for this month I would like to propose another essential UI feature for consideration the ability to perform selection and action context commands within the UI

Tactical UI Use Case 4.0 (May 2015)
The guiding principle here is for the player to not only select objects of interest with a cursor and controller input but also then follow up that selection with commands including the context of that command with the cursor and a 2nd controller input

Use cases include:
- A move order where by the player selects the units or squad within the UI, triggers a move command action then specifies the destination by secondary activation of the cursor in the x,y,z axis

- A facing order where by the player selects the units or squad within the UI, and with a short move order is also albe to pass a vector (temporarily drawn within the UI so it is visible to the player) by secondary activation of the cursor in the x,y,z axis

- An attack order where by the player selects the units or squad within the UI, triggers an attack command and is then able to select the target (or targets) of the attacking units

- Simply use the secondary controller input/action on a unit to display a list of available commands for that unit (for further selection not unlike the radial menu) to avoid having to memorise keyboard shortcuts.

The point here is by having more than one method of interaction with the UI (left mouse click of controller button) you are able to pass more direct and specific commands to your units. A move command becomes free for the player to pick and choose where, an attack command can be directed at a group of targets or quickly focused on one.

Combined with the other three use cases you start to see a powerful UI emerge, as a reminder they are:

1. Enable LUA graphics options to draw basic geometry with the UI neccassary for vectors, points of reference and bandbox selection
2. The ability to select multiple objects of interest
3. Ability To display UI elements when and where required within the HUD and the virtual environment e.g. capital ship bridge
4. Support secondary input in the UI for the purpose of context sensative commands and ease of use for the player i.e. let the UI help and work for the player

strude
Posts: 1471
Joined: Wed, 3. Aug 05, 08:15
x4

Post by strude » Wed, 3. Jun 15, 12:01

Hey there, knowledgeable people.

I've made an extremely simple UI mod, and since my skills are zero star, I'd like an opinion to see if what I've done will cause any problems. You can find my files in my google drive here (hopefully)

Google Drive Link

It's all pretty simple. The goal is for inventory ware traders to always show the price they buy at, allowing the player to perhaps visit different traders and see if one is selling lower than another is buying. By default, if the player has no stock of an item, the price the trader will pay is not displayed.

What I have done is copied the menu_trader.lua file and removed the restriction that replaces the price with a '-' character (only modification is on line 354, which originally looked more like line 355). This change works in game using the content.xml and ui.xml files I have linked to. I'd just like to know if there is something I should have done differently, as I got concerned having read things like running menu programs twice (original and modified) and I don't want to fall into that.

Is there some log somewhere that I should check for errors?

I doubt I'll ever release this (since it's virtually nothing, but then again isn't everything real ;) ), but I'd still like to know it won't cause problems later in my game if I activate it. It might make it's way into something I've thought about creating, but I'd need to find far more motivation to learn the modding practices before I could venture into that.

Thanks for any assistance that comes my way.

Regards,

Simon
Gaming PC: Gigabyte H270M-D3H | i7 7700 | 16Gb DDR4 | Gigabyte GTX1060 6Gb OC | Asus Xonar DGX | Window 10 Home 64bit | Samsung 256Gb SSD

cyberfuzzie
Posts: 134
Joined: Tue, 21. Nov 06, 13:58
x4

Post by cyberfuzzie » Wed, 3. Jun 15, 12:59

Hi strude,

nice to see you started modding.

There is indeed a log that provides useful information, especially if something is not working as intended. You need to add the following to the X:R launch options:

Code: Select all

-debug all -logfile rebirth.log
(In Steam, right-click on X:R, Properties, Set Launch Options.)
The file is located in your personal folder under 'Egosoft\X Rebirth\[SteamID]'. While the game is running you may see the file as 0 bytes in size, that is usually wrong, it contains log data. After you quit the game the size will display correctly, too. Just try running the game with as few mods as possible, you may then find the important lines more easily.

About your mod:
Your concerns about both menus running are valid, as both menus register for the 'showTraderMenu' callback. But I have no idea what happens if both menus try to get displayed.

What can you do about it?
- Modify your init function to search for the original menu and remove it. Especially call 'Helper.unregisterMenu(oldmenu)', so the vanilla TraderMenu does not get called.
or
- Change the name of your menu and modify the file md\NPC_Itemtrader.xml to show your menu. Search for lines like '<open_conversation_menu menu="TraderMenu" ...' and update the menu attribute according to you own menu name.

I would prefer the second option as I think it to be the better approach to solving the problem, but for you that means also learning about XML patching (which isn't that hard).

Greetings and good luck
cf+

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 3. Jun 15, 17:39

regarding the logfile:
i usually leave the "-debug all" out and specifiy the filter level manually in <debug_text/> whenever i want to log some values - this way all the unnecesary info messages are filtered out, but you still get the important ones when the game complains about something or the values i actually need
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by YorrickVander » Wed, 3. Jun 15, 18:42

the same functionality is provided in lua with :

Code: Select all

DebugError("Error while executing Lua input: " .. returnvalue)
for example.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

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

Post by stefanEgo » Tue, 7. Jul 15, 11:44

@BigBANGtheory: Pardon me for the delayed response. There've been several pressing tasks here which prevented me to get back to reply earlier (feel free to send me a PM, if u're awaiting a response and don't get one within a few days, cause then it's likely, while I didn't forget it, it's not getting a high enough priority alongside other tasks).
Regarding ur April 2015 use-case: I take it that it was sufficiently answered with the exception of controling which panels are active, or not. I've added a feature request for u, so things are being kept on record for us (http://www.egosoft.com:8282/jira/browse/XRUIMOD-39).

@BigBANGtheory (Use case 4.0): I assume that in principle adding action context commands is possible with the existing means already, though not in the way you are describing it should work/look. I guess the main limitations in the UI engine go down to these two feature requests: ability to draw lines/shapes in menus (http://www.egosoft.com:8282/jira/browse/XRUIMOD-11) and ability to map keys/buttons on own actions (http://www.egosoft.com:8282/jira/browse/XRUIMOD-20).
The idea with selecting units/squad and then issuing an attack command on a target should be possible already now, or not?
The main new limitation I see here is that you are not able to show layered frames in menus. This is something we have on our wishlist already and I added a feature request for you to keep track of it. If that would be done, in principle the UI you have in mind should be realizable. Given the complexity of that feature it's however not something which can quickly be added; though it's something which we are quite likely to tackle at some point (http://www.egosoft.com:8282/jira/browse/XRUIMOD-40).

@strude: One additional useful tool is the in-game debuglog which you need to activate explicitly to see it. Instructions can be found here: http://forum.egosoft.com/viewtopic.php?t=366654.
Regarding the possibilities to achieve what you want: In addition to the options cyberfuzzie already pointed out, a thirs way would be to replace only the onShowMenu-function of the trader menu with ur modified version. That way you are only impacted by those patches which modify the content of that function rather than being impacted by any of the changes in the menu_trader.lua-file (as it would be the case with cyberfuzzie's second option).
Stefan Hett

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

Post by BigBANGtheory » Wed, 15. Jul 15, 10:36

This is probably the best example I can give of the end product the result if you like of enhancing the capabilities of the UI within an X Universe experience:

https://www.youtube.com/watch?v=IVr98bTzxH8

Really someone in the development team should take a good look at that link, make the connection and case for making it happen. Worse case try to make the game capable of achieving it over time. As I see it XR and its UI engine cannot deliver that experience yet and plugging those gaps will make for a much stronger experience in the future be it XR or its successor. My feature requests are trying to get you to that place where such things are possible. Is there a more important goal for the UI right now?

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

Post by stefanEgo » Wed, 15. Jul 15, 10:44

@BigBANGtheory: Thanks for providing the video link. I've passed that on to the appropriate people. It's certainly a nice example and be assured that this is absolutely on the radar. :-)
Stefan Hett

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

Post by BigBANGtheory » Wed, 15. Jul 15, 16:34

stefanEgo wrote:@BigBANGtheory: Thanks for providing the video link. I've passed that on to the appropriate people. It's certainly a nice example and be assured that this is absolutely on the radar. :-)
:)

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

Post by stefanEgo » Wed, 15. Jul 15, 19:09

We have now opened up part of our Wiki system for everyone to create their own documentation/content. For now this is a first test to see how broadly this is accepted/used.

If you think you have something to contribute, just create your content directly here: https://wiki.egosoft.com:1337/X%20Rebirth%20Wiki/

Please note that the officially documentation ( https://wiki.egosoft.com:1337/X%20Rebir ... 20support/ ) cannot be modified.
Stefan Hett

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Fri, 17. Jul 15, 15:55

any preffered format for the page title for documentation in other languages than english? for now i use the format de/page title for german doc and move the german modding tuto i wrote there ^^
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by stefanEgo » Fri, 17. Jul 15, 17:40

Nice job UniTrader --- we'll set-up the strcture of documents as content is being added... I'll review things later (or next week) to set-up some structure for this as a starting point and move ur page then accordingly.
Stefan Hett

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sun, 19. Jul 15, 08:58

also just translated it, although the screens remain german for now.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by stefanEgo » Fri, 24. Jul 15, 12:57

Thanks for the work @UniTrader. FYI you can also copy/paste images directly in Confluence. There's a bug present which prevents to do so when u create the page initially. But after you created the page, saved it and edit it again, it should work.
If you like, u could update ur pages and integrate the screenshots directly (rather than via a link).
Stefan Hett

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Fri, 24. Jul 15, 14:02

I didn't try to upload images yet because I just copied and translated my tutorial from the German Forum to the wiki - wanted to do the images properly later (converting the link syntax was easier than uploading the images again ;) )

I will also submit the other parts of my beginners tutorial already available in the German Forum but my current prio is my manager trading script
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 2. Sep 15, 22:25

need some hints from someone who is more familiar with the UI and lua than me: i want to add Sector and Cluster Selection via map and have duplicated the menu_map in a new file for this puropose, and also copied and modified the code for selectzone to account for sectors and cluster selection, but somehow the respective Buttons for Zooming in are not replaced (the Details Bullon turns to select in the Zone Select Mode), so i am probably missing something.. could someone give me some pointers what that could be? (i think it has something to dowith that the Details Button is replaced with a Zoom in Button when in Cluster or Galaxy View)

for reference here my modified version of the menu_map:
https://github.com/UniTrader/UTCommandA ... nu_map.lua
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by blackmilan » Sun, 6. Sep 15, 14:31

Hi UniTrader, I am not really sure what you are trying to achieve. What do you mean by
UniTrader wrote: ... i want to add Sector and Cluster Selection via map
? In 3.60 a single click on a system (cluster) or sector displayed on the map marks the entry in the menu on the right side and a double clicks zooms in to the next lower level if I am not mistaken. What additional functionality are you trying to add? Are you trying to make a system (cluster) or sector the target to plot a course?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sun, 6. Sep 15, 14:56

Something like this, yes..
There is already a "selectzone" mode used for the "fly to" /"take me to " command where you can select a zone which is returned to the MD and I need something similar for sectors and clusters for more precise management of station ranges - or even better a "selectspace" mode which replaces the comm/plot course button with a "select" button and returns a zone, sector or cluster.
already tried around but can't figure out how to change the vanilla map to allow this
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by blackmilan » Sun, 6. Sep 15, 15:54

Ah ok, I have no idea about MD and how it is hook into lua but let's see.

I had a quick look at your code. The line numbers below are respective to your copy of menu_map.lua.

The changes to onRowChanged are looking good, but I am not sure if a selection on the map is triggering this function. You also might need to have a look at the initial setup of the buttons which is done as part of the function createChildList starting with line 1314. On line 1328 the initial label for the Details button is defined and the initial script is set on 1471.

PS: As said above I do not really have an idea of how MD and lua work together. I am not sure if it has something to do with your problem, but the map menu from the link above is called "UTMapMenu" while the MD scripts are all referring to "MapMenu".

Post Reply

Return to “X Rebirth - Scripts and Modding”