Announcement

Collapse
No announcement yet.

Making/altering units

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

  • Making/altering units

    Which files do you manipulate to add a unit? I just don't want to change one, and then find that I needed to change another 40 before my game keeps crashing!

    Also, how do I put different sprite pics in for old ones? I'm trying to replace some older graphics with Harlan's new units.


  • #2
    Hi John, I would suggest downloading the easymod program. You can find on apolyton i believe. You then don't have to worry bout which files to edit. Also it will allow you to add new sprites. CYA

    ------------------
    Gemini

    Comment


    • #3
      Is it possible to modify the Diplomat unit to "view enemy stack contents"?
      Mark

      Comment


      • #4
        I made my 1st attempt with Easymod, and of course failed miserably (game crashed), exactly as expected. After the crash I checked and the new files were in place (I didn't check them all), but Easymod changed the title of the uniticon on me. Must I use Unit_New.xxx? Did my renaming of this (although ignored it seems) cause the crash?

        All I did was add 1 unit, after copying the new sprite manually into the scenario folder. Were there other files I had to manually import? I realise the ai wouldn't use this new unit if I did this, I was just testing Easymod.

        Any help would be appreciated (and I expect it to be a long grueling process
        Mark

        Comment


        • #5
          Hey, John...

          If you just want to replace a sprite, say, for the Tank, then find another tank sprite, rename it (the tank sprite # is 38--look in spriteID.txt also, to make the change complete), and (after extracting the default tank sprite from the sprites folder, backing up) throw it in.

          That Easy Mod thing is quite helpful, as Gemini mentioned. I only started using it two weeks ago, but it's saved so many hours of work already.

          MarkH:
          I don't think so. (Stack question.)

          Uh, well, whenever I use it, I transfer all files I just made into the default portion, because that's really where I intended the new files to be--not a scenario.
          But I have had a few mysterious crashes myself...
          And I have never added a unit yet thru Easy Mod, so I don't know. Sorry.
          Did you make sure the numbers at the top of Units.txt and uniticon.txt and spriteID.txt were correct? Did you make sure it's included in spriteID?
          Existence is Futile.

          Comment


          • #6


            Now this is interesting (ok, to me). Each time I load Awesome aips into easymod, I get a message saying that one of those numbers is wrong (I forget which one just now). I'll have to try loading a different scenario before making changes. Wish I could remember the error message...

            I have another easymod question, how can I omit an advance? I don't want to change it, just get it out completely. More than 1 actually.
            Thanks, Mark

            Comment


            • #7
              Hi again MarkH. Yes I had some of the same troubles with easymod. For my units i'm adding right now all I change is the unit name and unit id. Not the description. I'm not sure if it matters to change the description cos my game has not crashed even though I have added 60 units so far with the same description. And when I did try changing the description it crashed. It looks like easy mod does not change all the necassary files for the description. Not sure if it's a bug or if it's just not necassary. Also about deleting advances or units I have not found a way through easymod. You may have to delete these manually by editing all the txt files. Hope this helps. By the way, don't get me wrong about easymod that program has saved me countless hours too.

              Also, did you put the tga files for the new unit in the pictures directory? That could cause a crash.

              And If I remember correctly there was a problem with one of the numbers not being correct but I thought that was fixed in the apolyton pack. Anyhoo that may be why easymod won't load it. Has anyone else on the forum run into that problem????????

              ------------------
              Gemini
              [This message has been edited by gemini (edited December 29, 1999).]

              Comment


              • #8
                Yep. Well, I have Awesome Aips installed (yeah, duh!) and I always get a (false) message saying the number count is incorrect. Every time. And every time I check, it's always in error, the number is right--I think it's units.


                And I think Gemini's right about the advance. To get rid of one, manually delete it (back up first) and then look to be sure it's not listed elsewhere, as a prereq.
                Existence is Futile.

                Comment


                • #9
                  Thanks guys, one tiny step at a time, I'll get there eventually ;-) Good to know I can use awesome aips as a base for mods, I really like the counter-bombard ability.

                  On the other hand, I will need to change the GL descriptions eventually (or players will never know what's what). Obviously it can be done since horse archer etc. are fully integrated. Would somebody care to share that detail?

                  I only moved the sprite into the sprite folder, I thought that included the .tga file. Guess not (yet another step). If all that easymod can be used for is changing units.txt, I'll just do the whole thing manually (ugh)....
                  Mark

                  Comment


                  • #10
                    You may find this information useful for adding new units.


                    How to add a new Unit Sprite v 1.0

                    This file explains how to add a new unit sprite to CTP. Use at your own risk and make copies of any files before updating them.

                    Basically there are a maximum of 4 picture files you need to load a unit sprite.

                    GUXXX.SPR – The Sprite itself
                    CUXXXA.AVI (160x120; 12fps; 3 seconds play; compressed) – This is the animated Great Library file.
                    UPUXXXB.TGA (30x30;no alpha no compression) – The picture displayed if you right click the unit.
                    UPUXXX.TGA (160x120; no Alpha; no compression)- The file required for all the other picture views e.g. The static GL view, the unit icon used in cheat mode, the picture displayed in the build options and when you select a unit for moving.

                    If you don’t have the AVI don’t worry as the game will play without it – as explained later.

                    ================================================== =======================

                    1) Setup Instructions
                    These are general instructions applicable to any Sprite. Where you see XXX please replace with the unit number you wish to use.

                    A) First, make 2 copies of the UPUXXX.TGA file calling them CUXXXF.TGA and UPUAXXX.TGA (NB when using 2 digit numbers don’t add leading zeros to this particular file i.e. create UPUAXX.TGA as this is the standard Activision used) respectively whilst still keeping the original UPUXXX.TGA file (This is a safety precaution which may avoid trouble with other packs and I’ll explain why later).

                    Scenario Setup
                    If you wish to use the units in a scenario you will need to do the following :-

                    B.1) Place the sprite file GUXXX.SPR in the correct directory. This should have a path as follows:-
                    your CTP directory\SCENARIOS\Scenario-name\DEFAULT\GRAPHICS\SPRITES

                    C.1) Place the 4 TGA files UPUXXX.TGA, CUXXXF.TGA, UPUAXXX.TGA and UPUXXXB.TGA in the correct picture directory. This should have a path as follows :-
                    your CTP directory\ SCENARIOS\Scenario-name\DEFAULT\GRAPHICS\PICTURES

                    D.1) Finally place the animated GL file CUXXXA.AVI in the following directory :-
                    your CTP directory\ SCENARIOS\Scenario-name\DEFAULT\VIDEOS

                    Providing the sprite has been set up in the related scenario gamedata files the sprite should be available for use.

                    Setup in main default directories
                    If you wish to add the sprite and the picture files to the main default libraries you will need to do the following :-

                    B.2) Place the sprite file GUXXX.SPR in the correct directory. This should have a path as follows:-
                    your CTP directory\ CTP_DATA\DEFAULT\GRAPHICS\SPRITES

                    C.2) Place the 3 TGA files CUXXXF.TGA, UPUAXXX.TGA and UPUXXXB.TGA in the correct picture directory. This should have a path as follows :-
                    your CTP directory\ SCENARIOS\CTP_DATA\DEFAULT\GRAPHICS\PICTURES

                    The 4th TGA file UPUXXX.TGA should be placed in the following directory
                    your CTP directory\ SCENARIOS\CTP_DATA\DEFAULT\GRAPHICS\ICONS

                    D.2) Finally place the animated GL file CUXXXA.AVI in the following directory :-
                    your CTP directory \CTP_DATA\DEFAULT\VIDEOS

                    Providing the sprite has been set up in the default gamedata files the sprite should be available for use.

                    ================================================== ======================

                    2) How to set-up the necessary gamedata files –and other information in case you have problems.
                    If you are trying to add this unit as an ‘extra’ unit and haven’t done so before, the information below should help you to do this. There is also a utility on the Apolyton site called Easymod (currently at version 3.3) which helps to set up this data but in case you have any difficulty using that modification or just want to know how to do it read on – but don’t forget to take backup copies of the files first!

                    The files you need to update will either be in directory :-
                    your CTP directory\SCENARIOS\Scenario-name\DEFAULT\GAMEDATA
                    if you wish to update a scenario file

                    or
                    your CTP directory \CTP_DATA\DEFAULT\GAMEDATA
                    if you wish to update the default files

                    E) First, set up the unit in the SPRITEID.TXT file. To do this simply add a new line at the bottom of this file which refers to the unit number you used for the actual sprite file e.g. :-.

                    SPRITE_NEW_UNIT_NAME XXX

                    And then increase the record count at the top of the file by 1.

                    F) Second, you need to update the UNITICON.TXT file. To do this simply add a new line at the bottom of this file which tells CTP which text, picture and AVI files are associated with this unit. E.g.:-

                    ICON_UNIT_NEW_UNIT_NAME "CUXXXF.tga" "CUXXXA.avi" "GAMEUXXX.txt" "HISTUXXX.txt" "PREQUXXX.txt" "VARIUXXX.txt" "UPUAXXX.tga" "STATUXXX.txt"

                    And then increase the record count at the top of the file by 1.

                    The file uniticon.txt contains information as to where certain files relating to a particular icon-unit can be found. It consists of a record per icon-unit and has the following structure.

                    ICON_UNIT_name "File1" "File2" "File3" "File4" "File5" "File6" "File7" "File8"

                    Where File1= the still frame GL file
                    File2= the GL animation file
                    File3= GL Gameplay section text
                    File4= GL Historical Section Text
                    File5= GL Left window Text
                    File6= GL Right window text (NB this file is named VACDUXXX in some of the
                    modification packs – I don’t know why?)
                    File7=the picture displayed in the build options and when you select a unit for moving
                    (Normally UPUAxx.TGA i.e. only 2 digits which is the reason for my comment in
                    set-up section A)
                    File8= Production Tab Text

                    The game will run even if can’t find some of these files (at least under the 1.2 patch) however it is best to ensure they exist, are named and numbered correctly and are in the right places. The text files (i.e. files 3, 4, 5, 6 and 8) NEED TO BE CREATED and added to either

                    your CTP directory\SCENARIOS\Scenario-name\ENGLISH\GAMEDATA\GL
                    if you wish to update a scenario file

                    or
                    your CTP directory \CTP_DATA\ENGLISH\GAMEDATA\GL
                    if you wish to update the default files

                    (NB I assume for other Language variations the ENGLISH part of the directory path is replaced)

                    Warning – The text files must exist in the default library in order to use (i.e. see) the scenario text files. i.e. If no equivalent file is in the default library and you add files only to the scenario library you see NOTHING when using the GL. If you have files in BOTH libraries the Scenario files are the ones that will be displayed.

                    Although you do not need to have unique files for each of these it is simpler in the longer term to number them all the same even if the information is just a copy of another file. It is because certain scenario packs have not opted to use exactly this structure that I recommended creating the additional TGA files. If they are refereed to you need them, if not then there is no harm done!

                    EG this was from a sprite in one of that add on packs

                    ICON_UNIT_NOBLE "UPU096.tga" "UPU096.tga" "GACDU092.txt" "HICDU092.txt" "PRCDU092.txt" "VACDU092.txt" "UPU096.tga" "STCDU092.txt"

                    And shows that you can use different numbered files and in some cases different named files – but it will get confusing!

                    G) Thirdly, you need to update the UNITS.TXT file. It is best to do this in stages (1 to 5)(although this is where the EASYMOD utility comes in handy) and don’t forger to make a backup copy first!
                    1. Find an example of a similar unit (within this file) to the one you want to add (i.e. with similar characteristics).
                    2. Copy and paste this similar unit to the bottom of the file.
                    3. Now update this copy version (the example below uses the Activision Musketeer unit as a similar unit) –amending the criteria as you want but making sure that the highlighted items are changed (i.e. the UNIT_NAME and the DEFAULT_SPRITE and DEFAULT_ICON parameters).

                    UNIT_ NEW_UNIT_NAME
                    {
                    SHIELD_COST 560
                    POWER_POINTS 500
                    MAX_HP 15
                    ATTACK 40
                    DEFENSE 40
                    FIREPOWER 3
                    ZB_RANGE_ATTACK 20

                    BATTLEFIELD_RANGE 1
                    BATTLEFIELD_RADIUS 1

                    VISION_RANGE 1

                    ACTIVE_DEFENSE_RANGE 0
                    ELECTRONIC_COMBAT_FACTOR 0

                    MAX_MOVEMENT 100
                    FUEL 0

                    SHIELD_HUNGER 16
                    FOOD_HUNGER 0

                    DEFAULT_SPRITE SPRITE_ NEW_UNIT_NAME
                    DEFAULT_ICON ICON_UNIT_ NEW_UNIT_NAME
                    DESCRIPTION DESCRIPTION_UNIT_ MUSKETEERS

                    SOUND_SELECT1 SOUND_SELECT1_MUSKETEERS
                    SOUND_SELECT2 SOUND_SELECT2_MUSKETEERS
                    SOUND_MOVE SOUND_MOVE_MUSKETEERS
                    SOUND_ACKNOWLEDGE SOUND_ACKNOWLEDGE_MUSKETEERS
                    SOUND_CANTMOVE SOUND_CANTMOVE_MUSKETEERS
                    SOUND_ATTACK SOUND_ATTACK_MUSKETEERS
                    SOUND_WORK SOUND_WORK_MUSKETEERS
                    SOUND_VICTORY SOUND_VICTORY_MUSKETEERS
                    SOUND_DEATH SOUND_DEATH_MUSKETEERS
                    ENABLING_ADVANCE ADVANCE_GUNPOWDER
                    OBSOLETE_ADVANCE ADVANCE_EXPLOSIVES

                    ############## special flags #############################
                    MOVEMENT_TYPE_LAND
                    MOVEMENT_TYPE_MOUNTAIN
                    LOSS_MOVE_TO_DMG_NONE
                    SIZE_SMALL
                    VISIBILITY_CLASS_0
                    VISIBILITY_CAN_SEE_0
                    EXERTS_MARTIAL_LAW
                    CAN_EXPEL_POP
                    DEATH_EFFECTS_HAPPY
                    CAN_REFORM SOUND_ID_REFORM_CITY SPECEFFECT_REFORMCITY
                    CAN_PILLAGE
                    CAN_EXPEL
                    CHEAT_INDEX 1
                    }

                    ### UNIT DONE ###

                    4. Increase the count number at the top of the file by 1
                    5. Save the updated file.

                    NB As I’ve mentioned I believe the EASYMOD utility is the best way to maintain this file – particularly if you want to amend several characteristics.


                    H) Finally, set up the unit in the GL_STR.TXT file. To do this simply add a new line at the bottom of the section where each line starts ‘UNIT….’ and add the new line which references the new unit e.g. :-

                    UNIT_ NEW_UNIT_NAME "new unit name".

                    The directory that this file is found in is either

                    your CTP directory\SCENARIOS\Scenario-name\ENGLISH\GAMEDATA
                    if you wish to update a scenario file

                    or
                    your CTP directory \CTP_DATA\ENGLISH\GAMEDATA
                    if you wish to update the default files

                    (NB I assume for other Language variations the ENGLISH part of the directory path is replaced)

                    Now providing you spelt and named everything consistently you should have a new unit you can use!

                    ================================================== =====================

                    3)Additional information on the TGA’s
                    The game uses 4 different file sizes for the TGA’s as follows :-

                    CUXXXF.TGA (160x120) – The GL still frame.
                    UPUXXX.TGA (40x30) – The uniticon used in cheat mode
                    UPUAXXX.TGA (96x72) - The build options and when you select a unit for moving picture.
                    UPUXXXB.TGA (30x30) - The picture displayed if you right click the unit

                    The first 3 pictures are all the same ratio and the game will automatically scale up or down the TGA file to fit the necessary display size. The TGA supplied with this sprite has been made to the maximum 160x120 size in order to give the best overall image. As this image is always shown first when going into the GL,(i.e. it always displays the TGA then tries to find ‘file2’-normally the AVI file - and displays that if found), by keeping this and the AVI file in line it prevents the ‘jumping effect’ which can be noticed while viewing the GL with animations on). If you go into the GL and see either nothing or the last unit you looked at then this normally means the TGA file does not exist in the right location

                    Comment


                    • #11
                      I have a list of the necessary files that I keep handy. This is the one for units. The list for advances, improvements, wonders and goods is similar.

                      Units:
                      SpriteID*
                      Unit text*
                      Uniticon text*
                      script.slc
                      gl_str
                      help_str
                      gl texts
                      aips
                      *increase number at top of file

                      Btw, I also tried using Easymod back when I first started mod-making, and I had a lot of trouble with it, too. Once I put together the list above, I found it easier to do the files manually than using Easymod. I am going to give another shot, though, before I add the large numbers of stuff for the Modern mod.

                      Comment


                      • #12
                        The reason for the different names for GL files in the Apolyton Pack is that (as you mentioned) the GL files are not read from the scenario directory. That's why they had to be put in the default directory. With these different names you can still be the standard games with the original GL texts.

                        Comment


                        • #13
                          Wow, now that's an answer! Many thanks guys, my free time is gone now :-)
                          Mark

                          Comment

                          Working...
                          X