UI modding - support thread

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

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

Post Reply
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 11539
Joined: Sun, 15. Feb 04, 21:12
x4

Post by euclid » Thu, 5. Mar 15, 15:42

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.
......
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.

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

Vim Razz
Posts: 1837
Joined: Tue, 2. Nov 10, 03:20
x4

Post by Vim Razz » Fri, 6. Mar 15, 07:27

@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.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Sat, 7. Mar 15, 14:54

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.

cyberfuzzie
Posts: 119
Joined: Tue, 21. Nov 06, 14:58
x4

Post by cyberfuzzie » Sat, 7. Mar 15, 15:47

I put the ui.xml file in my ext_01.cat/dat and it worked fine.

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

Post by Phipsz » Sat, 7. Mar 15, 16:29

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.
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.)

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

Post by blackmilan » Sun, 8. Mar 15, 21:49

stefanEgo wrote:@blackmilan: XRUIMOD-16 should be fixed in the next version
Hi Stefan, I just checked out version 3.5 beta 3 and is working perfectly now. :) Thanks!

If anybody is interested in having a look at my code a new version of the Trade Menu Cargo Hold Filter can be found here.

User avatar
wysiwyg
Posts: 584
Joined: Thu, 26. Feb 04, 01:08
x4

Post by wysiwyg » Mon, 9. Mar 15, 00:49

The ui.xml file can be added to the cat/dat files using the XRCatTool. I put all the required commands in a batch file (unfortunately one needs to be well versed in using REGEX to get the full effect!!) Here's my batch file for building Enhanced Money Transfer (Including backports for earlier releases):

Code: Select all

REM Build batch file for X-Rebirth - MT Enhanced Money Transfer Mod
REM Version 1.0
REM Date 2014-12-04
set version=%1

rmdir ..\release\%version%\mt_enhanced_money_transfer\
mkdir ..\release\%version%\mt_enhanced_money_transfer\

REM Add current release to ext_01.cat
XRCatTool -in ..\src\%version% -out ..\release\%version%\mt_enhanced_money_transfer\ext_01.cat -exclude "^content" "^readme" "^ego_forum_text" "xpl$" "old$" "^v251/" "^v320/" -dump

REM Now add the v251 release diff ext_v251.cat file
XRCatTool -in ..\src\%version%\v251 -out ..\release\%version%\mt_enhanced_money_transfer\ext_v251.cat -diff ..\src\%version% -exclude "^v251/"  "^v320/" "^readme" "^ego_forum_text" "^content" "xpl$" "old$" -dump

REM Now add the v320 release diff ext_320.cat file
XRCatTool -in ..\src\%version%\v320 -out ..\release\%version%\mt_enhanced_money_transfer\ext_v320.cat -diff ..\src\%version% -exclude "^v320/" "^v251/"  "^readme" "^ego_forum_text" "^content" "xpl$" "old$" -dump

REM Copy content.xml to release folder
copy ..\src\%version%\content.xml ..\release\%version%\mt_enhanced_money_transfer\content.xml

REM Copy readme.txt to release folder
copy ..\src\%version%\readme.txt ..\release\%version%\mt_enhanced_money_transfer\readme.txt
echo "Done...."
The file is run from a build directory in the same tree as the source code e.g.

../mt_EMT/build/buildemt.bat
../mt_EMT/src/%version%/*.*
../mt_EMT/release/%version%/*.cat, *.dat, *.txt etc.

The batch file takes a single parameter that is the version to be built e.g.
buildemt.bat v115 will build version 1.15 etc.

Just for completeness I then use the following batch file to publish. It takes three parameters:
Param 1 - publish - publish the mod for the first time
update - updates an already published mod
minor - minor update without version change
Param 2 - version - eg v115
param 3 - "The required update text if using publish or update as Param 1"

Code: Select all

@ECHO OFF
REM Publish X-Rebirth: MT Enhanced Money Transfer Mod
REM Version 1.0
REM 2014/12/04

REM if no parameter then update else first time publish 
IF "%1" EQU "update" GOTO Update_mod
IF "%1" EQU "publish" GOTO Publish_mod
IF "%1" EQU "minor" GOTO Update_minor
GOTO Error_args

:Publish_mod
ECHO "Publishing Mod......"
GOTO End_of_prog

:Update_mod
REM Set the changenote text
set change_note="%~3"
set version=%2
IF "%~3" EQU "" GOTO Error_args
ECHO %change_note%
WorkshopTool update -path "..\release\%version%\mt_enhanced_money_transfer" -changenote %change_note%
GOTO End_of_prog

:Update_minor
set change_note="%~3"
set version=%2
IF "%~3" EQU "" GOTO Error_args
ECHO %change_note%
WorkshopTool update -minor -path "..\release\%version%\mt_enhanced_money_transfer" -changenote %change_note%
GOTO End_of_prog


:Error_args
ECHO "Incorrect command line arguments....."
:End_of_prog
ECHO "Done...."
I should get around to making these files universal one of these days so that the same files will work on any mod. :O

Hopefully you can work out what I did and adapt for your own mods.

Cheers
Wysi :)

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

Post by stefanEgo » Mon, 9. Mar 15, 10:58

@euclid: Please understand that the raise-lua-event MD action is just a one-way handling to transmit data/trigger events from MD back to Lua. It doesn't work the other way around. However, I've created a feature request for this scenario for you. We hope to get this in in-time for 3.50, but no promises ( http://www.egosoft.com:8282/jira/browse/XRUIMOD-22 ).
@bm01/Phipsz/wysiwyg: Thanks for pointing out that the workshop tool doesn't include the ui.xml automatically. As suggested by cyberfuzzie, Phipsz, and wysiwyg, it works if you manually add the ui.xml file though. I'll see if we can improve this behavior. Was also added to the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-21
Last edited by stefanEgo on Mon, 9. Mar 15, 11:40, edited 1 time in total.
Stefan Hett, Engine Architect

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

Post by stefanEgo » Mon, 9. Mar 15, 11:40

@euclid: Good news. The next build should provide a new function: SignalObject() which can be used to send data from Lua to MD.
Stefan Hett, Engine Architect

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

Post by euclid » Mon, 9. Mar 15, 16:04

Thank you (and the team) :-)

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

KlausM
EGOSOFT
EGOSOFT
Posts: 599
Joined: Wed, 6. Nov 02, 21:31
x4

Post by KlausM » Mon, 9. Mar 15, 17:05

stefanEgo wrote:@bm01/Phipsz/wysiwyg: Thanks for pointing out that the workshop tool doesn't include the ui.xml automatically. As suggested by cyberfuzzie, Phipsz, and wysiwyg, it works if you manually add the ui.xml file though. I'll see if we can improve this behavior. Was also added to the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-21
The WorkshopTool has just been updated, ui.xml is now included when using -buildcat or -buildvcat. Let us know if there are any problems.

User avatar
YorrickVander
Posts: 2672
Joined: Tue, 29. Oct 13, 22:59
x4

Post by YorrickVander » Mon, 9. Mar 15, 17:17

@stefan + klaus m - ty both, really pleased with the support for this new feature.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

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

Post by stefanEgo » Tue, 10. Mar 15, 09:57

Breaking changes of 3.50 RC1 are noted here: https://www.egosoft.com:8444/confluence ... E+3.50+RC1

Most importantly we had to restrict the location of Lua files in extensions to NOT be located in the extension's root-directory.

We suggest to create a ui directory and put the Lua files in there. The references in the ui.xml file then need to be adjusted accordingly (aka: <file name="ui/file1.lua" />).
Stefan Hett, Engine Architect

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Tue, 10. Mar 15, 10:53

By using a dot to represent the current directory ("./file.lua") it's apparently possible to make the lua files accessible while being in the root directory.
I don't know if that's an issue but I thought I should mention it.

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

Post by stefanEgo » Tue, 10. Mar 15, 11:08

@bm01: Yep that's correct. We'll update the documentation accordingly to be more precise about this point.
We are considering it basically best-practice to have Lua-files not in the root-directory. While atm nothing will break, if you do that and use the "." in the path, we won't ensure that this will not break in a future version. Therefore, if you still keep ui-files in the extensions root, don't be surprised if your addon won't work in a later version of X Rebirth.
Stefan Hett, Engine Architect

Post Reply

Return to “X Rebirth - Scripts and Modding”