[MOD] Slightly More Useful Plot Station (27.02.2015; 3.60 and Linux-compatible)

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

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

CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

Wow, fast turn-around! Thanks!

I'm at work now, (10am local time), but I'll try tonight or tomorrow (I also have a family life to take care of, so you may have to wait a bit for feedback ;-) )

I indeed noticed you were consistent with '_E_conomy' in all files I've opened so far (OCDness is a good trait in a programmer ;-) )
However, I wouldn't be surprised if somewhere inside the gamecode-beyond-our-control there is a

Code: Select all

path = path.toLowercase()
I'm not saying this is present in the XR-codebase, but it's on my list of 'things Murphy's Law might throw at us'.

As for the other path's casing: I did indeed notice 'Economy' was written with one capital in your folders. I'm not sure where my Egosoft-assets put it, as I haven't extracted my egosoft .dat-files (yet).
I'll let you know what it looks like once I get to that.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

CulunTse wrote:...

Code: Select all

path = path.toLowercase()
I'm not saying this is present in the XR-codebase, but it's on my list of 'things Murphy's Law might throw at us'.
My guess as well. Will be sort of confirmed if the fix posted above works since I only changed the path in \index\macros.xml to lower-case, and the folder name as per your recommendation.
CulunTse wrote:As for the other path's casing: I did indeed notice 'Economy' was written with one capital in your folders. I'm not sure where my Egosoft-assets put it, as I haven't extracted my egosoft .dat-files (yet).
Probably the same -- "Economy" with a capital "E" -- but I'm guessing that the game is reading everything in the .cat/.dat files as lower-case.
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

Ha, made some time to try out your work! Sadly no dice..
The symptoms with your lowercase variant are the same as with the 'normal' SMUPS: listed in extensions ('location = w.e_plot_station' -> lowercased). Architect doesn't offer Silicon Plants anymore, but Reconfig-fabs aren't listed either.

For completeness sake, I tried to rename 'w.e_plot_station/assets/structures/Economy' to lowercase 'economy'. That didn't change the symptoms.
With the lowercase 'economy' I also ran a debug.log, and got this (amongst a host of other log-spam related to other mods)

Code: Select all

[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro1' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro1' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro2' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro2' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro3' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro3' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro4' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro4' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro5' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_props_adsigns_bt_siliconwavers_xl_macro5' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_struct_econ_prod_siliconwavers_macro' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_struct_econ_prod_siliconwavers_macro' not created.
[General] ======================================
[General] ======================================
[=ERROR=] Macro template connection 'connectionfor_struct_econ_prod_siliconwavers_macro1' not found in macro 'struct_bt_dv_drone_complex_macro'. Macro connection 'connectionfor_struct_econ_prod_siliconwavers_macro1' not created.
[General] ======================================
It means little to me, but it maybe it makes sense to you.

No update on my EgoSoft-assets casing. Didn't have time to unpack (bedtime now).

Full disclosure (maybe it'll provide some random insights to you guys): I previously posted a related bugreport on the EgoSoft bugtracker:
XRNIX-49
('Culun-Tse' = bastardised fake-asian pronunciation of 'Crunchy', but that forumname was already taken)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Thanks for the debug spew! Looks like I'll have to repack the subst. And since your changing "Economy" to "economy" appears to have broken some connections, I'm guessing that the game expects the capital "E," just like in the windows version. I'll cook it up now, and post a link here in a bit.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Hi Crunchy,

Try this, please. And sorry I can't test it myself. Don't have access to a linux box at the moment.

I changed the packed macro to lower-case:

\assets\structures\Economy\production\macros\struct_econ_prod_smups_rmp_macro.xml

and changed all references to the file to lower-case as well. At this point, I'm really just guessing, and I hope that the the way subst files are handled weren't changed in the linux version.
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Re: linux compatibility

Post by Sparky Sparkycorp »

CulunTse wrote:Hi, I'm trying to get get your mod running in the Linux beta.
I'm new at xrebirth modding, but have been lurking these forums for a month or three now.

Originally, SMUPS wasn't even recognised by the game in the Linux beta (I.e. not listed under the 'extensions' menu).
If I copied the exact same unpacked folder to my Windows install's extension-folder, it worked without a hitch, and the architect offered to build me reconfigurable materials fabs.

I've done some experimenting this week, and finally got SMUPS to show up in the extensions menu.
To do this, I had to rename the mod folder from "w.e_Plot_Station" to "we_plot_station" (note, no more capital letters).

It's a little known fact that filenames and foldernames are case-sensitive under Linux (and Mac, and general *nix derivatives).
So while 'My Documents', 'my documents' and 'My DoCuMeNTs' are all the same folder in Windows, they'd be three folders in Linux/Mac.

The switch to lowercase-only caused the mod to start partially working. It's more listed under 'extensions', and my architect stopped offering Silicon Wafer Plants for construction. However, she didn't offer the reconfigurable materials fab instead; there's basically only two stages now, instead of three.

My hypothesis is that the xml diff gets applied, removing the silicon wafer plants, but the assets for the Reconfigurable fabs cannot be found due to a path CaSiNg mismatch in the .cat/ dat.

I could use some help in working with the cat/dat files. They're currently black boxes to me, as none of the extractor tools work under Linux (as far as I'm aware).
I can boot to Windows, but I thought I'd ask some advice first at this point. (E.g. where to look for instances of the extension foldername 'w.e_Plot_Station')
Good luck with the porting and thanks for thinking about this mod :)

I know little about this stuff but on the off chance it matters, just posting to note that ad well as changing case, you've also lost a "." (although may be that was a typo).
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Re: linux compatibility

Post by w.evans »

Sparky Sparkycorp wrote:
CulunTse wrote:from "w.e_Plot_Station" to "we_plot_station"
on the off chance it matters, just posting to note that as well as changing case, you've also lost a "." (although may be that was a typo).
Didn't notice that. Thanks, Sparks!

@Crunchy, would the "." make any difference in linux? Doesn't matter in windows now, but I vaguely remember file naming in DOS being stricter. (8 characters, no spaces, and the dot separates the filename from the extension, or something like that?)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

the . would be a regular part of the file name, so "w.e_Plot_Station" and "we_plot_station" are two seperate files/folders (and it would really wonder me if windows handled this diffrently, there the last dot indicates the file type and afaik the only internal modification windows does to file names internally is converting them to lower case, not removing any characters)
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 ;)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Hi UniTrader,

yup. In windows, although the two file names would refer to two different files, they would be read the same way. So while "w.e.x" and "we.x" would be two different files, changing a file called "w.e.x" to "we.x" wouldn't change anything. (Assuming nothing is looking for "w.e.x" specifically, of course.)

Sparks noticed Crunchy mentioning that changing "w.e" to "we" in part got it working on linux, though, which made me wonder if file names are handled differently in linux. So that "w.e" couldn't refer to a directory, for example, or if "w.e.x" would refer to something other than a file with filename "w.e" with extension ".x" (Sorry, read up on linux a very long time ago, but am no longer anywhere close to being -nix literate.)

Or might very well have been a typo, and only the case-sensitivity in linux is relevant.

EDIT: Sorry, Uni. Just read your post again, and realized that you might have been talking about linux rather than windows. Were you? So dots in filenames are handled the same way in linux and in windows, so "w.e" / "we" is not relevant? (And sorry again. I seriously need to get more sleep!)
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

To clear the confusion about the '.'
Dots work under Linux basically the same as under Windows.
' My.file.txt' is recognised as text, ' my.file.txt.zip' is an archive

Specifically for XR: I also have the mod 'cf.missioncomputer' and that has always worked normally, so dots in mod names are ok.

I did remove the dot from the foldername in my first attempt ('we_plot_station', not a typo), but it shouldn't be a necessary change (W.Evans first fix 'worked' unchanged as 'w.e_plot_station', as in recognised-under-extensions (with the dot), but not functioning fully (architect not listing module)

I'm impressed with your attention to detail!

As for the second fix attempt: thanks again, will try it and report! (But again, I can't guarantee speedy testing at the moment. XR has to be squeezed in between work, family and sleep ;-) )
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

CulunTse wrote:To clear the confusion about the '.'
Dots work under Linux basically the same as under Windows.
' My.file.txt' is recognised as text, ' my.file.txt.zip' is an archive

Specifically for XR: I also have the mod 'cf.missioncomputer' and that has always worked normally, so dots in mod names are ok.

I did remove the dot from the foldername in my first attempt ('we_plot_station', not a typo), but it shouldn't be a necessary change (W.Evans first fix 'worked' unchanged as 'w.e_plot_station', as in recognised-under-extensions (with the dot), but not functioning fully (architect not listing module)
Thanks for the clarification! Hopefully it is just the difference in case-sensitivity then. I'm hoping it isn't something more fundamental to how files are handled, or how the files in the linux beta are structured.
CulunTse wrote:I'm impressed with your attention to detail!
Yep, Sparky's cool.
CulunTse wrote:As for the second fix attempt: thanks again, will try it and report! (But again, I can't guarantee speedy testing at the moment. XR has to be squeezed in between work, family and sleep ;-) )
Will wait for your word.
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

Sorry to reply no-dice again :-(
Same symptoms: recognised, but no architect option.
Also the same debug-spew.

I double-checked that I used your new version (cat/dat dated june 16th)

I don't understand what can be different about SMUPS that causes this.
I run a heavily modded and most mods work without a hitch as far as I can tell.

The only thing that seems obvious is that most mods only change scripts, and SMUPS actually has 'new' assets.
Then again, I also run the Capital Ship Bridge, and that's very heavy on the new assets, isn't it?

Here's the list of my current mods that I have enabled, maybe you guys see a pattern?
(I have some more on my wishlist, but those have capitals in their foldername)
  • foldername (modname if not obvious)
  • 94a9f00a8a944ea08908f14a160bcb80 (Clean sidebar and main menu)
  • autolooter
  • betterlootmagnet
  • boarding options
  • butterranges
  • cf.mission_computer
  • craftvirtualseminars
  • ego_dlc_teladi_outpost (not tested yet)
  • engineer 100
  • exploration_light
  • fasterships
  • hullrepairlaser
  • litauen_betty_plus
  • litauen_boarding_plus
  • litauen_capital_ship_bridge
  • litauen_showbalance
  • litauen_stationannouncements
  • litauen_yisha_in_hiringfiring
  • lrs_update (Long range scanner update)
  • more crew
  • nidaren_ledda_construction
  • nidaren_scaldis_cargo_fix
  • nidaren_titurel_engine_fix
  • nomusicinhighways
  • npcsgainxp
  • outofmywayglitches
  • sensible miners (no idea if it's taking hold..)
  • showmeyourfactionplease
  • show skills
  • shutupren
  • taf
  • yorrickautotrade
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Thanks for the tip. Hopefully, attempt #3 should work.

The method by which new assets are added differs between Litauen's mod and this one. Probably should've gone that route in the first place. Better late than never.

edit: forgot to mention, just in case you paste this new version over the old one, please make sure that subst_01.cat and subst_01.dat are not present in the mod folder.

edit 2: although, come to think of it, shouldn't make a difference other than added load which isn't ever used.
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

There's more than one way to add assets? 0.o

I'll try v3 too, but you'll have to wait a bit longer. I won't have time tonight, and I'm out of town Fri-Sat-Sun. (On the train to work again, hurrah for 3G)

Sorry to keep you waiting, but think of it as a cliffhanger ;-)
(I'll mention again I'm very grateful for the support!)
Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp »

Walker, you're too kind - you're the brains in this relationship :)
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

Okay, so apparently I lied earlier and made time tonight (I'm going to hate myself in the morning ;-) )

It paid off!
I had a construction option for "Reconfigurable Materials Fabricator"
:D :o :D

Your original version 3 didn't work however.
Changes I made to get it working in bold (bold = state after my change)
Note, some of these edits may be superfluous, I didn't have time to do a proper bisect-testing to see which ones are unneccesary.
Note 2: Sorry for not using code-tags, but they broke my highlighting, so...

1) rename all folder paths to lowercase (I could do it because they're no longer packed in cat/dat, thanks!)
1a) w.e_plot_station/assets/structures/build_trees/macros
1b) w.e_plot_station/assets/structures/economy
1c) w.e_plot_station/assets/structures/economy/production/macros/struct_econ_prod_smups_rmp_macro.xml

2) update references to these paths in the various xmls
2a) index/macros.xml
<entry name="struct_econ_prod_smups_rmp_macro" value="extensions\w.e_plot_station\assets\structures\economy\production\macros\struct_econ_prod_smups_rmp_macro"></entry>

3) just to be on the cautious side: lowercase the macro-names
3a)
<add sel="//connection[@ref='ConnectionFor_struct_econ_prod_stor_container_macro']" pos="before">
<connection ref="ConnectionFor_struct_econ_prod_SMUPS_RMP_macro">
<build mode="optional" group="production" sequence="B" stage="1" tags="primary"/><macro ref="struct_econ_prod_smups_rmp_macro" connection="space"/>
</connection>
<connection ref="ConnectionFor_struct_econ_prod_SMUPS_RMP_macro1">
<build mode="optional" group="production" sequence="B" stage="2" tags="primary"/><macro ref="struct_econ_prod_smups_rmp_macro" connection="space"/>
</connection>
</add>

3) things left untouched: Connection Names seem to be safe with caps:

Code: Select all

<connection name="ConnectionFor_struct_econ_prod_SMUPS_RMP_macro1" group="stationGroup" tags="production">
--> perfectly OK

(I think this could mean my editting of the macro-names is unneccesary)

I hope that's a complete record, it's way past my bedtime, so I'm probably forgetting some of the changes I just made. However, I didn't want to leave you hanging until Monday after you've been so incredibly helpful, and especially quickly helpful.

As for your marital spat: stop it you guys, you're all awesome! :-)
I feel honoured to have such lofty kings/queens of the S&M thread pay attention to my ramblings :-)

oh hell, here is my zipped up current status, you can see for yourself :-)
http://s000.tinyupload.com/?file_id=258 ... 4607117382
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Oh man, missed your reply for two days. Sorry about that. And thanks!

Glad you got it working! Wasn't sure if I had to change things to lower-case since all of the paths should be consistent, and should then point to the right files. (Case-sensitivity shouldn't matter, because the cases should match.) But, oh well, I'll look through your changes, and I'll probably just upload your fix as an update.

Thanks for the feedback! A pleasure to troubleshoot (even kind of fun!) with such detailed reports.

edit: should I credit "Crunchy" or "CulunTse?"

edit2: also noticed from the report that you linked that you tried to get SmalltalkHack working. Probably the same problem with all of my mods, and easier to make compatible since I only added assets on this one.

Odd though. The only capitalized file or path in SmalltalkHack is \md\Smalltalk.xml, and that's just because it was capitalized in the vanilla cat/dats.

Unfortunately these next two weeks will be extremely hectic, but I'll try to work through the rest of the mods when I have time. If you, or anyone on the linux beta, want/s anything in particular made compatible in the meantime, let me know.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

20.Jun.2015 - v0.22 is up!

Linux compatibility fix. (Thanks Crunchy/CulunTse!)
CulunTse
Posts: 153
Joined: Mon, 15. Jun 15, 08:10
x4

Post by CulunTse »

Heh, that's okay, I told you not to expect anything, so that's totally my fault :-P
(Hurrah for Wi-Fi @ friend's house)

For the credits this double is perfectly fine. I love sowing a bit of confusionx

Your Smalltalk hack worked perfectly by the way. Perfect 5-bar scores even for the wildest misclicks. That jira bug report is for the EgoSoft side of things, where the visuals did not align with the hitboxes. Timon fixed that since, so I disabled your (perfectly working) mod again.
So it seems XML files can have capitals in them, just not assets? our maybe files can have caps, but not their parent folders?
I plan to do some more debugging on this, and post a mini-guide.

Thanks for bearing with me, and expect more posts from me on this theme :-)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

CulunTse wrote:So it seems XML files can have capitals in them, just not assets? our maybe files can have caps, but not their parent folders?
I really don't know at this point. Was confused by:
CulunTse wrote:1a) w.e_plot_station/assets/structures/build_trees/macros
1b) w.e_plot_station/assets/structures/economy
because the "M" and "E" in Macros and Economy respectively are capitalized in the vanilla cat/dats too. Would have expected that replacing the paths with small-case would cause path errors since they would be pointing to completely different directories. Unless the linux beta has a different set of cat/dats, or if everything packed in the archives are read as small-case ... or something else entirely.
CulunTse wrote:I plan to do some more debugging on this, and post a mini-guide.
Looking forward to it!
CulunTse wrote:Thanks for bearing with me, and expect more posts from me on this theme :-)
Glad to help.

_____
ps. Just noticed that I neglected to answer this query:
The Real Crunchy wrote:There's more than one way to add assets? 0.o
Yup, but seems to just be a pathing difference. Packing the new asset/s in a subst_xx.cat/dat makes it so that the file is read as if it's in the root folder of the game. Not packed, or packed in an ext_xx.cat/dat, then it's in the extensions subfolder. So, for example, with SMUPS:

with the new asset packed in a subst:
assets\structures\economy\production\macros\struct_econ_prod_smups_rmp_macro

with the new asset unpacked, or packed in an ext:
extensions\w.e_plot_station\assets\structures\economy\production\macros\struct_econ_prod_smups_rmp_macro

Note about it just being a pathing difference: I don't know of any other differences, but there could very well be some more. Used to be that the UI guys and gals packed their UI stuff in subst cat/dats because there was no official way to access the UI via extensions. So they had to find (a) way(s) to hook into the UI involving, I imagine, hand-waving and, possibly, chicken-entrails. (Ok, that part about entrails was a joke, but Lua's somewhat esoteric to me.) Now that it's officially supported, the UI can now be accessed from the extensions folder. (Also, the old method doesn't work anymore (part of the compatibility problem with relatively old mods like UFO which otherwise works perfectly).)

Return to “X Rebirth - Scripts and Modding”