SC4 Devotion Forum Archives

Sim City 4 Devotion Tools => Tools - General Discussion => null45's Tools => Topic started by: null45 on May 02, 2010, 08:48:39 PM

Title: Multi Fsh Tool
Post by: null45 on May 02, 2010, 08:48:39 PM
This is a tool that I wrote to create multi-image textures.
It can also add images to a fsh file in an existing dat.

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg440.imageshack.us%2Fimg440%2F9015%2Fmultifsh75.png&hash=01fc5df012db15dae40625b85e856ae15495881a) (https://www.dropbox.com/s/c6ziy5me2r3zhj1/MultiFsh75.png?raw=1)

If no image exists clicking the "Add" button or dragging and dropping a group of images onto it will create a new image adding all the selected bitmaps.

If the file name begins with 0x it will use the file name as the Instance.

If a dat has been loaded and the image to modify has been selected from the list additional images may then be added to the fsh using the "Add" button.
The "Generate new Instances" option generates new instance id when saving into an existing dat, if it is not checked it will overwrite the existing files.

Additional documentation is in the Readme.

Download: Multi Fsh Tool (http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=2371)
Title: Re: Multi Fsh Tool
Post by: Diggis on May 03, 2010, 03:52:29 AM
Null, this looks like a great too.  Could I suggest you look at maybe allowing it to assign the IID based on a text file similar to the SC4tool?
Title: Re: Multi Fsh Tool
Post by: null45 on May 03, 2010, 02:32:36 PM
It already has that ability using a file named "instRange.txt" in the same directory as the program.

A bug in the Instance range loading fixed and "instRange.txt" has been added to the zip.

File version updated to 1.2.2.7.   :thumbsup:
Title: Re: Multi Fsh Tool
Post by: Diggis on May 04, 2010, 12:15:37 AM
Wicked!  :thumbsup:  I'll take a look at this soon.

On another note, does this have the ability to read the Alpha straight out of the PNG?  or do you still need an alpha png?  And can it still read an alpha png as well?
Title: Re: Multi Fsh Tool
Post by: null45 on May 04, 2010, 12:24:04 PM
It would use the alpha from the png if the Alpha text box is empty and it has not found a file named like "filename_a.png" in the same directory as the image.

If the image is not a 32-bit png then the alpha map should use the "filename_a.png" format.  ;)
Title: Re: Multi Fsh Tool
Post by: wes.janson on May 06, 2010, 09:10:22 AM
I'm in the process of recompiling a SAM set I have done and man.. this tool makes things SOOO much easier.

The time alone has been cut easily more than half.

Thanks Null45!  &apls
Title: Re: Multi Fsh Tool
Post by: null45 on June 23, 2010, 09:58:05 PM
Fixed a bug in the generation of Mipmaps on Windows 7, File version updated to 1.2.2.8. :thumbsup:
Title: Re: Multi Fsh Tool
Post by: null45 on July 20, 2010, 06:46:57 PM
The "Save dat" function will now save Fshwrite compressed files correctly.
A bug with the "Load dat" listing images smaller then 128x128 fixed.

File version updated to 1.2.2.9.  ;)
Title: Re: Multi Fsh Tool
Post by: null45 on August 19, 2010, 10:45:18 PM
Mipmap scaling quality improved, File version updated to 1.3.0.0  :)
Title: Re: Multi Fsh Tool
Post by: vortext on July 04, 2011, 09:03:07 AM
sorry for the bump. The tool works fine but when using a multi-fsh in the PIMx it cannot be applied to the lot and instead the program gives the following message:

Traceback (most recent call last):
  File "wx\_misc.pyo", line 1342, in Notify
  File "BalloonTip.pyo", line 636, in NotifyTimer
  File "SC4LETools.pyo", line 368, in OnBalloonPopup
  File "Image.pyo", line 517, in tostring
SystemError: tile cannot extend outside image

My best guess is it has to do with the interface, since the PIM usually displays all textures within a multi-fsh. I already found a simple work-around (using a single fsh texture with the same instance) so it's not a huge problem but still wanted to let you know.   
Title: Re: Multi Fsh Tool
Post by: null45 on July 04, 2011, 09:54:14 PM
This issue would probably belong in the PIMx support thread, both The Reader and FiSHMan have no problem reading the fsh files so I have no idea what the problem could be.  &mmm
Title: Re: Multi Fsh Tool
Post by: vortext on July 10, 2011, 10:13:24 AM
yeah, after posting I realised your program might have nothing to do with it, posted the issue in the PIMx thread. By the way, your tools are among the finest out there, I use them all the time, thank you so much  :thumbsup:
Title: Re: Multi Fsh Tool
Post by: Lowkee33 on July 29, 2011, 07:08:55 PM
Hi Null45.  Just learned about this one, thanks for the great tool!

I am confused about how to enter the Texture range.  All I see in the readme is that it is the same as SC4Tool, and I don't know how to do it for that either.
Title: Re: Multi Fsh Tool
Post by: null45 on July 30, 2011, 12:20:34 AM
Quote from: Lowkee33 on July 29, 2011, 07:08:55 PM
Hi Null45.  Just learned about this one, thanks for the great tool!

I am confused about how to enter the Texture range.  All I see in the readme is that it is the same as SC4Tool, and I don't know how to do it for that either.

Quote from: geoffhaw on August 20, 2007, 02:43:48 PM
If you want to make SC4Tool automatically allocate IIDs from your personal range, do the following:

Create a txt file and save it as Range.txt and put it into the System folder of SC4Tools.  Say your range is 0xB2C80000 to 0xB2CFFFFF, it would need to be the following:

0xb2c80000,0xb2cfffff

After that, every time you open the Texture Creator part of SC4Tools, it will only allocate IIDs from your range. I would advise everyone to keep a list of which IIDs you have used, as it will be very useful after a while.

The same instructions apply to this tool except the file is named "instRange.txt".  :thumbsup:
Title: Re: Multi Fsh Tool
Post by: Lowkee33 on July 30, 2011, 06:37:05 AM
Aha, comma, thanks.
Title: Re: Multi Fsh Tool
Post by: null45 on December 09, 2011, 08:18:03 PM
The fsh files are now loaded using my own code, this is faster than FSHLib and allows the DXT1 alpha to be loaded correctly.
Additionally the instance ids that end with 0, 5 or A and are larger than 64x64 are now displayed when a dat is loaded.

The dat loading progress is now shown in the Windows 7 taskbar, and JumpList support added for the recently loaded dat files.

The .NET Framework 3.5 Client profile (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14037) is required for Window Vista and XP.

File version updated to 1.3.0.2.  ;)

Title: Re: Multi Fsh Tool
Post by: null45 on January 11, 2012, 03:02:40 PM
A regression in the dat saving fixed, File version updated to 1.3.0.3.  :)
Title: Re: Multi Fsh Tool
Post by: vortext on January 11, 2012, 03:05:32 PM
 ()what() Is it necesarry to reinstall?
Title: Re: Multi Fsh Tool
Post by: null45 on January 11, 2012, 03:28:59 PM
You could just replace FshDatIO.dll, and Multifshview.exe, but it is probably easier to just overwrite the whole folder.
I am kind of surprised the fact that compression directories and new files added to the dat were never being saved was not caught during testing of the last version.  ::)
Title: Re: Multi Fsh Tool
Post by: null45 on January 20, 2012, 02:22:57 PM
A resize bug with images that are not 128x128 or larger fixed, file version updated to 1.3.0.4.
Title: Re: Multi Fsh Tool
Post by: null45 on January 27, 2012, 08:36:03 PM
A few more bugs in the dat saving code fixed, file version updated to 1.3.0.5. :thumbsup:
Title: Re: Multi Fsh Tool
Post by: null45 on April 10, 2012, 12:20:36 AM
The export Alpha button has been fixed, HD images can now be any size instead if only 256x256 or larger.

File version updated to 1.3.0.6.
Title: Re: Multi Fsh Tool
Post by: null45 on May 12, 2012, 08:34:08 PM
Added support for embedded mipmaps, file version updated to 1.3.0.7.  ;)
Title: Re: Multi Fsh Tool
Post by: Lowkee33 on May 13, 2012, 07:22:14 AM
 :thumbsup:
Title: Re: Multi Fsh Tool
Post by: NCGAIO on May 13, 2012, 03:40:03 PM
 ;D  ;D  ;D  ;D  ;D  ;D  ;D

:thumbsup: Great as always ... thanks!
Title: Re: Multi Fsh Tool
Post by: null45 on May 29, 2012, 03:47:55 PM
Fixed a mipmap generation bug, file version updated to 1.3.0.8.
Title: Re: Multi Fsh Tool
Post by: Swordmaster on September 23, 2012, 08:16:58 AM
I'm having some problems creating base textures with this. For some reason, I always end up with overlay textures, even though I don't add an alpha. I thought selecting DXT1 would solve it, but it simply creates a white overlay. I use this setup:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi1204.photobucket.com%2Falbums%2Fbb419%2Fswm666%2Fmisc%2Fmultifish_zps1b8e2c3f.jpg&hash=d7c74a7424c08863b5086923f5589284e6d8225a)

Any thoughts on what I'm doing wrong?


Cheers
Willy
Title: Re: Multi Fsh Tool
Post by: vortext on September 23, 2012, 09:07:30 AM
Yeah, the same thing happens to me from time to time and usually the textures still contain transparancy. If you use Photoshop make sure base textures are set as 'background', while overlays are set as a 'layer'. Otherwise seach around how this is done in the software you're using. Hope this helpes.  :)
Title: Re: Multi Fsh Tool
Post by: Swordmaster on September 23, 2012, 09:34:00 AM
Quote from: vortext on September 23, 2012, 09:07:30 AM
Yeah, the same thing happens to me from time to time and usually the textures still contain transparancy. If you use Photoshop make sure base textures are set as 'background', while overlays are set as a 'layer'. Otherwise seach around how this is done in the software you're using. Hope this helpes.  :)

Never figured the textures themselves to be the problem - great tip. Turns out I needed to remove the alpha channel. Thanks!

Cheers
Willy
Title: Re: Multi Fsh Tool
Post by: null45 on April 10, 2013, 11:10:32 PM
Fixed a crash when reading the instance range, file version updated to 1.3.1.0.
Title: Re: Multi Fsh Tool
Post by: null45 on August 01, 2014, 10:02:53 PM
Added support for preserving existing attachments within a fsh file, file version updated to 1.3.1.1.
Title: Re: Multi Fsh Tool
Post by: null45 on November 21, 2014, 02:17:46 AM
Fixed a regression in 1.3.1.1.
Title: Re: Multi Fsh Tool
Post by: vortext on March 15, 2015, 06:43:28 AM
Ran into a puzzling issue: I have one specific texture which generates the following error :

(https://dl.dropbox.com/s/bonaf6ral11gpb6/multifsherror.JPG?dl=0)

I'm using four 256px pngs as input and afaik they have no discernible difference from the other ~30 textures I did so far, nor am I doing anything different.

Also note I'm using version 1.3.0.0. I tried using version 1.3.1.3 this morning but no matter what I try it says 'an invalid header was read' right after selecting the pngs for a new fsh. &mmm

Title: Re: Multi Fsh Tool
Post by: null45 on March 15, 2015, 09:06:18 AM
The first error is caused when a file cannot be compressed, this should be fixed in 1.3.1.3.
The second error appears to be some kind of issue with reading the header of the new FSH. &mmm
Could you upload the PNG files which cause both errors?
Title: Re: Multi Fsh Tool
Post by: vortext on March 15, 2015, 09:39:24 AM
Sure, here're the offending textures (https://www.dropbox.com/sh/io1mzp3euzixiwb/AABerzLelSFXoObcco4Ib1Nca?dl=1) which cause the first error, also included the original .psd for good measure.

The second error happens for all the textures, including the uploaded. So far I tried 128px and 256px, base and overlay but it doesn't make a difference: it reads an invalid header every time. I'm on vista 32bit if that matters.
Title: Re: Multi Fsh Tool
Post by: null45 on March 15, 2015, 10:50:52 PM
That crash and a few potential dat corruption issues have been fixed in 1.3.2.0.
Title: Re: Multi Fsh Tool
Post by: vortext on March 16, 2015, 11:21:07 AM
Now it won't even open at all.  :(

Beschrijving:
  Stopped working

Probleemhandtekening:
  Gebeurtenisnaam van probleem: CLR20r3
  Probleemhandtekening 01: multifshview.exe
  Probleemhandtekening 02: 1.3.2.0
  Probleemhandtekening 03: 54eddd37
  Probleemhandtekening 04: Multifshview
  Probleemhandtekening 05: 1.3.2.0
  Probleemhandtekening 06: 54eddd37
  Probleemhandtekening 07: 89
  Probleemhandtekening 08: b
  Probleemhandtekening 09: System.IO.FileLoadException
  Versie van besturingssysteem: 6.0.6001.2.1.0.768.3
  Landinstelling-id: 1043


'Probleemhandtekening' translates as problem signature. Last two lines are OS version and country id respectively.
Title: Re: Multi Fsh Tool
Post by: null45 on March 16, 2015, 06:22:30 PM
That crash is caused by a DLL version issue, I forgot to copy the new DLLs when releasing 1.3.2.0.  &ops
Fixed in 1.3.2.1.
Title: Re: Multi Fsh Tool
Post by: vortext on March 17, 2015, 10:46:57 AM
No worries, we know you're always fast to fix issues and this time is no different. Everything works as intended. Thanks! :thumbsup: 
Title: Re: Multi Fsh Tool
Post by: Simcoug on March 17, 2015, 11:04:05 AM
Quote from: vortext on March 17, 2015, 10:46:57 AM
No worries, we know you're always fast to fix issues and this time is no different. Everything works as intended. Thanks! :thumbsup:

Hurray!  Hopefully this means Vortextures 1.0 will be hitting the LEX soon  ;D
Title: Re: Multi Fsh Tool
Post by: null45 on July 19, 2016, 01:14:55 AM
Fixed a bug with PNG files always being detected as having transparency, file version updated to 1.3.2.2.
Title: Re: Multi Fsh Tool
Post by: null45 on August 27, 2017, 06:40:40 AM
Fixed a distortion bug when the image thumbnails are different sizes.
Fixed a duplicate file bug when modifying images in a loaded dat.

File version updated to 1.3.3.0.