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
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: 13298
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

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

Post by blackmilan » Sat, 21. Mar 15, 22:47

There is another little mod which I have implemented for 2.51 using the subst_XX.cat method which I would like to port to the new UI modding way. It changes the formatting of the target distance of the primary target next to the crosshair to show a decimal place (e.g. 1.5 km) providing me with a better feeling for my actual speed and more importantly it is easier to find the right distance to start firing based on the range of the selected weapon.

The function that I like to change is "getDistanceText()" from "core/Lua/targetsystem.lua".

So my first question is, is modding UI core files supported right now? If yes, how would a dependency to a core file look like? I tried a few variants but so far I have always ended up with a missing dependency.

The second thing is that currently all the functions in targetsystem.lua seem to be local. Is there a way to overwrite/hook into them?

As always thank you all for your input and ideas.

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

Post by BigBANGtheory » Sun, 22. Mar 15, 10:31

stefanEgo wrote:@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?
Ok then yes if the UI can list player objects clicked in a sequence and then be organised by object type that is a start. What then remains is indirect selection i.e. the player drawing a semi-transparent box over objects of interest and for those objects to be listed for further action.

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

Post by YorrickVander » Mon, 23. Mar 15, 06:26

little tip for passing data to/from lua for menus where params cannot be passed to lua as the user clicks :

Code: Select all

local playership = GetPlayerPrimaryShipID()
local player = GetComponentData(playership, "controlentity")
gives you the equivalent of player.entity so blackboard data can be accessed from the menu lua. player.entity.$blackboardvar then becomes

Code: Select all

local var = GetNPCBlackboard(player, "$blackboardvar")
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 » Mon, 23. Mar 15, 09:25

@blackmilan: Unfortunately the only way to modify Lua scripts located under ui/core/Lua is only possible via substitution catalogs (with the exception of the widget_xxx-files). This still works in XR >3.50. We really wanted to add proper modding support for these files too, but due to the lack of resources, we had to postpone that. So for the time being, you'd be fine with using the subst-cat-files. However, I've added a feature request for you in the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-26
Just so you are aware: Please note that we are more likely to introduce breaking changes in new versions for mods using the subst-catalog-method than we are for the standard format.
As part of XRUIMOD-26 we'd also consider simplifying modifying the scripts without having to replace them alltogether.
Stefan Hett

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

Post by blackmilan » Mon, 23. Mar 15, 18:36

@stefanEgo
Thank you!

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

Post by stefanEgo » Thu, 26. Mar 15, 00:20

Just to give you some heads-up on some modding related changes: 3.52 RC2 is currently in beta testing and contains two changes/fixes:
(full list is available here as usual: https://wiki.egosoft.com:1337/X%20Rebir ... Changelog/)

- Bugfix: the mouseOver/mouseOut events on tables was not correctly fired, if the table contained inactive buttons ( XRUIMOD-27 )
- New Feature: FFI function HasCustomConversation() was added which checks whether an entity is running a custom conversation atm. ( XRUIMOD-28 )
Stefan Hett

jdow22
Posts: 4
Joined: Fri, 20. Mar 15, 22:20

Post by jdow22 » Fri, 27. Mar 15, 15:48

Is it possible to get/set the step increase of horizontal sliders?

I want to change the drop cargo slider to an all or nothing when a local security has asked for a cargo drop.

Also on other sliders I want to use home and end keys to select min/max.

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

Post by stefanEgo » Mon, 30. Mar 15, 11:50

@jdow22: Take a look at widgetSystem.scrollRight() that should provide you with a starting point on how to do that.
Stefan Hett

User avatar
Juggernaut93
Posts: 2897
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Fri, 3. Apr 15, 16:32

Is it possible to create a multi-line EditBox?

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

Post by UniTrader » Fri, 3. Apr 15, 16:42

Juggernaut93 wrote:Is it possible to create a multi-line EditBox?
you can write t-file links in this Text Box ( {PageID,tID} ) and with a custom t-file just containing \n you should be able to add a line break ;) just as workaround ;)

with this method you also should be able to add color Codes ( \033X where X is a Letter defining the Color) - just dont forget to terminate this with \033X (default Color) as it may make following Text colorful otherwise :D
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 ;)

Post Reply

Return to “X Rebirth - Scripts and Modding”