Page 2 of 2

Re: Question about modding the preBuiltArt

Posted: Thu Nov 07, 2019 5:54 pm
by sven
Beetlezombie wrote:I have Photoshop collecting dust atm on my system, so now is a great time to figure all this out.


Ok, so if you're going to go down this particular rabbit hole, there are 2 pieces that you're missing. One is the .jsx extendscript tools that I use to drive the imports. Um, I'd actually intended to include these as an undocumented feature inside the main game install, but, it looks like I never got around to actually adding them to my distro scripts. In any case, here's a link to the files. Unzip those in Lua state\Drawers\ImportDrawer, and there's a chance that the import scripts may actually start working for you.

The other piece you're missing is an example of what the Photoshop master files should actually look like. Here's a couple examples.

With those, an import script like ImportDrawer/batch_ship_import.lua might start to make sense....

Um, if you're going to try using batch_ship_import.lua, you'll need to change all the import and export dir data at the top of the file to point to locations that exist on your own machine, and then put your psds inside the asset_dir. The add a "ship_import rebuild_drawer 'HawkCA'"or whatever to the messy codeblock that starts on line 104 -- and save the file while the game is running and Photoshop is open. If all is working, Photoshop will open up HawkCA.psd from your asset dir, save all the layers to psd_export_dir, and then use export_dir as a temporary directory to process all the image data, until generating a final export in layers_dir. That layers_dir content should then be ready to be copied into Drawers\Ships\HawkCA\layers.

Best of luck :)

Re: Question about modding the preBuiltArt

Posted: Thu Nov 07, 2019 8:03 pm
by gaerzi
I don't have Photoshop, but GIMP can open and save .psd files. Basically what PS needs to do is to save each layer as a separate image in psd_export_dir? It can be done semi-manually with this. Then the rest of the script can be adapted, just remove the Photoshop-referencing parts, right?

Re: Question about modding the preBuiltArt

Posted: Thu Nov 07, 2019 8:35 pm
by sven
gaerzi wrote:I don't have Photoshop, but GIMP can open and save .psd files. Basically what PS needs to do is to save each layer as a separate image in psd_export_dir? It can be done semi-manually with this. Then the rest of the script can be adapted, just remove the Photoshop-referencing parts, right?


Not exactly. The export layers scripts don't just export the layers themselves, they also create layers.table files that store all the blend mode, clipping, and layer opacity info. If you're working with GIMP, you'd need to either write those files by hand (possible, but a little tedious), or hack GIMP's export layers functionality to do the same thing as my JSX scripts. (Might actually be easy, for someone who's really familiar with GIMP. Probably not worth the trouble for anyone else though.)

Re: Question about modding the preBuiltArt

Posted: Fri Nov 08, 2019 12:45 pm
by Beetlezombie
I've set everything up, and decided to try first with one of your psd files you provided, but I keep having this error. I probably messed up a path somewhere, but I can't seem to find where ...

It creates all the folders correct until HawkCA

This is the error:

Code: Select all

Lua state\@@util\catdir.lua:73: invalid directory: C:\SISoutput\graphics\batch01\psd_export\HawkCA
Lua state\@@util\catdir.lua:73:copy_dir:
 Lua state\Drawers\ImportDrawer\batch_ship_import.lua:60:ship_import:HawkCA:
  Lua state\Drawers\ImportDrawer\batch_ship_import.lua:106


This is the code in batch_ship_import.lua

Code: Select all

local working = 'batch01'

layers_dir = [[C:\SISoutput\graphics\]] .. working .. [[\layers]]
export_dir = 'C:/SISoutput/graphics/' .. working .. '/export'
psd_export_dir = 'C:/SISoutput/graphics/' .. working .. '/psd_export'
asset_dir = 'C:/SISoutput/graphics/sis_assets'

Re: Question about modding the preBuiltArt

Posted: Fri Nov 08, 2019 6:11 pm
by sven
Beetlezombie wrote:I've set everything up, and decided to try first with one of your psd files you provided, but I keep having this error. I probably messed up a path somewhere, but I can't seem to find where ...


Oh, no, I just gave you bad instructions.

Of the various helper function, it's 'rebuild_drawer' that does a fresh export from PSD, followed by an import of the exported layers to my layer format. 'ship_import', meanwhile, assumes that the export from PSD is already done, and just tries to import the raw layer data. Um, so using ship_import on a drawer that you haven't yet run an export on will be a bug (because the PSD data has never been exported).

Short answer: try switching 'ship_import' to 'rebuild_drawer'.

Re: Question about modding the preBuiltArt

Posted: Fri Nov 08, 2019 10:28 pm
by Beetlezombie
sven wrote:
Beetlezombie wrote:I've set everything up, and decided to try first with one of your psd files you provided, but I keep having this error. I probably messed up a path somewhere, but I can't seem to find where ...


Oh, no, I just gave you bad instructions.

Of the various helper function, it's 'rebuild_drawer' that does a fresh export from PSD, followed by an import of the exported layers to my layer format. 'ship_import', meanwhile, assumes that the export from PSD is already done, and just tries to import the raw layer data. Um, so using ship_import on a drawer that you haven't yet run an export on will be a bug (because the PSD data has never been exported).

Short answer: try switching 'ship_import' to 'rebuild_drawer'.


Yep, that did the trick. Works like a charm :ugeek: Thanks a million for your help and time!

Well ... into the rabbithole I go ... This opens up a ton of possibilities. To many I believe. Just dabbled a bit in themePalettes.lua and other assorted files (UniversalPallete etc), and my god, the system you built really is extensive. And now with the tools you provided. I'll be real honest here, when I bought the game I never imagined it had so much modding potential.