Page 1 of 7 12345 ... LastLast
Results 1 to 30 of 200

Thread: Tutorial: Adding new units for beginners

  1. #1

    Default Tutorial: Adding new units for beginners

    Modding Resource Header

    Title: Adding new units for beginners
    Posted by: Epistolary Richard
    Modding area: Units
    Required programmes: Notepad (or other text editor)
    Related links: Hard Coded limits
    Summary: A beginner guide that takes you step-by-step through adding units you've downloaded as well as creating your own. Note that this is a collection of modding discoveries made by the community for nearly a year and so the discoveries here are not attributed to a single author.
    __________________________________________________


    This flowchart highlights the most important files for each aspect of adding a new unit. Scroll down to read more about them, or click on a file to learn more about that step.







    And here's how some of these references appear in the game here:



    If this all looks confusing, don't worry. We're going to take you through it step by step below.

    First off, a few choice picks from the Modding Rules of Cool:
    cool modders make back-ups cool modders use show_err

    We'll be following two examples through the process. We'll be adding an entirely new unit made by a group of modders called the Spartan Royal Guard as well as a unit - Briton Archers - that we'll be making ourselves.
    Last edited by Epistolary Richard; 08-02-2005 at 01:12.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (2):



  2. #2

    Default Re: Tutorial: Adding new units for beginners

    Step One - adding a new entry in export_descr_unit

    Inside your Data folder you'll find a text file called export_descr_unit (which I'll refer to as edu). This file defines the stats for every single unit in the game.

    Spartan Royal Guard
    On the Download page, the creators of this unit provided us with the entry we should use:

    Code:
    type spartan royal guard
    dictionary spartan_royal_guard ; Spartan Royal Guard
    category infantry
    class spearmen
    voice_type Heavy_1
    soldier spartan_royal_guard, 30, 0, 1
    officer greek_standard
    attributes sea_faring, hide_forest, can_sap, command, frighten_foot, frighten_mounted
    formation 1, 1, 1.7, 0.5, 4, square, phalanx
    stat_health 2, 0
    stat_pri 27, 8, no, 0, 0, melee, simple, piercing, spear, 25,1
    stat_pri_attr spear, long_pike
    stat_sec 21, 4, no, 0, 0, melee, simple, piercing, sword, 25, 1
    stat_sec_attr no
    stat_pri_armour 12, 8, 5, leather
    stat_sec_armour 0, 1, flesh
    stat_heat -2
    stat_ground 2, 0, 0, 0
    stat_mental 60, disciplined, highly_trained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 1000, 220, 130, 190, 1740
    ownership greek_cities
    So adding the new entry is a simple matter of copying it and pasting it at the bottom of the edu file.

    Briton Archers
    As we're creating the Briton Archers ourselves, no premade edu entry exists, so we must make our own. I don't want the Briton archers to be very different from other barbarian archers and so I'm going to model them on the Dacian archers.

    Here's the existing Dacian archers entry:

    Code:
    type barb archer dacian
    dictionary barb_archer_dacian ; Archer Warband
    category infantry
    class missile
    voice_type Light_1
    soldier barb_archer, 40, 0, 0.9
    attributes sea_faring, hide_improved_forest
    formation 1.2, 1.2, 2.4, 2.4, 3, square
    stat_health 1, 0
    stat_pri 7, 2, arrow, 120, 30, missile, archery, piercing, none, 25 ,1
    stat_pri_attr no
    stat_sec 3, 2, no, 0, 0, melee, simple, piercing, knife, 25 ,1
    stat_sec_attr no
    stat_pri_armour 3, 2, 0, leather
    stat_sec_armour 0, 0, flesh
    stat_heat 2
    stat_ground 2, -2, 3, 2
    stat_mental 4, normal, untrained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 270, 170, 30, 40, 270
    ownership dacia
    To make my new unit, I'm going to copy this entry, but I have to change a few lines.

    First: the type line

    Code:
    type barb archer dacian
    This name is used by the game for recruitment purposes and in other ways. No two units in edu can have the same type name, so I'm going to change it appropriately.

    Code:
    type barb archer britons
    Second: the dictionary line

    Code:
    dictionary barb_archer_dacian ; Archer Warband
    The dictionary line is used to reference the unit description and also the unit card (more on those later). I'd like to have a different description and unit card so I'll change this line to the following:

    Code:
    dictionary barb_archer_britons ; Archer Warband
    By the way the ; in the line is used to comment out sections, as soon as the game reaches a semi-colon it will stop reading that line and skip to the next. The "Archer Warband" name there is not used by the game but only by the developers to keep a track on which entry is for which unit. I'm not worried about forgetting my changes so I'm going to leave it alone.

    Third: the soldier line

    Code:
    soldier barb_archer, 40, 0, 0.9
    This line tells the game which entry to look for in another file called descr_model_battle, also in the Data folder. That file dictates what model the unit will use and what texture it will wear. As I don't have a new model for my unit I'm happy to use the existing one and so I leave this unchanged.

    Fourth: the ownership line

    Code:
    ownership dacia
    This line tells the game which factions the unit can be used by in custom battles, whether it can be recruited by a faction in a campaign and it also dictates whether the unit will swap sides when its bribed or disband. As this unit is going to be for the Britons I change this to the following:

    Code:
    ownership britons
    I want to make my archers a little different from the Dacian archers so I tweak some of the stats so that they fire a shorter range, heavier shot that I think would be appropriate for their lands. so finally we're left with the following:

    Code:
    type barb archer britons
    dictionary barb_archer_britons ; Archer Warband
    category infantry
    class missile
    voice_type Light_1
    soldier barb_archer, 40, 0, 0.9
    attributes sea_faring, hide_improved_forest
    formation 1.2, 1.2, 2.4, 2.4, 3, square
    stat_health 1, 0
    stat_pri 9, 2, arrow, 100, 25, missile, archery, piercing, none, 25 ,1
    stat_pri_attr no
    stat_sec 3, 2, no, 0, 0, melee, simple, piercing, knife, 25 ,1
    stat_sec_attr no
    stat_pri_armour 3, 2, 0, leather
    stat_sec_armour 0, 0, flesh
    stat_heat 2
    stat_ground 2, -2, 3, 2
    stat_mental 4, normal, untrained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 270, 170, 30, 40, 270
    ownership britons
    And, like before, we paste it at the bottom of edu.
    Last edited by Epistolary Richard; 08-02-2005 at 00:20.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (3):



  3. #3

    Default Re: Tutorial: Adding new units for beginners

    Step Two - adding a new unit description

    Both my new units need a new description because they both have new dictionary lines. As you can see from the chart above, adding a new description involves two files: export_descr_unit_enums (edue) and export_units (eu), the latter of which you can find in the text folder within the Data folder.

    The process is the same for both units so we'll do them both at once.

    Again, for the Spartans, the creators have given us the code I need. So I go into edue and paste it at the bottom. For the Britons I had to write new entries (remember it's based on the dictionary line in edu).

    Code:
    spartan_royal_guard
    spartan_royal_guard_descr
    spartan_royal_guard_descr_short
    barb_archer_britons
    barb_archer_britons_descr
    barb_archer_britons_descr_short
    Then I need to add the text that the game will actually display, so I go into text\export_units and paste the following at the bottom:

    (Again the Spartans were already written for me, for the Britons I've copied the Dacian entry, changed the name in the {} to correspond to my entried in edue and added a line of my own to make it unique.)

    Code:
    ¬----------------
     
    {spartan_royal_guard} Spartan Royal Guard
     
    {spartan_royal_guard_descr}
    Legendary warriors they are 'elite perfect soldiers' and nothing else. All of Spartan life is spent training for war. Weaklings perish soon after birth; youths are taught to thieve and terrorize the slave class to harden them; young men are taught nothing unless it has something to do with the arts of war - even music and dance are there only to help keep step when marching and obeying orders.The result is a man who thinks nothing of danger, expects to win, and creates a sense of dread in his opponents.\n\n From this group of men only the best make it in to the Spartan Royal Guard. They carry the Eagle of Olympus as a sign of leadership and to inspire the troops. They also fight in the traditional fashion like hoplites, with a long thrusting spear and the large red round hoplon shield incrusted with the gold symbol of Sparta. They are also protected by an iron breastplate with an external layer of silver.\n\n
    The Royal Guard: is an elite unit in Greek Army. A small group of selected soldiers who acted as shock troops. The Thebian army had a group of 300 soldiers. The Spartans had a group of 300 hoplites who were a Royal Guard.
     
    {spartan_royal_guard_descr_short}
    The Spartan Royal Guards are elite hoplites trained and selected from the best soldiers of the Spartan Greek units. They are perfect soldiers made in the image of the Thermopylae heroes.
     
    ¬----------------
     
    {barb_archer_britons}	Archer Warband
     
    {barb_archer_britons_descr}
    Archer warbands are used to harass and break up enemy formations, so that other warriors can then get in amongst their enemies. The members of the warband are lightly armed and equipped, relying more on speed as a protection from foes. Any archers caught in the open by cavalry will be in trouble unless they can withdraw to more favourable ground or behind a shield wall of friendly warriors.\n\nTheir bows have a short range, but each warrior carries a good selection of hunting and war arrows, designed to cause massive bleeding and pierce armour respectively. Their choice of missile is matched to the nature of the target.\n\nThese archers are at their best in wooded country, where their superior stalking skills learned on the hunt can be put to use. Archers from Britannia tend to carry a fewer, heavier shots which have a shorter range, better suited for their style of warfare.
     
    {barb_archer_britons_descr_short}
    Archer warbands are used to harass and break up enemy formations, so that other warriors can then get in amongst their enemies.
    The only difference between the _descr and the _descr_short descriptions are that they're used in different points in the game.


    Learn more about editing a unit description here:
    How to edit a unit name/description
    Last edited by Epistolary Richard; 08-02-2005 at 00:34.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (3):



  4. #4

    Default Re: Tutorial: Adding new units for beginners

    Step Three - adding a new model and texture (skin) in descr_model_battle

    I mentioned descr_model_battle (dmb) above, remember it was referenced by the soldier line in the edu entry.

    Spartan Royal Guard
    The Spartans use an entirely new model. The dmb entry is provided for me, so again I just paste these at the bottom of the dmb file.

    Code:
    type spartan_royal_guard
    skeleton fs_fast_spearman, fs_fast_swordsman ; combat spear
    indiv_range 40
    texture greek_cities, data/models_unit/textures/Royal_Spartan.tga
    model_flexi data/models_unit/Royal_Spartan_100.cas, 15
    model_flexi data/models_unit/Royal_Spartan_200.cas, 30
    model_flexi data/models_unit/Royal_Spartan_300.cas, 40
    model_flexi data/models_unit/Royal_Spartan_400.cas, max
    model_sprite greek_cities, 60.0, data/sprites/greek_cities_greek_armoured_hoplite_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5f
    Unfortunately, it does not finish there, as this entry references several files that do not exist in the vanilla game. The files I need are what's available in the download. Here's the contents of zip file you can download (Spartan Royal Guard):



    If you look at the file names you can start to see how they correspond. The roots where the files have to be placed are listed in the dmb entry, but we'll go through them one at a time:

    First: adding the model

    The model is the 3d base of the soldier, kind of like a statue. The texture is a 2d image that is wrapped around the soldier and provides the colours and detail. If the model is the chassis, then the texture is the paint-job.

    You can see above the following lines
    Code:
    model_flexi data/models_unit/Royal_Spartan_100.cas, 15
    model_flexi data/models_unit/Royal_Spartan_200.cas, 30
    model_flexi data/models_unit/Royal_Spartan_300.cas, 40
    model_flexi data/models_unit/Royal_Spartan_400.cas, max
    Each .cas file is a model of the soldier used for the unit, the different versions are just the same model at different degrees of detail. In order to maintain processing speed, the game swaps in the lower detail models as you away from the solder, so it can handle the number that appear on screen.

    All modellers should create these different versions of their model for different ranges, otherwise even high performance machines will begin to suffer from lag as the game tries to cope with thousands of intensive models on the screen at the same time.

    We follow the root written in the dmb entry and we drop the .cas within data\models_unit\

    You'll find quite a few files there already, in fact all the .cas unit files used by the vanilla game.



    At even further distances it will swap from a 3d model to a 2d sprite. As you can see, the sprite line is properly defined
    Code:
    model_sprite greek_cities, 60.0, data/sprites/greek_cities_greek_armoured_hoplite_sprite.spr
    The line is referencing a .spr file which already exists in vanilla, so we don't need to worry about it any further.

    Second: adding the texture (skin)

    This is the texture line

    Code:
    texture greek_cities, data/models_unit/textures/Royal_Spartan.tga
    It looks very similar to the model line, the main difference is that the faction (greek_cities) is referenced as well. In order to save space, CA use different textures on the same model in order to achieve a different unit.

    A good example of this are the roman troops for the different families, the velites of the different families all use the same model because they're all the same shape. They do wear different colours and so you'll find they reference a different texture for the different factions. We'll have a clearer example of this later.

    Again, this is just a matter of dropping the file we're given in the download and dropping it in the folder called for in the root in dmb, in this case data\models_unit\textures - just one folder below where we dropped the .cas files.

    The files we need in this case are the .tga.dds files. The .dds extension just shows that the file has been compressed in a certain manner, it's really a .tga file which is why the texture line refers to it as a .tga and not a .tga.dds



    You'll note that the textures folder is empty. That's because, unlike the .cas files the texture files that the game uses are all hidden away within .pak files within the packs folder. Because we're adding a new texture however, we don't need to worry about them, we'll just drop the new textures in.

    You'll also spot that I've added another file with _GLOSS at the end of it. This file tells the game which areas of the texture should be reflective with the write Video options. Again, this is something that the skinners will sometimes include as well, though you can make your own if you want.


    Briton Archers

    For my Britons, I don't have a new model or a new texture for them. Nevertheless I still need to do some work in dmb. The soldier line in the edu entry referenced a model called barb_archer in dmb, which is the following.

    Code:
    type				barb_archer
    skeleton			fs_fast_archer, fs_fast_dagger
    indiv_range			40
    texture				dacia, data/models_unit/textures/unit_barb_warband_archer_dacia.tga
    texture				scythia, data/models_unit/textures/unit_barb_warband_archer_scythia.tga
    texture				slave, data/models_unit/textures/unit_barb_warband_archer_slave.tga
    model_flexi			data/models_unit/unit_warband_archer_high.cas, 8
    model_flexi			data/models_unit/unit_warband_archer_med.cas, 15
    model_flexi			data/models_unit/unit_warband_archer_low.cas, 30
    model_flexi			data/models_unit/unit_warband_archer_lowest.cas, max
    model_sprite		slave, 60.0, data/sprites/slave_barb_archer_sprite.spr
    model_sprite		scythia, 60.0, data/sprites/scythia_barb_archer_sprite.spr
    model_sprite		dacia, 60.0, data/sprites/dacia_barb_archer_sprite.spr
    model_tri			400, 0.5f, 0.5f, 0.5f
    Now the model is used across all the factions, so I don't need to make any changes there. But I need to define my texture line for the Britons so that the game knows - when this unit is controlled by the Britons - which texture it should use.

    I don't have a new texture for the Britons, but I'm happy to have them appear in Dacia colours, so I add the following line:
    Code:
    texture				britons, data/models_unit/textures/unit_barb_warband_archer_dacia.tga
    As I copied the .tga file line from the Dacian line, I know that it already exists (even if it's hidden in a .pak) so I know it will be used properly.

    If I didn't have this line, the game would go to its default texture for the model, or possibly no texture at all, in which case the models would appear totally white or invisible.

    I'm also going to add the following:
    Code:
    model_sprite		britons, 60.0, data/sprites/dacia_barb_archer_sprite.spr
    This line makes sure that when I pull the camera back as the Britons, it knows which sprite file to reference. Again, it's just a copy of the Dacian version, so I know it already exists.

    If I didn't have this line, my unit would disappear when I got a certain distance from it.

    So, with my modifications, the final barb_archer entry looks like this:

    Code:
    type barb_archer
    skeleton fs_fast_archer, fs_fast_dagger
    indiv_range 40
    texture				britons, data/models_unit/textures/unit_barb_warband_archer_dacia.tga
    texture dacia, data/models_unit/textures/unit_barb_warband_archer_dacia.tga
    texture scythia, data/models_unit/textures/unit_barb_warband_archer_scythia.tga
    texture slave, data/models_unit/textures/unit_barb_warband_archer_slave.tga
    model_flexi data/models_unit/unit_warband_archer_high.cas, 8
    model_flexi data/models_unit/unit_warband_archer_med.cas, 15
    model_flexi data/models_unit/unit_warband_archer_low.cas, 30
    model_flexi data/models_unit/unit_warband_archer_lowest.cas, max
    model_sprite slave, 60.0, data/sprites/slave_barb_archer_sprite.spr
    model_sprite scythia, 60.0, data/sprites/scythia_barb_archer_sprite.spr
    model_sprite dacia, 60.0, data/sprites/dacia_barb_archer_sprite.spr
    model_sprite		britons, 60.0, data/sprites/dacia_barb_archer_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5f

    Learn how to make your own .cas files here:
    How to Model New 3D Units
    Learn how to make your own sprites here:
    Sprite Generator
    Last edited by Epistolary Richard; 08-02-2005 at 00:51.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (3):



  5. #5

    Default Re: Tutorial: Adding new units for beginners

    Step Four - adding new unit cards

    Unit cards are the small images you see in your HUD that display the unit type. Some skinners will include unit cards with their downloads, others won't. If you do create a unit card for a unit that you've downloaded, it's a good idea to send it to the skinner who made the unit. That way he can include the unit card in the download for other people.

    There is another type of unit card, a larger version called a unit_info card, which are the images you see when you right click on a unit. The method for adding both is similar.

    Unit cards for the Spartans were included in the download (the plain .tga files without the .dds extension). And barocca has made a unit card for a unit of Briton Archers, which I'm also going to use.

    The unit cards and their directories are hidden away in .pak files, so to add more we're going to have to reproduce that to place these unit cards correctly.

    We're going to recreate the directory structure

    - Create a new folder in the Data folder called UI

    - In there create two new folders, one called units and the other unit_info



    - Within each of these folders, create new folders named after the faction that will be using these units (same syntax as the ownership line in edu) - here greek_cities and britons



    - Drop the unit cards in the units folder with the right factionname and the unit_info cards in the unit_info folder with the right factionname



    The file names of the unit cards follow the dictionary line entry in edu, and the unit_info cards the same, but with _info on the end.

    If you don't name it after the dictionary line correctly - or you don't add one at all - then you'll get a default unit card, which looks like a dark/grey/rebel peasant. Every time someone asks on the forums "What's this rebel peasant about?" you can tell them that this is where they went wrong


    Learn how to make your own unit cards here:
    How to - Edit Unit Cards
    Learn how to unpack .pak files here:
    xpak tutorial
    Last edited by Epistolary Richard; 08-02-2005 at 00:55.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (2):



  6. #6

    Default Re: Tutorial: Adding new units for beginners

    Step Five - making it recruitable

    Well, we've done everything we need to make the unit available in custom battles, but I want to be able to recruit them in campaigns as well. To do that I need to edit a file called export_descr_buildings.txt


    Spartan Royal Guard
    In that file, you'll find all the buildings that can be constructed, in particular for my purposes the military buildings. I want the Spartan Royal Guard to be recruitable just like normal Spartans, so I'm going to find their line and duplicate it.

    Code:
    recruit "greek hoplite spartan" 0 requires factions { greek_cities, } and hidden_resource sparta
    recruit "spartan royal guard" 0 requires factions { greek_cities, } and hidden_resource sparta
    The only change I have to make is the name, which I replace with the name listed in the type line in the edu entry.

    So, slotting this entry in means I have an army_barracks building that looks like the following.

    Code:
     army_barracks requires factions { ct_carthage, armenia, pontus,, egyptian, greek, roman, } 
    {
    capability
    {
    recruit "carthaginian city militia" 0 requires factions { spain, } 
    recruit "carthaginian infantry" 0 requires factions { spain, } 
    recruit "spanish scutarii" 0 requires factions { spain, } 
    recruit "barb infantry briton" 0 requires factions { britons, } 
    recruit "barb infantry dacian" 0 requires factions { dacia, } 
    recruit "barb infantry gaul" 0 requires factions { gauls, } 
    recruit "warband spear german" 0 requires factions { germans, } 
    recruit "barb horse archers scythian" 0 requires factions { scythia, } 
    recruit "warband sword briton" 0 requires factions { britons, } 
    recruit "warband sword gaul" 0 requires factions { gauls, } 
    recruit "warband axe german" 0 requires factions { germans, } 
    recruit "warband falx dacian" 0 requires factions { dacia, } 
    recruit "barb warguard gaul" 0 requires factions { gauls, } 
    recruit "barb warguard briton" 0 requires factions { britons, } 
    recruit "barb warguard dacian" 0 requires factions { dacia, } 
    recruit "warband dhaxe german" 0 requires factions { germans, } 
    recruit "warband axe scythian" 1 requires factions { scythia, } 
    recruit "carthaginian city militia" 0 requires factions { carthage, } 
    recruit "numidian javelinmen" 0 requires factions { numidia, } 
    recruit "carthaginian infantry" 0 requires factions { carthage, } 
    recruit "numidian desert warriors" 1 requires factions { numidia, } 
    recruit "carthaginian medium infantry" 0 requires factions { carthage, } 
    recruit "carthaginian heavy infantry" 0 requires factions { carthage, } 
    recruit "numidian legionaries" 0 requires factions { numidia, } 
    recruit "east hillmen" 0 requires factions { eastern, } 
    recruit "east infantry" 0 requires factions { eastern, } 
    recruit "east heavy infantry" 0 requires factions { armenia, } 
    recruit "east hoplite" 0 requires factions { pontus, } 
    recruit "east hoplite brazen shield" 0 requires factions { pontus, } 
    recruit "east legionary" 0 requires factions { armenia, } 
    recruit "egyptian nubian spearmen" 0 requires factions { egyptian, } 
    recruit "egyptian nile infantry" 0 requires factions { egyptian, } 
    recruit "egyptian infantry" 0 requires factions { egyptian, } 
    recruit "egyptian elite guards" 0 requires factions { egyptian, } 
    recruit "greek hoplite militia" 0 requires factions { greek, } 
    recruit "greek levy pikemen" 0 requires factions { seleucid, macedon, } 
    recruit "warband falx thracian" 0 requires factions { thrace, } 
    recruit "greek hoplite" 1 requires factions { greek_cities, } 
    recruit "greek pikemen" 0 requires factions { seleucid, macedon, } 
    recruit "greek hoplite elite" 0 requires factions { greek_cities, } 
    recruit "greek royal pikemen" 0 requires factions { macedon, } 
    recruit "greek silver shield pikemen" 0 requires factions { seleucid, } 
    recruit "greek hoplite spartan" 0 requires factions { greek_cities, } and hidden_resource sparta
    recruit "spartan royal guard" 0 requires factions { greek_cities, } and hidden_resource sparta
    recruit "greek bastarnae" 0 requires factions { thrace, } 
    recruit "roman city militia" 0 requires factions { roman, } 
    recruit "roman hastati" 0 requires factions { roman, } and not marian_reforms 
    recruit "roman infantry auxillia" 0 requires factions { roman, } and marian_reforms 
    recruit "roman princeps" 0 requires factions { roman, } and not marian_reforms 
    recruit "roman legionary cohort i" 0 requires factions { roman, } and marian_reforms 
    recruit "roman legionary first cohort i" 0 requires factions { roman, } and hidden_resource rome and marian_reforms 
    recruit "roman triarii" 0 requires factions { roman, } and not marian_reforms 
    recruit "roman legionary cohort ii" 0 requires factions { roman, } and marian_reforms
    You'll notice that there's actually a level above army_barracks - royal_barracks. If I want to make sure that I can still recruit the Spartan Royal Guard when I upgrade I have to add their line there too.

    Briton Archers
    Much the same, except this time I'm duplicating the Dacian line:
    Code:
    recruit "barb archer dacian" 0 requires factions { dacia, } 
    recruit "barb archer britons" 0 requires factions { britons, }
    Again I change the name to the edu entry type line, but I also have to change the faction name from dacia to britons.
    (NB, don't forget the , after the faction name otherwise it won't work.)

    So the full practice_field entry looks like this, and again, I have to add the Briton Archers line to each of the upgraded missile buildings.

    Code:
    practice_field requires factions { barbarian, ct_carthage, eastern, parthia, egyptian, greek, roman, } 
    {
    capability
    {
    recruit "carthaginian peltast" 0 requires factions { spain, } 
    recruit "barb peltast gaul" 0 requires factions { gauls, } 
    recruit "barb peltast german" 0 requires factions { germans, } 
    recruit "barb slinger briton" 0 requires factions { britons, } 
    recruit "barb archer dacian" 0 requires factions { dacia, } 
    recruit "barb archer britons" 0 requires factions { britons, } 
    recruit "barb archer scythian" 0 requires factions { scythia, } 
    recruit "carthaginian peltast" 0 requires factions { carthage, } 
    recruit "carthaginian archer" 0 requires factions { numidia, } 
    recruit "east peltast" 0 requires factions { armenia, pontus, } 
    recruit "east slinger" 0 requires factions { parthia, } 
    recruit "egyptian peltast" 0 requires factions { egyptian, } 
    recruit "egyptian slingers" 0 requires factions { egyptian, } 
    recruit "greek peltast" 0 requires factions { greek, } 
    recruit "roman velite" 0 requires factions { roman, } and not marian_reforms 
    recruit "roman light infantry auxillia" 0 requires factions { roman, } and marian_reforms
    Learn more about export_descr_buildings here:
    Guide: The Complete EDB Guide (WIP)
    Last edited by Epistolary Richard; 08-02-2005 at 00:47.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (3):



  7. #7

    Default Re: Tutorial: Adding new units for beginners

    The two units are now full installed and ready to fight with:




    You'll remember that, as I didn't have a Briton archer skin, I just defined the Dacian version in the dmb entry. The new unit card, however, shows up fine. My next step will be to get a new texture for them, so they fit in with my army better.

    Remember this? Hopefully it'll make more sense now.



    Download the Spartan Royal Guard
    Download the Briton Archers unit card

    A few final words cool modders make back-ups cool modders use show_err cool modders write tutorials

    Happy modding


    .

    Last edited by Epistolary Richard; 08-22-2005 at 17:31.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

    Members thankful for this post (2):



  8. #8

    Default Re: Tutorial: Adding new units for beginners

    Do you know the formula for adding buildings as requirements?

    I know how to add buildings as a requirement...

    recruit "greek hoplite spartan" 0 requires faction { roman, } and building_present_min_level hinterland_farms farms+2 and building_present_min_level market market

    This requires both buildings in order to build a unit.

    But not how to add multiple buildings to stop a unit being built. I tried the same formula:

    recruit "greek hoplite spartan" 0 requires faction { roman, } and not building_present_min_level hinterland_farms farms+2 and not building_present_min_level market market

    but the game ignores the second building requirement, taking only the first as necessary. Any idea how to fix this?

  9. #9

    Default Re: Tutorial: Adding new units for beginners

    Quote Originally Posted by Epistolary Richard
    Step Four - adding new unit cards


    If you don't name it after the dictionary line correctly - or you don't add one at all - then you'll get a default unit card, which looks like a dark/grey/rebel peasant. Every time someone asks on the forums "What's this rebel peasant about?" you can tell them that this is where they went wrong
    I did just so and I still have the grey peasant.

    also I noticed that the name of the card is not always the same as the EDU dictionnary, as I'm modding upon a Magna carta Mod and I see some cards being names as :

    #RTR_GREEK_CAVALRY

    whereas the edu entry is :

    greek_cavalry
    Timeo danaos et dona ferentes
    Hey, this avatar simply looks like ME !!!

  10. #10

    Default Re: Tutorial: Adding new units for beginners

    Have you checked to see if there is a second edu entry with a dictionary tag called rtr_greek_cavalry?
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  11. #11

    Default Re: Tutorial: Adding new units for beginners

    Quote Originally Posted by Epistolary Richard
    Have you checked to see if there is a second edu entry with a dictionary tag called rtr_greek_cavalry?
    Yes, I checked that and there is none
    Timeo danaos et dona ferentes
    Hey, this avatar simply looks like ME !!!

  12. #12

    Default Re: Tutorial: Adding new units for beginners

    Well, I can think of a few explanations, but I've never played RTR so I couldn't say anything for definite. You might want to ask one of their team. The tutorial as written is how I understand the process, if elements are wrong or incomplete then I'm happy to add or amend to it.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  13. #13

    Default Re: Tutorial: Adding new units for beginners

    Quote Originally Posted by Epistolary Richard
    Well, I can think of a few explanations, but I've never played RTR so I couldn't say anything for definite. You might want to ask one of their team. The tutorial as written is how I understand the process, if elements are wrong or incomplete then I'm happy to add or amend to it.
    I checked again and the RTR entries are leftover from the RTR mod I do not use anymore.

    Still, my #SPECIAL_ARCHERS.TGA are simple copy/paste of the Vanilla #EGYPTIAN_ARCHER.TGA unpacked with Vercingetorix tool.

    the dictionnary lines are :
    type special archers
    dictionary special_archers ; Special Archers
    Timeo danaos et dona ferentes
    Hey, this avatar simply looks like ME !!!

  14. #14
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: Tutorial: Adding new units for beginners

    Very Nice tutorial Thank you very Much!

    Its really good to know how everything matches together.

    A small question , prolly was answered a long time ago, what are the .rum files in the Models_Unit folder?

    Thanks
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  15. #15

    Default Re: Tutorial: Adding new units for beginners

    I believe rum files are new type of model files introduced in 1.2, similar to cas files.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  16. #16
    Alienated Senior Member Member Red Harvest's Avatar
    Join Date
    Jan 2003
    Location
    Searching for the ORG's lost honor
    Posts
    4,657

    Default Re: Tutorial: Adding new units for beginners

    Nice work on the guide.

    Just wanted to add that there is a british archer skin hidden away in the vanilla game ("lost unit" skin.) So just substitute "briton" for "dacia" in the tga part of the entry in descr_model_battle.txt and you will have a light/barbarian british archer that matches the unit card tga shown in this tutorial.

    There is also a hidden tga for the skirmisher warband for the britons...in case anyone wants to add those to their game. (I'm doing that right now actually, LOL.)
    Rome Total War, it's not a game, it's a do-it-yourself project.

  17. #17
    Member Member Kratos's Avatar
    Join Date
    Dec 2005
    Location
    "You don't want to know".........
    Posts
    38

    Default Re: Tutorial: Adding new units for beginners

    I'm wondering if the Paint program will work for making a unit card?
    -Spartans do not ask how many but where they are.-Leanardo da Vinci

  18. #18

    Post Re: Tutorial: Adding new units for beginners

    Quote Originally Posted by Kratos
    I'm wondering if the Paint program will work for making a unit card?
    MS Paint can't handle .TGA files, which are what you need to save the unit cards as in the appropriate UI subsection folder. Try The GIMP instead, its free image editing software, and is quite powerful to an extent. Although it doesn't contain many of the advanced features of Photoshop or Paint Shop Pro, you can still create unit cards no problem.

    Download it here

    More info here


    Currently developing Rome: Total Gameplay (RTG), an unofficial mod for vanilla Rome: Total War v1.5

    Features: improved battles, new units to recruit, more buildings to construct, a modified campaign map, and much more!
    RTG Main Topic
    , Click here to download RTG v1.0

  19. #19

    Default My rome total war wont work when I have made new units.

    First I did this:

    type greek hoplite elite
    dictionary greek_hoplite_elite ; Armoured Hoplites
    category infantry
    class spearmen
    voice_type Heavy_1
    soldier greek_armoured_hoplite, 40, 0, 1.3
    officer greek_standard
    attributes sea_faring, hide_forest, can_sap, hardy
    formation 1, 1, 2, 2, 5, square, phalanx
    stat_health 1, 0
    stat_pri 9, 7, no, 0, 0, melee, simple, piercing, spear, 25 ,1
    stat_pri_attr spear
    stat_sec 7, 3, no, 0, 0, melee, simple, piercing, sword, 25 ,1
    stat_sec_attr no
    stat_pri_armour 11, 6, 5, metal
    stat_sec_armour 0, 0, flesh
    stat_heat 4
    stat_ground 2, 0, 0, 0
    stat_mental 8, normal, highly_trained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 640, 210, 70, 100, 640
    ownership greek_cities

    copied it and made it to:

    type macedon hoplite elite
    dictionary macedon_hoplite_elite ; Armoured Hoplites
    category infantry
    class spearmen
    voice_type Heavy_1
    soldier greek_armoured_hoplite, 40, 0, 1.3
    officer greek_standard
    attributes sea_faring, hide_forest, can_sap, very_hardy
    formation 1, 1, 2, 2, 5, square, phalanx
    stat_health 1, 0
    stat_pri 13, 8, no, 0, 0, melee, simple, piercing, spear, 25 ,1
    stat_pri_attr spear
    stat_sec 8, 5, no, 0, 0, melee, simple, piercing, sword, 25 ,1
    stat_sec_attr no
    stat_pri_armour 15, 7, 5, metal
    stat_sec_armour 0, 0, flesh
    stat_heat 6
    stat_ground 2, 0, 0, 0
    stat_mental 15, disciplined, highly_trained
    stat_charge_dist 30
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 700, 210, 70, 100, 700
    ownership macedon

    and I went on:

    greek_hoplite_elite
    greek_hoplite_elite_descr
    greek_hoplite_elite_descr_shortcopied it and made a new one

    macedon_hoplite_elite
    macedon_hoplite_elite_descr
    macedon_hoplite_elite_descr_short

    continued:


    ¬----------------

    {greek_hoplite_elite} Armoured Hoplites

    {greek_hoplite_elite_descr}
    Superior\nHardy\nCan Form Phalanx\nSapping Ability\n\nArmoured hoplites are an elite among Greek soldiery, carefully selected and given the best training to make them superior spearmen. Each of them is equipped with good body armour, greaves and a helmet and carries a large round shield, the hoplon that gives this kind of soldier the name of hoplite. Each man is also armed with a formidable thrusting spear called the xyston and a sword. They are usually employed as solid, close-packed groups of men, presenting a wall of spear points to the enemy. In phalanx formation, they use weight of numbers to batter into enemy formations.\n\nThey are vulnerable to flank and rear attacks, and ideally need some sort of light supporting troops to screen them as they approach the enemy.

    {greek_hoplite_elite_descr_short}
    Armoured hoplites are an elite among Greek soldiery, carefully selected and given the best training to make them superior spearmen.
    ¬----------------

    made a new one:

    ¬----------------

    {macedon_hoplite_elite} Armoured Hoplites

    {macedon_hoplite_elite_descr}
    Superior\nvery_Hardy\nCan Form Phalanx\nSapping Ability\n\nArmoured hoplites are an elite among macedon soldiery, carefully selected and given the best training to make them superior spearmen. Each of them is equipped with good body armour, greaves and a helmet and carries a large round shield, the hoplon that gives this kind of soldier the name of hoplite. Each man is also armed with a formidable thrusting spear called the xyston and a sword. They are usually employed as solid, close-packed groups of men, presenting a wall of spear points to the enemy. In phalanx formation, they use weight of numbers to batter into enemy formations.\n\nThey are vulnerable to flank and rear attacks, and ideally need some sort of light supporting troops to screen them as they approach the enemy.

    {macedon_hoplite_elite_descr_short}
    Armoured hoplites are an elite among macedon soldiery, carefully selected and given the best training to make them superior spearmen.
    ¬----------------

    next I did was:

    type greek_armoured_hoplite
    skeleton fs_spearman, fs_swordsman ; combat spear
    indiv_range 40
    texture carthage, data/models_unit/textures/unit_greek_elite_hoplite_carthage.tga
    texture greek_cities, data/models_unit/textures/unit_greek_elite_hoplite_greek.tga
    model_flexi data/models_unit/unit_greek_hoplite_elite_high.cas, 15
    model_flexi data/models_unit/unit_greek_hoplite_elite_med.cas, 30
    model_flexi data/models_unit/unit_greek_hoplite_elite_low.cas, 40
    model_flexi data/models_unit/unit_greek_hoplite_elite_lowest.cas, max
    model_sprite greek_cities, 60.0, data/sprites/greek_cities_greek_armoured_hoplite_sprite.spr
    model_sprite carthage, 60.0, data/sprites/carthage_greek_armoured_hoplite_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5f

    copied and made a new:

    type greek_armoured_hoplite
    skeleton fs_spearman, fs_swordsman ; combat spear
    indiv_range 40
    texture carthage, data/models_unit/textures/unit_greek_elite_hoplite_carthage.tga
    texture greek_cities, data/models_unit/textures/unit_greek_elite_hoplite_greek.tga
    texture macedon, data/models_unit/textures/unit_greek_elite_hoplite_greek.tga
    model_flexi data/models_unit/unit_greek_hoplite_elite_high.cas, 15
    model_flexi data/models_unit/unit_greek_hoplite_elite_med.cas, 30
    model_flexi data/models_unit/unit_greek_hoplite_elite_low.cas, 40
    model_flexi data/models_unit/unit_greek_hoplite_elite_lowest.cas, max
    model_sprite greek_cities, 60.0, data/sprites/greek_cities_greek_armoured_hoplite_sprite.spr
    model_sprite macedon, 60.0, data/sprites/greek_cities_greek_armoured_hoplite_sprite.spr
    model_sprite carthage, 60.0, data/sprites/carthage_greek_armoured_hoplite_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5f

    and the last thing was:

    recruit "greek hoplite elite" 0 requires factions { greek_cities, }
    recruit "macedon hoplite elite" 0 requires factions { macedon, }


    Do someone know why it want work...... It just jump out before I come to the menu????
    Please help

  20. #20

    Default Re: Tutorial: Adding new units for beginners

    hi, im new to these forums, and when i looked into your guide i thought...yes! this is exactly what i need!!! and so i did manage to create a new unit, except the unit cards display it as a dark greenish - grey peasant!! i know what's wrong, i have not created a unit card for my new unit yet. So im planning to add one, but, the problem is, EXACTLY HOW do i create a new unit card, or maybe if that isn't possible i could even replace them with cards that alread exists...but i don't kno how to. please help me!!!

  21. #21

    Default Re: Tutorial: Adding new units for beginners

    You can find out more about creating unit cards here:
    https://forums.totalwar.org/vb/showthread.php?t=51373
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  22. #22
    Member Member Kratos's Avatar
    Join Date
    Dec 2005
    Location
    "You don't want to know".........
    Posts
    38

    Default Re: Tutorial: Adding new units for beginners

    What I am finding odd is that in RTW/ Data I don't have UI folder at all. Yet in BI i do have UI. This is giving me headaches. Any ideas?
    -Spartans do not ask how many but where they are.-Leanardo da Vinci

  23. #23
    is not a senior Member Meneldil's Avatar
    Join Date
    Aug 2004
    Location
    France
    Posts
    3,074

    Default Re : Tutorial: Adding new units for beginners

    The UI in RTW are stored in the ui_0 and ui_1 pack files (Rome - Total War\Data\packs). To extract them, you'll need Vercingetorix' pack extractor (that may be found in the modding tools topic)

  24. #24

    Default Re: Tutorial: Adding new units for beginners

    Excellent tutorial. The best out there. Looks like a lot of hard work Epistolary Richard to put everything nicely into one tutorial package!

  25. #25

    Post Re: Tutorial: Adding new units for beginners

    Quote Originally Posted by Epistolary Richard
    This flowchart highlights the most important files for each aspect of adding a new unit. Scroll down to read more about them, or click on a file to learn more about that step.






    Do you think export_descr_sounds_unit_voice.txt should be added to this?

    Superb guide btw ER, this is a great starting point for any potential and new modders alike.


    Currently developing Rome: Total Gameplay (RTG), an unofficial mod for vanilla Rome: Total War v1.5

    Features: improved battles, new units to recruit, more buildings to construct, a modified campaign map, and much more!
    RTG Main Topic
    , Click here to download RTG v1.0

  26. #26
    J-23 Member Hans Kloss's Avatar
    Join Date
    Oct 2003
    Location
    Richmond upon Thames
    Posts
    245

    Default Re: Tutorial: Adding new units for beginners

    Do you think export_descr_sounds_unit_voice.txt should be added to this?
    It probabaly should but whole process needs of adding voices to new units needs to be explained properly as it is not just adding lines to export_descr_sounds_unit_voice.txt
    Last edited by Hans Kloss; 01-19-2006 at 10:58.

  27. #27
    Addicted lurker Member TiFlo's Avatar
    Join Date
    Feb 2006
    Location
    Up North, in my igloo
    Posts
    28

    Default Re: Tutorial: Adding new units for beginners

    Hi all,


    Very nice tutorial! I guess it should work, but I'm stuck: I'm trying to add 3 new units (+2officers & 1 aquilifer), which does, if I'm correct, 6 more units to be put in DMB.
    There lies my problem, since you can not go over 255 entries in DMB, when I lauch the game, all I get is a nice CTD, and the -show_err indeed tells me that DMB has already reached his full limit of units.



    Is there any way to get rid of some units, or combining them in order to decrease their effective number in DMB? For I tried a few things but nothing has been working so far...

    If anyone feels to help...


    "To his dog every man is Napoleon ; hence the constant popularity of dogs." (Aldous Huxley)



  28. #28

    Default Re: Tutorial: Adding new units for beginners

    Better to ask in the Modding Questions forum.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  29. #29
    Addicted lurker Member TiFlo's Avatar
    Join Date
    Feb 2006
    Location
    Up North, in my igloo
    Posts
    28

    Default Re: Tutorial: Adding new units for beginners

    Thanks,

    I finally kind of sorted it out!

    Anyway, I still giong to keep an eye on the modding sectio and see if there is anything else I could use.


    "To his dog every man is Napoleon ; hence the constant popularity of dogs." (Aldous Huxley)



  30. #30
    RTK9Imrahil Member Goalie's Avatar
    Join Date
    Mar 2006
    Location
    USA, Iowa
    Posts
    399

    Default Re: Tutorial: Adding new units for beginners

    Thanks for all you work. I have created Knights of the Round Table from Scythian Noble Archers. They are really cool.


    -We do the impossible every day, miracles take a bit longer- Air Force Motto

Page 1 of 7 12345 ... LastLast

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