Announcement

Collapse
No announcement yet.

Unit Modding madness....

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

  • Unit Modding madness....

    I`m adding a few units to the Default Apolyton mod, notably in the aerial department with an Attack helicopter and a combat UAV to spice up the otherwise lack lusture aerial units.

    Anyway as far as i know I have done everything I should have done with regards sprites, icons, newsprite.txt and uniticon.txt.

    Now what I considered the easy part , APOL_units.txt is actually the problem.

    When i spark up CTP it crashes telling me "Expected String ID 4242 "etc then goes through alist of fields that it thinks should be there and isn't (such as attack points, shield cost and so forth)

    I beg to differ but arguing with a computer gets you now-where.

    Can anyone point me in the right direction?

  • #2
    Can you attach the file?
    "Kill a man and you are a murder.
    Kill thousands and you are a conquer.
    Kill all and you are a God!"
    -Jean Rostand

    Comment


    • #3
      sounds like you have a } missing at the end of one of the unit records, or one too many or something. check them all. There should be a { at the end of the UNIT_*** line, and then one } for every { thereafter, and a } before the beginning of the next unit record.
      Concrete, Abstract, or Squoingy?
      "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

      Comment


      • #4
        I tried going over the code with a fine toothed code and i still can`t see anything wrong with it. Mind you I`m not a programmer, I don`t have the patience for it so a more trained eye might find something..
        Attached Files

        Comment


        • #5
          It's line number 4242: "Description DESCRIPTION_UNIT_COMBAT_UAV" and line number 4298 "Description DESCRIPTION_UNIT_ATTACK_HELICOPTER". IIRC, these descriptions are not actually used by the game but have to be some existing description, e.g. DESCRIPTION_UNIT_WARRIOR.

          BTW, what's a COMBAT_UAV and what sprite are you using?

          Comment


          • #6
            Unmanned Aerial Vehicle. Basically a fighter (I think I used Crousto`s EuroFighter 2000 thats on this sight somewhere.

            The advantage of a UAV is that its cheaper than a piloted craft (no life support, ejection seat etc) no pilots can be shot down and used as bargining by the enemy and can pull manuovres (sic) that would knock a human out.

            Its a rough sketch anyway as I have to see how it pans out (its giving an error message somewhere in the attack copter text now

            Comment


            • #7
              Does anybody else have as much trouble as me tweaking CTP:II !

              Anyway the latest glitch is that when I click into the cheat mpde and go to play around with my units the game crashes without any (vaguely) helpful error message.

              I`m guessing its some cockup with the tga files and seeing as i can't seem to edit or even view said files I`m a little stumped.

              I`ve attached the relevant files and hope some1 can help me. On the plus side my pain should help others who want to mod

              (Oh and if anyone can explain what a tga is and how can i play about with them that would be grand..)
              Attached Files

              Comment


              • #8
                I think the problem are the Eurofighter *.tga files. CTP1/2 *.tga files should be in 16bit uncompressed subformat and not in 24bit uncompressed subformat.

                Try the files in the attachment.

                -Martin
                Attached Files
                Civ2 military advisor: "No complaints, Sir!"

                Comment


                • #9
                  Yes, everyone has problems with those darn Eurofighter tga files .

                  Comment


                  • #10
                    TGA's are pictures and you can view them with Microsoft Picture It! Express 2000. (That's the program on my computer that does it. There may be better ones.)

                    As it happens, I've put the Attack Helicopter unit in the mod I'm working on. Here's the data I've used with some (hopefully) explanatory comments.

                    Code:
                     from uniticon.txt
                    
                    ICON_UNIT_ATTACK_HELICOPTER { 
                    
                        FirstFrame     "UPUP097L.TGA"                          
                                  // a 38k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures
                    
                        Movie          "NULL"                                  // Wonders get movies here
                    
                        Gameplay       "UNIT_ATTACK_HELICOPTER_GAMEPLAY"       
                                  // the Great Library entry for UNIT_ATTACK_HELICOPTER_GAMEPLAY, must be in Great_Library.txt
                    
                        Historical     "UNIT_ATTACK_HELICOPTER_HISTORICAL"     // likewise
                        Prereq         "UNIT_ATTACK_HELICOPTER_PREREQ"         // likewise
                        Vari           "UNIT_ATTACK_HELICOPTER_STATISTICS"     // likewise
                    
                        Icon           "UPUP097A.TGA"                          
                                  // a 2k picture of the unit, must be in ... \cpt2_data \default \graphics \pictures
                    
                        LargeIcon      "UPUP097L.TGA"                          
                                  // a 38k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures
                    
                        SmallIcon      "UPUP097B.TGA"                          
                                  // a 1k picture of the unit, must be in ...\cpt2_data\default\graphics\pictures
                    
                        StatText       "UNIT_ATTACK_HELICOPTER_SUMMARY"        
                                  // the Great Library entry for UNIT_ATTACK_HELICOPTER_SUMMARY, must be in Great_Library.txt
                        
                     }
                    The FirstFrame picture can be a different picture from the LargeIcon picture.

                    BTW, you should use 97 for the ATTACK_HELICOPTER's number: the TGA's are as above and the sprite will be GU097.SPR

                    The number 98 was reserved for Harlan's Missile Cruiser, but I think Caranorn's about to give us a proper animated version of this unit.

                    So, here's the Copter tga's you need.
                    Attached Files
                    Last edited by Peter Triggs; September 19, 2002, 17:34.

                    Comment


                    • #11
                      thanks for the help guys but the game is still cutting out on me. It happens as i go to to click on the air units in cheat mode and just #poof# closes down on me.

                      I modded a unit earlier and aside from an outsized icon in cheat mode worked fine and the game didn`t cut out.

                      Am I missing something here?

                      Comment


                      • #12
                        I used to have those crash that happen when the game doesnt find a particular tga.
                        Here are a couple of stuff to test.

                        1) The names are mispelled. Make sure any typo happened. I suggest copy the name form the file and past inside the "".

                        2) The pictureas are not in the right directory. They have to be in the ctp2_data\default\graphics\pictures.
                        A good way to test this is to open the great library and check for the unit entry you create. It wont crash here but if the large picture truly isnt in this folder it wont show up (the background of the GL will be in its place.

                        3) Make sure the pics hav the correct size: Large Icons should have 160x120, Icons 36 x 24, and Small Icons 24 x 18. The small icon is the one that shows up in the cheat editor.
                        "Kill a man and you are a murder.
                        Kill thousands and you are a conquer.
                        Kill all and you are a God!"
                        -Jean Rostand

                        Comment


                        • #13
                          1) wrong format of the tga shoudl not crash the game. The wrong bit type should just end up giving a distorted image, at least that's what I experienced.
                          2)As Pedrunn said, get those names exactly right, if the game can't find the image it's looking for it will shut down.
                          3) I'm not so sure about picture size, that definitelly won't crash the game. In some cases the wrong tga size means icons don't fit into their window and overlap others, in other cases it seems to be scaled and just looks ugly. I still believe there might be room for a 4th size tga file in the game (96x72) as one of the game icons is that size (none of the official files though). I haven't had time to test this though.

                          In short, get right right kind of targa into the right slot. L (120x90) for the great library and large icon. A (32x24) for the normal icon. B (24x18) for the small icon. A different size (96x72) might work for the large icon, but that's as yet untested, it would also have to be labelled consistantly (use the L label for the large icon and use a different one, G maybe for the GreatLibrary).

                          If you add or modify a unit also always remember to check whether you modified all files concerned (you can create DESCRIPTION_UNIT_COMBAT_UAV, you'll just have to tell the game in the correct file what that is). I haven't done any of this since my return to CTP2, but I'm sure most explanatory material from the CTP days still exists on Apolyton and is largely applicable to CTP2.

                          Seriously modifying the game can be tough at times, but once you get the hang of it you'll be able to isolate your errors quick (you'll still make mistakes but al least you will know what you did wrong

                          Marc aka Caran...

                          P.S.: Concerning the Missile Cruiser, that Civ3 flic really represents a fast patrol craft (missile). Still up to anyone how they wish to use the sprites in a mod once they are converted. For now that particular sprite is on backburner though.

                          Comment


                          • #14
                            Originally posted by Caranorn
                            1) wrong format of the tga shoudl not crash the game. The wrong bit type should just end up giving a distorted image, at least that's what I experienced.
                            I haven't tried in CTP2, but in CTP I found that using the wrong compression (ie. compressed when it should be uncompressed or vice versa - I can never remember which it should be...) caused corrupted graphics, but using the wrong bit depth caused crashes exactly as described.

                            Which picture is it that appears on the cheat screen? Is it the SmallIcon?
                            Last edited by J Bytheway; September 20, 2002, 08:39.

                            Comment


                            • #15
                              Okay, I decided to test my 4 different icon sizes theory. I think I was rightand wonder why Activision just uses 3 files and accordingly has to scale 1 file down within the game.

                              The Cheat uses icon A which is normal size (32x24) (forgot to check the uniticon file again to see what their exact label is there).

                              I created the following picture through screenshots. I used 4 tga files instead of the usual 3. I think it's self explanatory. File L used 96x72, G 160x120, A 36x24 and B 24x18. The letters within the images are taken from the screenshot (to be safe I added the letter to each targa).

                              I also inadvertently (made a mistake with the files at first tested whether the game crashes if the wrong bit setting is used. It doesn't at least not for icons A, B and L.

                              Marc aka Caran...

                              P.S.: All sprites I create in future will have 4 targas and explanations how to use them.
                              Attached Files
                              Last edited by Caranorn; September 20, 2002, 09:35.

                              Comment

                              Working...
                              X