March 17, 2008, 10:32
|
#1
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Sprite problem!
Having a problem with sprites and such...
Now, as we all know, the ToT sprite files can be used to hide unit health bars (as has been done many times) and to give units tribe colors via masks (which has not been done in any released scenario to my knowledge). Well, in my Sobieski scenario I'd like both - there are at least two units whose bars I want hidden (Austrian Frontier and Turkish Camp), and one who I want to display civ colors (Cossacks). To get the first type, I created a Static.spr file using SpriteGen (though I forgot about the Turkish Camp - I'll have to redo it, but that's not that big a deal.) So, when I want to put the Cossack unit and his mask into the game, I'm thinking "OK then, I'll just import the .msk and .img BMPs into the Static.spr file with CivSprite." Problem is, when I do try to import, no matter what I do I get and error and this message: "Subscript out of range." Is what I want (a file with both no-bar units and barred, civ-colored units) impossible? Hopefully not. Any advice on what to do?
|
|
|
|
March 17, 2008, 11:35
|
#2
|
|
Prince
Local Time: 06:43
Local Date: February 10, 2010
Join Date: Aug 2000
Location: Wollongong, Australia
Posts: 332
|
No, it's not impossible (see attachment), but it's a pain in the arse. You need to use CivSprite (only) as SpriteGen can't handle masks (Boco and I have asked for this feature in the past). To hide the health bar using CivSprite you need to manually increase the heights of a unit's icon graphics (to 768 pixels generally) for each of the 5 orientations before running the program. Edit: Oh and CivSprite can't handle SpriteGen's single-frame format sprites (as you discovered).
Last edited by Catfish; March 17, 2008 at 12:03.
|
|
|
|
March 17, 2008, 13:02
|
#3
|
|
King
Local Time: 19:43
Local Date: February 9, 2010
Join Date: Sep 2002
Location: of the wing
Posts: 2,009
|
C'mon, release it Catfish!
|
|
|
|
March 17, 2008, 14:03
|
#4
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Well, making five frame bmps and their corresponding masks doesn't seem that much of a problem ... but how to you make the dummy .spr file?
|
|
|
|
March 17, 2008, 17:03
|
#5
|
|
Prince
Local Time: 06:43
Local Date: February 10, 2010
Join Date: Aug 2000
Location: Wollongong, Australia
Posts: 332
|
|
Quote:
|
Originally posted by fairline
C'mon, release it Catfish!
|
I'm trying to give Duke Nukem Forever a run for its money.  For the record, I'm not working on or playing Civ2 at all at the moment. I'm only (occasionally) answering ToT questions in the forums. WotR is basically a complete scenario; I'm just not entirely satisfied with some aspects of it - and I'm not as enthusiastic about the game as I was a few years ago. If you want to take a look at it, PM me and I'll see what I can do.
|
Quote:
|
Originally posted by GhostOfDisco
Well, making five frame bmps and their corresponding masks doesn't seem that much of a problem ... but how to you make the dummy .spr file?
|
How does that help?  FYI, it was done by hex-editing an existing resource.spr file, using the information in this thread. That's the thread where I'm figuring out how ToT's animated sprite settings work and how to fix them.
|
|
|
|
March 17, 2008, 17:25
|
#6
|
|
Emperor
Local Time: 20:43
Local Date: February 9, 2010
Join Date: Dec 1969
Posts: 3,075
|
Surprise!
It turns out adding mask support was kinda easy to add.
The mask file should be in XXX_mask.bmp, where XXX corresponds to the name of your units bitmap. E.g. Units1.bmp needs Units1_mask.bmp for masks.
The mask is also a true color (24-bit) bitmap, with the same layout as the units.bmp itself. The only difference is that the units should be all black. Any pixel that isn't black will be turned into a tribe color (same as with CivSprite's individual mask images), but it's best to stick to black & white.
I attached an example for the Original game. I changed the colour of the Settler's cap and waistband, the Engineer's coat, the Warrior's shield and the Fighter's wings and hull.
Before you can try that example out, you will have to re-save the Original game's units bitmap as a 24-bit bitmap (SpriteGen can't handle ToT's 16-bit bitmaps). Opening it and saving it again with MS Paint probably does the trick (though you might want to keep a backup!).
Now copy the units_mask.bmp to your Original game folder, open the Original game's units.bmp in SpriteGen, hit OK and see the result in ToT (SpriteGen automatically backs up your Static.spr).
|
|
|
|
March 17, 2008, 18:46
|
#7
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
|
Quote:
|
Originally posted by Catfish
How does that help?
|
Well, I'd thought a blank .spr file would be good to upload new stuff to, or something.
Apparently, I was wrong in that regard.
Kudos on the "easy" mode of adding civ colors, Mercator!
|
|
|
|
March 18, 2008, 03:20
|
#8
|
|
Prince
Local Time: 06:43
Local Date: February 10, 2010
Join Date: Aug 2000
Location: Wollongong, Australia
Posts: 332
|
|
Quote:
|
Originally posted by Mercator
Surprise!
|
That'd be bloody right - wait until I've finished all my stuff and then release the practical version.  Anyway, I tested it for WotR, if not just to cut down the file size of static.spr by excluding all those extra frames (166 kB → 35 kB). Works a charm. Thanks Merc.
|
Quote:
|
Originally posted by GhostOfDisco
Well, I'd thought a blank .spr file would be good to upload new stuff to, or something.
|
The dummy file contains no frames, not blank ones. It'd be no use for importing unit bitmaps. The masks/health bars procedure should be a piece of cake now with the new version of SpriteGen.
Last edited by Catfish; March 18, 2008 at 03:57.
|
|
|
|
March 18, 2008, 05:16
|
#9
|
|
King
Local Time: 19:43
Local Date: February 9, 2010
Join Date: Sep 2002
Location: of the wing
Posts: 2,009
|
|
Quote:
|
Originally posted by Catfish
I'm trying to give Duke Nukem Forever a run for its money.
|
|
Quote:
|
For the record, I'm not working on or playing Civ2 at all at the moment.
|
Who is?  I make exceptions for stuff I've been waiting years for though; I'll send a PM
|
|
|
|
March 18, 2008, 05:17
|
#10
|
|
King
Local Time: 19:43
Local Date: February 9, 2010
Join Date: Sep 2002
Location: of the wing
Posts: 2,009
|
|
Quote:
|
Originally posted by Mercator
Surprise!
|
Nice one
|
|
|
|
March 18, 2008, 09:29
|
#11
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
I'll try the SpriteGen mask thing.
Though, is it possible, after doing the "color" thing, to go in again and hide the bars for some/other units without undoing your previous work?
|
|
|
|
March 18, 2008, 11:20
|
#12
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Well, I downloaded SpriteGen 1.1 and tried the mask thing ... It seems to have not worked.
I'm wondering ... can you do the mask for some units, and hide for others? I know I had a 24-bit units.bmp in my folder, plus a mask file, and it made a static.spr file, but when I looked at the Cossacks, well, they weren't in the unit colors as I hoped:
|
|
|
|
March 18, 2008, 11:35
|
#13
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Tried it again, this time deciding to remove the Cossack health bars, if that's what it takes to give them masks.
Again, no masks, and the only unit who's bar is hidden is the Austrian Frontier!
|
|
|
|
March 18, 2008, 11:40
|
#14
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Well, I don't know what I'm doing wrong, but if anyone want a crack at it, here's the Sobieski units file (and mask).
|
|
|
|
March 18, 2008, 15:15
|
#15
|
|
Emperor
Local Time: 20:43
Local Date: February 9, 2010
Join Date: Dec 1969
Posts: 3,075
|
|
Quote:
|
Originally posted by Catfish
That'd be bloody right - wait until I've finished all my stuff and then release the practical version.
|
Sorry!
|
Quote:
|
Anyway, I tested it for WotR, if not just to cut down the file size of static.spr by excluding all those extra frames (166 kB → 35 kB). Works a charm. Thanks Merc.
|
Excellent!
|
Quote:
|
Originally posted by GhostOfDisco
I'm wondering ... can you do the mask for some units, and hide for others?
|
Yes. Masks and hiding work independently from each other. The tickboxes control the health bar hiding; the mask bitmap controls the masks.
|
Quote:
|
I know I had a 24-bit units.bmp in my folder, plus a mask file, and it made a static.spr file, but when I looked at the Cossacks, well, they weren't in the unit colors as I hoped:
(...)
|
Strange... It worked just fine for me with the files you provided.
Does my attachment work? It uses your mask file, and the health bars of that tent thing and the entrenched units are hidden.
(Oh, and by the way, you forgot the top-left transparent pixel on some of your units.)
|
|
|
|
March 18, 2008, 16:33
|
#16
|
|
Prince
Local Time: 13:43
Local Date: February 9, 2010
Join Date: May 2001
Location: The People's Republic of Obamastan
Posts: 892
|
Actually, I sorta figutred that one out on my own.
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
All times are GMT -4. The time now is 15:43.
|