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
Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 12. Mar 15, 07:59

I really appreciate the amount of detail you guys are putting into the documentation. Some things are easy enough to figure out by trial and error, but other details can be hard to catch.


This thread so far has mostly focused on Lua functions so far... Would an MD script function request be appropriate? I'm thinking of a "radial menu section return" expression with the ability to pass back a parameter -- similar to add_player_choice_return, but without the button press.

I've been using a fake detailmoniter menu to get his functionality for several months now, and it allows for some decent UI presentation within the radial menus that you can't otherwise get.


Some examples of user-friendly interface tweaks that I've developed in my own menu mod (Human Resources, linked in my signature) using radial menu section returns:

- Stringing together common actions is much faster than having to re-open a new conversation for each step. Example: Leave/Join my Squad, followed by immediately by a command assignment.

- Sequential button/menu toggling. Example: I've got squad broadcast commands linked to a 3-stage ship-type filter on a sequential toggle button (all ships, combat ships, or non-combat ships) which provides a great deal more control to broadcast commands in a relatively simple way.

- Button Markers. Example: When used with euclid's Manager Call mod, the Human Resources's interface buttons will show markers to indicate that the Station or Accountant Report requests have been sent without getting dumped out of the menu every time.


Anyway, I've gotten used to using a fake Lua menu for this purpose in my own project, but a real MD script expression would still be very nice to have and would provide added flexibility to experimenters who might still be intimidated by the Lua (which is a pretty deep pool to try and wade into >.<).

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

Post by stefanEgo » Thu, 12. Mar 15, 08:09

@Vim Razz: I've forwarded ur request to the appropriate person, but given that this is outside the UI modding scope, I can't give any promises on feedback on that item, unfortunately.
Stefan Hett

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 12. Mar 15, 08:30

Thank you. I wasn't sure where the right place for it might be.

KlausM
EGOSOFT
EGOSOFT
Posts: 639
Joined: Wed, 6. Nov 02, 20:31
x4

Post by KlausM » Thu, 12. Mar 15, 10:26

Vim Razz wrote:This thread so far has mostly focused on Lua functions so far... Would an MD script function request be appropriate? I'm thinking of a "radial menu section return" expression with the ability to pass back a parameter -- similar to add_player_choice_return, but without the button press.
I suppose you'd like to trigger a section that does an action (e.g. "add to squad"), and immediately go to another section (e.g. back to the previous section) which adds player choices. Unfortunately this is not possible in the current conversation system - the response and the following player choices must be defined in the same section. That's also a limitation for us, and we'll certainly look into it, but we can't promise an elegant solution to the problem at this point.

As a workaround, you could reuse the same section for different purposes, and define the action to be performed in the passed parameter. So, instead of going to the "add to squad" section, you go to the "player choices" section with an "add to squad" parameter. That would allow you to handle actions and player choices independently in the same section.

Another possible workaround is having the player choices in a library and including that library in all sections that need them, but that could get confusing.

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

Post by YorrickVander » Thu, 12. Mar 15, 12:37

EDIT *oops* RTFM
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 12. Mar 15, 18:46

@KlauseM - Thank you for your reply.
KlausM wrote:I suppose you'd like to trigger a section that does an action (e.g. "add to squad"), and immediately go to another section (e.g. back to the previous section) which adds player choices.
Yes, this is what my mod currently does. The examples in my previous post are not ideas that I would like to implement in the future -- they're examples from the current version of my mod that I included to help illustrate my meaning.

As my workaround to the limits of the current system, I've been using a "fake" detailmonitor menu that simply initializes helper functions and issues Helper.closeMenuAndReturn immediately on menu.onShowMenu.

This is the workaround "menu" that I've been using in it's entirety:

Code: Select all

local menu = {
	name = "VR_SectionReturnBumper",
}


local function init()
	Menus = Menus or {}

	if Helper then
		Helper.registerMenu(menu)
	end

	return 
end


menu.cleanup = function ()
	menu.kickback3 = nil

	return 
end


menu.onShowMenu = function ()
	menu.kickback3 = menu.param

	Helper.closeMenuAndReturn(menu, false, menu.kickback3)
	menu.cleanup()

	return 
end


init()

return 
And I was wondering about the possibility of an MD script expression that does something similar, instead of using this.


I have another version that issues Helper.closeMenuForSubSection instead of Helper.closeMenuAndReturn, but the need for that sort of section advance is so rare that I haven't actually used it in any project releases yet and usually forget about it completely.

Thinking about it now, there's one section in my current mod where the section advance might help with a particular issue I've been having, but for most circumstances the current MD script system works great without it.

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

Post by YorrickVander » Thu, 12. Mar 15, 18:58

would this helper do the job for you?

Code: Select all

function Helper.closeMenuForSubSection(menu, keepvisible, nextsection, choiceparam)
	-- Keep a copy of baseparam as upvalue because menu.param may change
	local baseparam = getSectionBaseParam(menu)
	closeMenu(menu, keepvisible, function() ProceedFromMenu(nextsection, Helper.convertComponentIDs(choiceparam), Helper.convertComponentIDs(baseparam)) end)
end
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Thu, 12. Mar 15, 19:23

@YorrickVander

Thanks, Yorrick! As I said in the last little bit, I already have a fake lua menu that uses that expression to bounce around cue sections, but you almost never need it. I've found that most of the cases where you ~could~ use it (as a fake MD expression) are really better served by improving section organization instead.


Having section return functionality has been extremely useful in making the radial UI more user-friendly, though, and I thought it might be more accessible to others if it were available as a regular MD script expression.

Tromblon
Posts: 6
Joined: Sat, 21. Feb 15, 22:55

Post by Tromblon » Sat, 14. Mar 15, 09:57

Hi guys,

Regarding the visual structure, any idea how i can make a "Rowspan" ?
[ external image ]
Or simulated it with a stack (superimpose) of 2 tables, is it possible ?
[ external image ]

Thanks for any helps :)

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

Post by wysiwyg » Sat, 14. Mar 15, 11:19

Tromblon wrote:Hi guys,

Regarding the visual structure, any idea how i can make a "Rowspan" ?

Or simulated it with a stack (superimpose) of 2 tables, is it possible ?


Thanks for any helps :)
Not sure if this is possible or not with the current build. I would look at Ego's lua code for screens such as the map screen and the encyclopaedia entry screens - those screens have a more "non -linear" structure than the typical table menu screens like the property menu.

Tromblon
Posts: 6
Joined: Sat, 21. Feb 15, 22:55

Post by Tromblon » Sat, 14. Mar 15, 12:39

Yes there are interesting things on Map and Encyclopedia screen but due to the limitation of 3 tables and 1 renderTarget, i can't do what i want.

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

Post by wysiwyg » Sat, 14. Mar 15, 15:36

Yes I figured you'd probably be limited to some sort of "hack" with the current setup. You can add feature requests in the bug tracker linked at the start of this thread. So far all the one's I've added or seen added have been either implemented almost immediately or acknowledged in a very positive way by Egosoft. I certainly think more customisation options for the menus and the the map would be a good addition. I think there's already a request for drawing shapes and graphics in the UI which would be a start on the road to things like drag selection on the map. Being able to build a "control panel" as you have described would also be really cool.

Moneytide
Posts: 27
Joined: Sat, 14. Mar 15, 17:35

UI Modding - free look

Post by Moneytide » Sat, 14. Mar 15, 18:28

Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
"Chop your own wood and it will warm you twice."

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

Re: UI Modding - free look

Post by wysiwyg » Sat, 14. Mar 15, 19:27

Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13293
Joined: Sun, 15. Feb 04, 20:12
x4

Re: UI Modding - free look

Post by euclid » Sat, 14. Mar 15, 19:48

wysiwyg wrote:
Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.
That would be an MD/XML rather than an UI feature. It has been suggested to add that long time ago. Something like event_keypressed, set_key etc..

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

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

Re: UI Modding - free look

Post by UniTrader » Sat, 14. Mar 15, 21:00

wysiwyg wrote:
Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.
i already thought about what would make most sense for this in AI/MD. dont know about lua since i didnt need it yet - but for AI/MD these events would make most sense:
<event_hotkey_down id="'INPUT_STATE_MOUSECLICK'" />
<event_hotkey_up id="'INPUT_STATE_MOUSECLICK'" hold_time_min="0.5s" hold_time_max="1s" />

event.param returns the Hotkey Name (in case none was specified) and event.param1 returns the actual time the Key was held for the up event. (you can also specify how long the Key has to be held minimum and maximum to trigger the event, default values if not specified are 0.0s and infinity s)
(not sure about the difference between Input Stat and Input Action, but probably the up event can only be available for Inpu States, not for Actions...)

also a way to enable/disable control contexts (see libraries/contexts.xml) would be great so we can use our own, like:
<enable_control_context context="expression" />
<disable_control_context context="expression" />
and maybe even a List of currently active control contexts like the expression "player.controlcontexts"

and a way to define our own Hotkeys of course, but i think with UI Modding everything necesary is already available (define default Key & Hotkey ID in libraries/inputmap.xml , the Situation it is available in libraries/contexts.xml and add it to the Controls Menu via UI Modding for re-assignment - not entirely sure about the last one though..)

sorry when i cannt contribute anyhing for the UI part of this and also make an AI/MD function request, but if just fitted perfectly to the current direction of the discussion ^^''
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 » Mon, 16. Mar 15, 08:54

@Tromblon: We had support for rowspanning and nested tables on our wishlist quite a long time, but unfortunately never got to add that.
In theory it's possible to do what you want to achieve. But it's not easy, unfortunately. You would have to modify the widget_xxx scripts to add the support yourself.
I've added two feature requests for you to the tracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-24, http://www.egosoft.com:8282/jira/browse/XRUIMOD-25
@wysiwyg/Moneytide: The request to improve input mapping for mods is already on the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-20
@euclid: Only partially true. While the feature could also be added to AI/MD, it'd be a separate task to do that for the UI. Of course adding support for one or another could then be used to trigger things on the other side by sending events from the UI to MD or vice versa.
Stefan Hett

Tromblon
Posts: 6
Joined: Sat, 21. Feb 15, 22:55

Post by Tromblon » Mon, 16. Mar 15, 11:10

Thanks :)

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

Post by BigBANGtheory » Wed, 18. Mar 15, 14:46

gosh time flies, so I have another UI use case for this month which if not currently possible I'd like to explore as a feature request pls:

Tactical UI Use Case 2.0 (March 2015)
The goal is to permit the player to select multiple objects displayed in the UI, this might be property items in menus or objects within the HUD, cockpit radar and most importantly the holomap. The purpose of this is to support ability to issue commands* and or instructions* to multiple objects at the same time without having to repeat actions again and again.

Multiple selection should be activated in a manner similar to Microsoft Windows applications as this will be the most intuitive method for most players i.e. use of a modifier key (or button) in combination with the cursor, and for mouse users support for bandbox or marquee selection. The bandbox should be drawn in realtime within the UI thus has a dependency on Tactical UI Use Case 1.0 i.e. the inclusion of LUA graphics libraries.

*required but out of scope for UI modification

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

Post by stefanEgo » Thu, 19. Mar 15, 13:35

@BigBANGtheory: If I get you right this is to a point already possible. Check out the map code for the calls to GetPickedMapComponent(). This function returns the currently selected/picked object on the map.
menu.onRenderTargetSelect() is called, when you click into the map.

So what you could currently already do is to get a list of all the objects the player clicks on in a sequence and then provide the appropriate actions for these.

As for the visuals, I guess atm you could add some table-layout to list what was picked already and provide means to unpick the objects via a button in the table.

To improve upon these things further, I guess this then goes down to adding support to draw shapes/lines directly (http://www.egosoft.com:8282/jira/browse/XRUIMOD-11) with which you then could achieve the visuals.

Does that sound correct, or did I miss something?
Stefan Hett

Post Reply

Return to “X Rebirth - Scripts and Modding”