UI modding - support thread
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 124
- Joined: Sat, 22. Jan 11, 21:13
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.
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.
@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?
@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
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
@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
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
- YorrickVander
- Posts: 2701
- Joined: Tue, 29. Oct 13, 21:59
@stefan - no mate, as I said, in a similar way to which compiled c can be used from python scripts. To elaborate - say there's a function/mod i want to write that is best achieved in lua, but i currently cannot do that unless i am running that lua code as part of a detail monitor menu. Are there any plans to make this possible?
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
@stefan: simply adding a folder didn't work for me either, but adding a ui/addons/ego_* folder with ui.xml etc in a subst_01.cat worked for me. Don't know if it still works, as I ported my mods already to the official structure. If there should still be need of an example I can see if I can upload a previous version of any of my mods tomorrow.
@yorrick: you could create a fake menu that you call from md. this fake menu would need to have Helper.closeMenuAndCancel as last action of menu.onShowMenu (don't know if these are completely correct, have no examples on current pc) that way you could include lua into md while that menu closes itself
@yorrick: you could create a fake menu that you call from md. this fake menu would need to have Helper.closeMenuAndCancel as last action of menu.onShowMenu (don't know if these are completely correct, have no examples on current pc) that way you could include lua into md while that menu closes itself
@Phipsz: I'c. using the substitution facility for this was the missing link. Thanks for clarifying.
@YorrickVander: Pardon me, but still having difficulties fully getting what you mean here... By adding a Lua file to any addon, all the code which is inside the Lua file is executed on load (which normally is at the time the game starts). So if you write the following code:
your function foo will be executed on load directly.
If you want to execute that upon some other trigger, you have different possibilities to do so. One example was given by Phipsz. Another example is to execute the function/code on a timely manner or upon certain gamestates, in which case you have the onUpdate()-function you could use. The onUpdate() function is executed every frame, so you could implement the trigger condition like:
Do u mean that atm you lack the possibilitiy to execute scripts upon keypresses directly? Aka you would like to execute your function foo() when you press "k" for instance?
@YorrickVander: Pardon me, but still having difficulties fully getting what you mean here... By adding a Lua file to any addon, all the code which is inside the Lua file is executed on load (which normally is at the time the game starts). So if you write the following code:
Code: Select all
function foo()
-- do whatever you wanna do here
end
foo()
If you want to execute that upon some other trigger, you have different possibilities to do so. One example was given by Phipsz. Another example is to execute the function/code on a timely manner or upon certain gamestates, in which case you have the onUpdate()-function you could use. The onUpdate() function is executed every frame, so you could implement the trigger condition like:
Code: Select all
function onUpdate()
-- if I'm in a ship and being attacked by drones then
foo()
-- or alternatively to call ur function every 200 frames
int count = 0
function onUpdate()
if count == 200
foo()
count = 0
else
count = count + 1
end
end
function init()
-- create your frame
SetScript(myFrame, "onUpdate", onUpdate)
Last edited by stefanEgo on Wed, 4. Mar 15, 10:30, edited 1 time in total.
Stefan Hett
- YorrickVander
- Posts: 2701
- Joined: Tue, 29. Oct 13, 21:59
@YorrickVander: Thanks for clarifying what you mean. Now I got it. We are considering improving the interfacing between the UI and MD at some point. I've created a JIRA issue for that feature request: https://www.egosoft.com:8443/jira/browse/XRUIMOD-19
@all: We've also updated Lua/FFI function overview in Confluence. It should be easier to get an overview of the available functions now. See https://www.egosoft.com:8444/confluence ... n+overview and https://www.egosoft.com:8444/confluence ... n+overview
@all: We've also updated Lua/FFI function overview in Confluence. It should be easier to get an overview of the available functions now. See https://www.egosoft.com:8444/confluence ... n+overview and https://www.egosoft.com:8444/confluence ... n+overview
Stefan Hett
Seems to be working fine - Many thanks for the continued updates.stefanEgo wrote:@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: http://www.egosoft.com:8292/confluence/ ... .50+Beta+2
I'm still digesting all of this -- the new amount of information you guys are making available is amazing.
Is there any chance we might get a few more input options for menu button hotkeys in the future? I've got a few in mind that I'd really love to see:
INPUT_STATE_DETAILMONITOR_PGUP
INPUT_STATE_DETAILMONITOR_PGDN
INPUT_STATE_DETAILMONITOR_HOME
INPUT_STATE_DETAILMONITOR_END
Is there any chance we might get a few more input options for menu button hotkeys in the future? I've got a few in mind that I'd really love to see:
INPUT_STATE_DETAILMONITOR_PGUP
INPUT_STATE_DETAILMONITOR_PGDN
INPUT_STATE_DETAILMONITOR_HOME
INPUT_STATE_DETAILMONITOR_END
@wysiwyg: thanks for the update
@Vim Razz: input handling is really a bit limited atm, unfortunately - I've added a feature request to the bugtracker for you ( http://www.egosoft.com:8282/jira/browse/XRUIMOD-20 ), but can't give an ETA
@Vim Razz: input handling is really a bit limited atm, unfortunately - I've added a feature request to the bugtracker for you ( http://www.egosoft.com:8282/jira/browse/XRUIMOD-20 ), but can't give an ETA
Stefan Hett
@Phipsz: FYI in the next 3.50 build, the "workaround" you suggested will no longer work, since all the cases for which you previously had to use the subst-catalog-files should now be properly supported by the engine (see: https://www.egosoft.com:8444/confluence ... .50+Beta+3)
Please let us know if you still run into a case which seems to not be possible without the subst-catalog-files, so we can resolve that in time for 3.50.
@YorrickVander: In the next build we added a new MD action called "raise_lua_event". That should allow you to send data from MD to Lua scripts as well as being used as a trigger for any kind of functionality. Please let us know if that does not solve the case for you.
Please let us know if you still run into a case which seems to not be possible without the subst-catalog-files, so we can resolve that in time for 3.50.
@YorrickVander: In the next build we added a new MD action called "raise_lua_event". That should allow you to send data from MD to Lua scripts as well as being used as a trigger for any kind of functionality. Please let us know if that does not solve the case for you.
Stefan Hett
- YorrickVander
- Posts: 2701
- Joined: Tue, 29. Oct 13, 21:59
That sounds good! As you know I'd like to access data which are not available via MD/XML script commands, for example "GetProductionModuleData". Looking forward to test this new command.stefanEgo wrote: ......In the next build we added a new MD action called "raise_lua_event". That should allow you to send data from MD to Lua scripts as well as being used as a trigger for any kind of functionality.
......
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
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
@stephan -- I was just wondering about the possibility. Thank you for taking the time to add the feature request!
And I'll join the chorus of "wow, sounds great!" at the exploring the possibilities of a raise-lua-event MD function. I currently use a MD-script based system for determining whether certain mods are active or not to make compatibility adjustments in my own project, but have been thinking of switching to a LUA-based extension lookup system instead. The possibility of doing that without having to pop open another fake menu is very appealing.
And I'll join the chorus of "wow, sounds great!" at the exploring the possibilities of a raise-lua-event MD function. I currently use a MD-script based system for determining whether certain mods are active or not to make compatibility adjustments in my own project, but have been thinking of switching to a LUA-based extension lookup system instead. The possibility of doing that without having to pop open another fake menu is very appealing.
Thank you very much for http://www.egosoft.com:8282/jira/browse/XRUIMOD-6, this is exactly what I asked for in my old post. I was afraid I would have to provide a second mod just for one part of "my" UI.
Also, sorry if it has already be mentioned, but it seems that the ui.xml file isn't uploaded to the Steam Workshop.
Also, sorry if it has already be mentioned, but it seems that the ui.xml file isn't uploaded to the Steam Workshop.
-
- Posts: 134
- Joined: Tue, 21. Nov 06, 13:58
Yes, it's quite sad the workshoptool does not automatically pack the ui.xml into the cat with -buildcat (or -buildvcat either) now that I don't even have to add subst_01.cat to mods anymore. while manually packing the files is working fine, it would be more convenient and consistent if the workshoptool would not ignore the ui.xml. workshoptool also has another problem regarding contributor rights I reported a few days ago in the rebirth tools discussion (but sadly got no answer yet.)bm01 wrote:Also, sorry if it has already be mentioned, but it seems that the ui.xml file isn't uploaded to the Steam Workshop.