Results 1 to 16 of 16

Thread: Sprite problem!

  1. #1
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39

    Question 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?
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  2. #2
    Prince
    Join Date
    12 Aug 2000
    Location
    Wollongong, Australia
    Posts
    409
    Country
    This is Catfish's Country Flag

    Local Date
    May 24, 2012
    Local Time
    21:39
    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).
    Attached Images Attached Images

  3. #3
    King fairline's Avatar
    Join Date
    22 Sep 2002
    Location
    of the wing
    Posts
    2,058
    Country
    This is fairline's Country Flag

    Local Date
    May 24, 2012
    Local Time
    13:39
    C'mon, release it Catfish!

  4. #4
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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?
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  5. #5
    Prince
    Join Date
    12 Aug 2000
    Location
    Wollongong, Australia
    Posts
    409
    Country
    This is Catfish's Country Flag

    Local Date
    May 24, 2012
    Local Time
    21:39
    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.

    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.

  6. #6
    Emperor Mercator's Avatar
    Join Date
    31 Dec 1969
    Posts
    3,086
    Country
    This is Mercator's Country Flag

    Local Date
    May 24, 2012
    Local Time
    13:39
    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).
    Attached Files Attached Files

  7. #7
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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!
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  8. #8
    Prince
    Join Date
    12 Aug 2000
    Location
    Wollongong, Australia
    Posts
    409
    Country
    This is Catfish's Country Flag

    Local Date
    May 24, 2012
    Local Time
    21:39
    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.

    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.

  9. #9
    King fairline's Avatar
    Join Date
    22 Sep 2002
    Location
    of the wing
    Posts
    2,058
    Country
    This is fairline's Country Flag

    Local Date
    May 24, 2012
    Local Time
    13:39
    Originally posted by 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.
    Who is? I make exceptions for stuff I've been waiting years for though; I'll send a PM

  10. #10
    King fairline's Avatar
    Join Date
    22 Sep 2002
    Location
    of the wing
    Posts
    2,058
    Country
    This is fairline's Country Flag

    Local Date
    May 24, 2012
    Local Time
    13:39
    Originally posted by Mercator
    Surprise!
    Nice one

  11. #11
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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?
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  12. #12
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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:
    Attached Images Attached Images
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  13. #13
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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!
    Attached Images Attached Images
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  14. #14
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    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).
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

  15. #15
    Emperor Mercator's Avatar
    Join Date
    31 Dec 1969
    Posts
    3,086
    Country
    This is Mercator's Country Flag

    Local Date
    May 24, 2012
    Local Time
    13:39
    Originally posted by Catfish
    That'd be bloody right - wait until I've finished all my stuff and then release the practical version.
    Sorry!

    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!


    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.

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

  16. #16
    Prince GhostOfDisco's Avatar
    Join Date
    30 May 2001
    Location
    The People's Republic of Obamastan
    Posts
    962
    Country
    This is GhostOfDisco's Country Flag

    Local Date
    May 24, 2012
    Local Time
    07:39
    Actually, I sorta figutred that one out on my own.
    Attached Images Attached Images
    The Ghost of the Disco is ... your mastermind, your mastermind!
    2013: A Union Divided|John III Sobieski|Red Storm

Similar Threads

  1. Kelp sprite
    By J Bytheway in forum CtP2-Creation/AI/Mods/Scenarios-Archive
    Replies: 5
    Last Post: June 9, 2002, 19:56
  2. Sprite Editor?
    By Pedrunn in forum CtP2-Creation/AI/Mods/Scenarios-Archive
    Replies: 1
    Last Post: June 5, 2002, 15:00
  3. Sprite Editing
    By Grey_Ink in forum Call to Power 1
    Replies: 8
    Last Post: January 14, 2002, 21:09
  4. Alternate Scifi sprite problem
    By Paranoia in forum CtP2-Creation/AI/Mods/Scenarios-Archive
    Replies: 2
    Last Post: February 7, 2001, 15:49

Visitors found this page by searching for:

mercator civsprite

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •