Question about modding the preBuiltArt

A place for discussion of making game modifications.
User avatar
sven
Site Admin
Posts: 1560
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Question about modding the preBuiltArt

Postby sven » Thu Nov 07, 2019 5:54 pm

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

gaerzi
Posts: 81
Joined: Wed Jul 10, 2019 1:30 pm

Re: Question about modding the preBuiltArt

Postby gaerzi » Thu Nov 07, 2019 8:03 pm

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?

User avatar
sven
Site Admin
Posts: 1560
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Question about modding the preBuiltArt

Postby sven » Thu Nov 07, 2019 8:35 pm

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

Beetlezombie
Posts: 9
Joined: Sun Nov 03, 2019 2:51 pm

Re: Question about modding the preBuiltArt

Postby Beetlezombie » Fri Nov 08, 2019 12:45 pm

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'

User avatar
sven
Site Admin
Posts: 1560
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Question about modding the preBuiltArt

Postby sven » Fri Nov 08, 2019 6:11 pm

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

Beetlezombie
Posts: 9
Joined: Sun Nov 03, 2019 2:51 pm

Re: Question about modding the preBuiltArt

Postby Beetlezombie » Fri Nov 08, 2019 10:28 pm

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.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 0 guests