Results 1 to 4 of 4

Thread: Units

  1. #1
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Post

    WORK-IN-PROGRESS: Do not reply unless you have something to add. I would really appreciate contributions from other modders.
    Thanks, Duke John


    Chapter 5: Units

    Contents
    5.1 Files
    [/list]5.2 Adding an unit
    [/list]5.3 Modding unitstats
    [/list]5.4 Unitgraphics
    [/list]
    [/list]




  2. #2
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default

    5.1 Files
    In this paragraph I try to make it clear what files are needed to make an unit work ingame. Later on I will explain how you edit certain files, but first you need to know the overall picture before going into detail.

    5.1.1 Naming the files
    I have found it usefull to add a prefix in front of the unitnames. During modding you will often go back to your added files and by adding a prefix you will see them all together. This makes it very easy to quickly see wether you have forgotten a file, which is the first thing you do when debugging

    For the Wars of the Roses mod I have added WOTR to all units, so I have WOTRBillmen, WOTRSquires, etc. In the paragraphs below I use MODUnit, where MOD is your modname, and Unit is your unitname. You do not need to follow this advice, but it has quickened my modding alot.

    5.1.2 Strategic part

    Strategic overview


    Unitname
    Of course the unit needs a name and you should do that in Loc\Eng\Names.txt
    The needed entry is:["MODUnit_Singular"] {"Soldier"}
    ["MODUnit_Plural"] {"Soldiers"}[/list]MODUnit should be the exactly the same as the entry in the unitproduction file.

    Unitdescription
    The unit can be given a description to explain something about the unit; history, tactics, etc. This description needs to be added in Loc\Eng\Descriptions.txt
    The needed entry is:["MODUnit_desc"] {"Description to be added."}[/list]MODUnit should be the exactly the same as the entry in the unitproduction file.

    Infopic
    To make the infoparchment more interesting CA has added an infopic. This image is placed in campmap\Info_Pics\Units.
    If you want to have different infopics for Muslim factions then they should be placed in campmap\Info_Pics\Units\Muslim, the other factions will use the normal infopic.

    Reviewpanel uniticon
    This uniticon is used in the strategic part and also when selecting units for custom/mp battles. This image is placed in campmap\review_panel\Units and saved as MODUnit.BIF.

    5.1.3 Tactical part

    Tactical overview


    Battle uniticons
    This uniticon is only used during battles (the tactical part). This image is placed in Battle\UnitIcons\ and saved as MODUnit.LBM.

    Unitgraphic
    Also called the UnitBIF, the unitgraphic displays the soldier only. When using the official BIFs weapons and shields are not displayed in the BIF. This image is placed in Textures\Men\BIFName\ and saved as BIFName.BIF for low resolution and as BIFName_H.BIF for high resolution.

    But that is not all The engine must know which UnitBIF the unit uses and that is done in column 48 in the Unit Production file.
    The engine now knows which UnitBIF is used, but there are alot of actions put in the BIF so now you must tell the engine where it find those actions. This is done using the ActionPage file which you can find in Textures\Men\ActionsPage\ and is saved as MODUnit.TXT.

    If you use existing UnitBIFs then copy/paste the BIFName in column 48 and copy/paste the ActionsPage of an unit that actually uses that BIF.

    Dead body
    When a soldier has died, the engine will put a dead body on the battlefield. To achieve this you will need to add an entry in DEADPAGE COORDS.TXT located in Textures\Men\ActionsPage\. Just copy/paste an existing entry and rename the unitname to MODUnit.

    NOTE: The above entry is required, but because of some "bug" dead bodies are not always displayed

    Items: shields and weapons
    This is pretty complicated at first and I'll explain more detailed in Chapter 10: Unitgraphics. I will add a simple description later on.




  3. #3
    For England and St.George Senior Member ShadesWolf's Avatar
    Join Date
    Aug 2001
    Location
    Staffordshire, England
    Posts
    3,938

    Default

    A quick tip (Overwrite)

    If you are creating an overwrite mod, or you are starting to run out of unit spaces (yes the game does have a max.) Then you can always use some of the existing ones that your mod is not going to use.

    The unit name is held in:-

    Loc\Eng\Names.txt

    ["MODUnit_Singular"] {"Soldier"}
    ["MODUnit_Plural"] {"Soldiers"}

    This way you just rename 'Soldier' with the new unit name, ie WelshLongbow and you have a new unit.

    You will ilso have to change a few other items also, but you have an easy, quick new unit to mod
    ShadesWolf
    The Original HHHHHOWLLLLLLLLLLLLER

    Im a Wolves fan, get me out of here......


  4. #4
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Post

    5.2 Adding an unit
    Original author: Kekvitirae
    Original article: Help me with Creating Units


    To be edited and formatted

    BACKUP YOUR FILES

    To create a new faction, read this thread in its entirety: http://www.totalwar.org/cgi-bin....;t=6671

    To create new units follow these steps:
    1. Open up your unit_prod11.txt file in Notepad and search for a unit that is a close match to what you want to create. To create a new heavy spear chucker, simply find the Bonnachts (found in the Viking's unit_prod11.txt file).
    2. Highlight it all, right down to the beginning of the next unit under it.
    3. Select Copy.
    4. Scroll down to the point where the unit list ends and emptiness begins. If you have word wrap off, it wont be too far down.
    5. On the line under the last unit, hit Paste. You now have an exact copy of the Bonnacht unit in the file. Save the file.
    6. Download and install Gnome's editor from the Org's download tools.
    7. Open up the unit_prod11.txt file with Gnome editor and edit the stats of the new unit (all the way down at the bottom of the list) however you please.
    8. Rename the unit to something other than Bonnacht. Just dont put any spaces in the name. In this example, we'll choose the name SpearChuckers. Save the file.
    9. Open up Windows Explorer and go to your MTW directory. Go to the Battle\UnitIcons\ directory and copy the file Bonnachts.LBM and paste it in a temporary directory.
    10. Rename the file to SpearChuckers.LBM (remember, the file names must match that of the unit name) and move it back into the UnitIcons directory.
    11. Go to the campmap\ directory and do exactly the same thing with Bonnachts.bif files in the Info_Pics\Units\ directory and the Review_Panel\Units\ directory, copying/renaming/moving.
    12. In the Textures\Men\ directory, search every directory in there for references to Bonnachts*.txt and repeat the above. In this example, you should have a SpearChuckers.txt in the ActionsPage\ directory, and a SpearChuckers_W.txt and SpearChuckers_S.txt file in the NewPeasants\ directory.
    13. Because the weapons are hidden from view until they fire, Bonnachts dont require files in the Items\ directory. However, If you choose to create a unit that has their weapons and shields visable at all times in battle, repeat the above by copying and renaming the directories of the unit you are imitating to the unit you are creating. Example: In the ArabInfantry_S.txt file, you will see the number 2. Look in Items\Shields2 (note the 2), and you'll see ArabInfantry directory. Copy and paste it into a temp directory, rename it to your new unit, and move it back. Do exactly the same thing with ArabInfantry_W.txt (which has a 5 in it, so you should look in Items\Weapons5\.
    14. Go back to the root MTW directory and look in the Loc\Eng directory. Open up Names.txt in Notepad. Scroll down (or run a search) until you find this:
    ["Bonnachts_Singular"] {"Bonnacht"}
    ["Bonnachts_Plural"] {"Bonnachts"}
    15. Copy it and paste it at the end of the unit list, just a few more lines down. Rename Bonnanchts_Singular to SpearChuckers_Singular. In fact, rename all four Bonnachts references to SpearChuckers. Again, watch the spelling and capitalization. Save the file.
    16. Open up Descriptions.txt in the same directory with Notepad and run a search for ["Bonnachts_desc"]. Copy the whole line and paste it at the end of the unit list just a few lines down, exactly the same way you did with the Names.txt file.
    17. Rename Bonnachts_desc to SpearChuckers_desc, and then edit the description however you please. Just remember that since the unit description box in the game has to sliding bar, you have to limit the description of the unit. Otherwise the game will cut off the excess part, leaving you with an incomplete description when you view the unit. Save the file.
    18. Open up the DEADPAGE COORDS.txt file with Notepad in the Textures\Men directory.
    19. Run a search for Bonnachts, and highlight and copy that line and the numbers under it, and paste it at the bottom of the list. Rename the now-pasted Bonnachts to SpearChuckers. Save the file.

    Now, with any luck, you will have a new unit, the Spear Chuckers, at your beck and call. Just remember to assign it to a faction by tinkering with the Gnome editor and the unit_prod11.txt file.


    To transfer a building from the VI campaign over to the original campaign (or vice versa), repeat steps 1-7. Open up the VIKINGS_build_prod13.txt, copy the lines relevant to the building you want, open up CRUSADERS_build_prod13.txt and paste the lines in. Then just tinker with the Crusader build_prod13.txt file until you get the right requirements set.


    (I think think should be eligable for a sticky somewhere here or the Dungeon, since I havent seen a step-by-step for making new units)




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
  •  
Single Sign On provided by vBSSO