Announcement

Collapse
No announcement yet.

Sprite problem!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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 Files
    Last edited by Catfish; March 17, 2008, 12:03.
    Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

    Comment


    • #3
      C'mon, release it Catfish!
      http://sleague.apolyton.net/index.ph...ory:Civ2_Units

      Comment


      • #4
        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

        Comment


        • #5
          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.
          Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

          Comment


          • #6
            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
            Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

            Comment


            • #7
              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

              Comment


              • #8
                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.
                Last edited by Catfish; March 18, 2008, 03:57.
                Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

                Comment


                • #9
                  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
                  http://sleague.apolyton.net/index.ph...ory:Civ2_Units

                  Comment


                  • #10
                    Originally posted by Mercator
                    Surprise!
                    Nice one
                    http://sleague.apolyton.net/index.ph...ory:Civ2_Units

                    Comment


                    • #11
                      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

                      Comment


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

                        Comment


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

                          Comment


                          • #14
                            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

                            Comment


                            • #15
                              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
                              Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                              Comment

                              Working...
                              X