Page 1 of 2 12 LastLast
Results 1 to 20 of 36

Thread: How To Make New Units

  1. #1

    Default How To Make New Units

    How to Make New Units

    This guide assumes that you have unpacked the game’s data files using the method shown here: http://rtw.heavengames.com/cgi-bin/f...t&f=9,5829,,10.
    Also, it is assumed that you have an understanding of the export_descr_unit.txt file. For information on that file, see my export_descr_unit.txt guide. For my example, I will be making Berserkergang. Basically, they will look like Viking Raiders with an armor upgrade, with a small unit size and a large attack. In addition, they will be led by a Norse Swordsman. It usually works best to start with a similar unit, so I will start with Viking Raiders. Their entry looks like this:
    type Viking Raiders
    dictionary Viking_Raiders ; Viking Raiders
    category infantry
    class light
    voice_type Light
    banner faction main_infantry
    banner holy crusade
    soldier Viking_Raiders, 60, 0, 1
    attributes sea_faring, hide_forest, hardy, can_withdraw
    formation 1.2, 1.2, 2.4, 2.4, 4, square
    stat_health 1, 0
    stat_pri 9, 2, no, 0, 0, melee, melee_blade, slashing, axe, 25, 1.2
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr ap
    stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr no
    stat_pri_armour 0, 3, 6, flesh
    ;stat_armour_ex 0, 4, 5, 7, 3, 6, 6, flesh
    stat_sec_armour 0, 0, flesh
    stat_heat 2
    stat_ground 1, -2, 3, 2
    stat_mental 5, normal, untrained
    stat_charge_dist 40
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 480, 155, 85, 65, 480, 4, 120
    armour_ug_levels 0, 1, 2, 3
    armour_ug_models Viking_Raiders, Viking_Raiders_ug1, Viking_Raiders_ug2, Viking_Raiders_ug3
    ownership denmark, slave
    era 0 denmark
    ;unit_info 9, 0, 9
    I will edit it a bit:


    type Norse Super Warriors
    dictionary Norse_Super_warriors ; Berserkergang
    category infantry
    class heavy
    voice_type Heavy
    accent East_European
    banner faction main_infantry
    banner holy crusade
    soldier Viking_Raiders_ug1, 12, 0, 1.2
    officer norse_swordsmen_ug2
    attributes sea_faring, hide_improved_forest, very_hardy, can_withdraw, frighten_foot, hide_anywhere
    formation 1.2, 1.2, 2.4, 2.4, 4, square, shield_wall
    stat_health 1, 0
    stat_pri 19, 5, no, 0, 0, melee, melee_blade, slashing, axe, 25, 1.2
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr ap
    stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr no
    stat_pri_armour 4, 15, 10, flesh
    ;stat_armour_ex 0, 2, 3, 5, 3, 8, 8, flesh
    stat_sec_armour 0, 0, flesh
    stat_heat 4
    stat_ground 1, -2, 3, 4
    stat_mental 10, disciplined, highly_trained
    stat_charge_dist 40
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 800, 103, 65, 150, 800, 2, 300
    armour_ug_levels 0
    armour_ug_models Viking_Raiders
    ownership denmark
    era 0 denmark
    era 1 denmark
    era 2 denmark
    ;unit_info 7, 0, 11
    These warriors will be powerful, but not unstoppable. Here’s what they look like ingame:
    ….and that’s on huge unit sizes! They may look good, but the unit description reveals that they are far from finished:


    Note not only the absence of a name and description, but the absence of a proper picture. These are our next goals.
    The first task is to give the unit a real name. To do this, you need to go to the text folder inside the main data folder. Look for a file called export_units.txt.strings.bin. Note that all of the files in that particular folder are in the .strings.bin file format. This cannot be modified, but a number of good converters exist. I suggest:
    http://www.twcenter.net/forums/downl...o=file&id=1006
    The only problem is that you need to have the Python scripting language installed on your computer. Once you have used the converter, you can open up the newly-generated export_units.txt file and will be presented with a number of text lines. Go to the bottom of the file to enter new text. For this next part, you need to know the dictionary name of your unit. This is the name in the “dictionary” line of the export_descr_unit.txt file. For example, mine is “Norse_Super_warriors”. Use this name to generate three new lines in export_units.txt. The first should start with the dictionary name enclosed in curly braces and then have the ingame name afterwards:
    {Norse_Super_warriors}Berserkergang
    This is simply the name the game uses to refer to the unit. The next line should be the dictionary line enclosed in curly braces, with “_descr” added to the end, and then a description of the unit:
    {Norse_Super_warriors_descr}Berserkergang are the most powerful of the Danish fighters. Comparable to the Spartans of old, these men come from an exclusive warrior society, where they are bred for combat. In battle, no foe can stand against them for long.
    This is the description used in the unit’s information scroll. The last line should be the dictionary line enclosed in curly braces with “_descr_short” added to the end, and then a condensed description:
    {Norse_Super_warriors_descr_short}Berserkergang are extremely powerful axe-armed fighters.
    This description is used in the army customization screen in custom battles, as well as in the condensed recruitment report. Save the changes and you are good to go. Next time you start the game, it will automatically rebuild the .strings.bin file from the .txt file you just edited, so there is no need for any reconverting.
    We are now almost done with the unit. The last part is adding in the ui elements – the images. The first UI element that you will want to consider adding is a unit info card. This is the image used for the unit’s portrait in the unit info panel. Simply take a screenshot of your unit in action, and then use Photoshop to make it into a 191x280 image. I would recommend cropping it a bit, and doing a close-up on an individual soldier. If you do not have Photoshop (like me), then try GIMP. It is a free Photoshop alternative. You can find it here: http://www.gimp.org. Once you have created your image, then go to the data/ui/unit_info folder. There you should see 25 folders – one for each faction, as well as a “merc” folder for mercenaries. Put an the image into every needed folder, saving it as “your unit’s dictionary name_info.tga”. For example, here is my norse_super_warriors_info.tga file:


    The next step is to make a unit card. This is the card shown in the row at the bottom of the screen. To do this, make a 48x64 image of your unit. Be sure to not have any color in the background or else the background will always be that color. Once you have made it, go into your data/ui/units folder. Inside this folder you should see 25 folders – one for every faction, as well as a “mercs” folder for mercenaries. Then go into the appropriate folder and save it as “#your unit name.tga”. For example, here is my #norse_super_warriors.tga:


    (the black background is because I have the image in a .bmp format, which displays black where alpha channel, or transparency, should go)
    Once you have done all of those, your unit is complete, and you should then run it through a few playtests. Use the Grassy Plains map on Medium difficulty. I had 1 unit of my Berserkergang fight 1 unit of French Dismounted Chivalric Knights. We barely lost:


    Since I want my unit to be “supermen”, a revision is in order. Here are the new stats:
    type Norse Super Warriors
    dictionary Norse_Super_warriors ; Berserkergang
    category infantry
    class heavy
    voice_type Heavy
    accent East_European
    banner faction main_infantry
    banner holy crusade
    soldier Viking_Raiders_ug1, 12, 0, 1.2
    officer norse_swordsmen_ug2
    attributes sea_faring, hide_improved_forest, very_hardy, can_withdraw, frighten_foot, hide_anywhere
    formation 1.2, 1.2, 2.4, 2.4, 4, square, shield_wall
    stat_health 1, 0
    stat_pri 24, 12, no, 0, 0, melee, melee_blade, slashing, axe, 25, 2
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr ap, area, launching
    stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr no
    stat_pri_armour 7, 17, 13, flesh
    ;stat_armour_ex 0, 2, 3, 5, 3, 8, 8, flesh
    stat_sec_armour 0, 0, flesh
    stat_heat 4
    stat_ground 1, -2, 3, 4
    stat_mental 10, disciplined, highly_trained
    stat_charge_dist 40
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 800, 103, 65, 150, 800, 2, 300
    armour_ug_levels 0
    armour_ug_models Viking_Raiders
    ownership denmark
    era 0 denmark
    era 1 denmark
    era 2 denmark
    ;unit_info 7, 0, 11
    And…


    Now that’s more like it!! Now that you know how to make your own units, or edit existing ones, a whole new world is open to you. This is, in fact, the cornerstone of modding. Although your units will show up in custom battles, they will not be in the campaign. My next guide should remedy that. Be ready for A Guide to the Export_Descr_Buildings.txt. In the meantime, try not to have too much fun making new units!
    Mythic_Commodore
    Last edited by Gigantus; May 29, 2010 at 10:37 PM. Reason: Allocated type

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  2. #2
    EVYATAR's Avatar EvyatarNevoDesign
    Join Date
    Jul 2008
    Location
    Israel
    Posts
    1,378

    Default Re: How To Make New Units

    vary good Guide!
    R.I.P Blackomur | The Shadow of Ishtar | Proud to be israeli
    My Tutorial | My Workshop | I.A.F Web | 2D Artist & Skinner

  3. #3

    Default Re: How To Make New Units

    Thanks.

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  4. #4
    helmersen's Avatar Praepositus
    Join Date
    Sep 2008
    Location
    Oslo, Norway
    Posts
    5,759

    Default Re: How To Make New Units

    Hi I think your guide is good, but after I have done your first step, changing the unit stats name etc my units wont change stats or appearance in the custom battle What to do?
    Interested in how Attila and the new LONGBEARDS DLC plays?

    Check out my Total War Attila: Jutes Let's Play: http://youtu.be/rFyxh4mj1pQ
    Check out my Total War Attila: The Langobards Let's Play: http://youtu.be/lMiHXVvVbCE
    Total War: Attila with ERE vs Sassanids GEM at max settings:
    http://youtu.be/jFYENvVpwIs
    Total War: Rome II Medieval Kingdoms Mod Gameplay: http://youtu.be/qrqGUYaLVzk

  5. #5

    Default Re: How To Make New Units

    Hmmm.... Have you tried putting

    [io]
    file_first = true

    at the bottom of your preference file?

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  6. #6

    Default Re: How To Make New Units

    Maybe I'm just a newbie at programing, but I don't understand this Python thing. Is there any alternative?

  7. #7

    Default Re: How To Make New Units

    There is. This will allow you to directly edit .strings.bin files -
    http://www.twcenter.net/forums/downl...do=file&id=993

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  8. #8
    M2TWRocks's Avatar Domesticus
    Join Date
    Jun 2007
    Location
    New Orleans
    Posts
    2,058

    Default Re: How To Make New Units

    Commodore, thanks for the insightful post. I know a tiny bit about modding...I've modded my own game non-stop since M2TW was released. I am now at the point that I actually enjoy the Vanilla experience more than all the mods available. Unfortunately, the skins aren't so good. I'd like to take skins I've found in mods across the board and transfer them to the units I'd like them to go to in the Vanilla game. Some of these skins aren't simply a recolored skin of the original, they are completely different. Like some of the Broken Crescent skins I'd like to use.(Don't worry. I know they don't allow people to use them in public mods. This will be purely for my own enjoyment.)

    How exactly do I approach this? I've toyed around with it in the past, but had mixed results. How hard would it be to use the skin for Nubian spearment in Broken Crescent and use it for the Vanilla Nubian spearmen, for example? Any help would be greatly appreciated. : )

  9. #9

    Default Re: How To Make New Units

    Well, what you would need to do at this point is to take out all of the vanilla Muslim units and replace them with BC ones. That's how I did it for C+C (before, of course, I had to remove them again).So go through the processes here, except in reverse, to take out the vanilla units. Then add in the BC units. The only thing is that you will need to edit the battle_models.modelsdb. If you don't know how to do that, I'm pretty sure there's a tutorial somewhere. If not, tell me and I can help with that, too.

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  10. #10
    M2TWRocks's Avatar Domesticus
    Join Date
    Jun 2007
    Location
    New Orleans
    Posts
    2,058

    Default Re: How To Make New Units

    Quote Originally Posted by Mythic_Commodore View Post
    Well, what you would need to do at this point is to take out all of the vanilla Muslim units and replace them with BC ones. That's how I did it for C+C (before, of course, I had to remove them again).So go through the processes here, except in reverse, to take out the vanilla units. Then add in the BC units. The only thing is that you will need to edit the battle_models.modelsdb. If you don't know how to do that, I'm pretty sure there's a tutorial somewhere. If not, tell me and I can help with that, too.
    Hey, thanks. I'm been working on this for two solid days now and have somewhat gotten the hang of it. It's very frustrating at first, but very rewarding once I got the hang of it. Finally Egypt looks like a unique, kick butt faction. The modelDB is a NIGHTMARE, but I figured out a pretty quick way to navigate through it. Thanks for the help. : )

  11. #11

    Default Re: How To Make New Units

    Alright, so this thread is over a year old, but maybe someone will still answer. I've been reading this and http://www.twcenter.net/forums/showthread.php?t=78236. I play the Stainless Steel mod with RR/RC and BGR III (and IV sometimes). I've read something somewhere at sometime about the maximum number of units. I'm unclear about where this maximum is placed: is there a total number of units that can be placed in the export_descr_unit? Or the battle_models.modeldb file?

    Thanks in advance.
    I don't always talk in tautologies, but when I do, I talk in tautologies.




  12. #12
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: How To Make New Units

    Maximum number of units is the number in the EDU of which is 500, and my understanding, SS is already there.

  13. #13

    Default Re: How To Make New Units

    Thanks. One more question...hope I'm not getting too off topic...to replace, say a merc unit, is it the dictionary, type, or another line I need to replace in other files?
    I don't always talk in tautologies, but when I do, I talk in tautologies.




  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: How To Make New Units

    References to a non existing unit that need to be replaced\removed are possibly in the campaign_script, descr_strat and obviuosly the EDB










  15. #15
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: How To Make New Units

    More likely descr_mercenaries than EDB if it's a merc.

  16. #16

    Default Re: How To Make New Units

    I've used your brilliant tutorial to make a scottish_knights unit. They're basically a copy of english knights without the full plate upgrade. I got the unit model working after a bit of trial and error, but I've got stuck on this bit
    Spoiler Alert, click show to read: 
    Note not only the absence of a name and description, but the absence of a proper picture. These are our next goals.
    The first task is to give the unit a real name. To do this, you need to go to the text folder inside the main data folder. Look for a file called export_units.txt.strings.bin. Note that all of the files in that particular folder are in the .strings.bin file format. This cannot be modified, but a number of good converters exist. I suggest:
    http://www.twcenter.net/forums/downl...o=file&id=1006
    The only problem is that you need to have the Python scripting language installed on your computer. Once you have used the converter, you can open up the newly-generated export_units.txt file and will be presented with a number of text lines. Go to the bottom of the file to enter new text. For this next part, you need to know the dictionary name of your unit. This is the name in the “dictionary” line of the export_descr_unit.txt file. For example, mine is “Norse_Super_warriors”. Use this name to generate three new lines in export_units.txt. The first should start with the dictionary name enclosed in curly braces and then have the ingame name afterwards:
    {Norse_Super_warriors}Berserkergang
    This is simply the name the game uses to refer to the unit. The next line should be the dictionary line enclosed in curly braces, with “_descr” added to the end, and then a description of the unit:
    {Norse_Super_warriors_descr}Berserkergang are the most powerful of the Danish fighters. Comparable to the Spartans of old, these men come from an exclusive warrior society, where they are bred for combat. In battle, no foe can stand against them for long.
    This is the description used in the unit’s information scroll. The last line should be the dictionary line enclosed in curly braces with “_descr_short” added to the end, and then a condensed description:
    {Norse_Super_warriors_descr_short}Berserkergang are extremely powerful axe-armed fighters.
    This description is used in the army customization screen in custom battles, as well as in the condensed recruitment report. Save the changes and you are good to go. Next time you start the game, it will automatically rebuild the .strings.bin file from the .txt file you just edited, so there is no need for any reconverting.
    We are now almost done with the unit. The last part is adding in the ui elements – the images. The first UI element that you will want to consider adding is a unit info card. This is the image used for the unit’s portrait in the unit info panel. Simply take a screenshot of your unit in action, and then use Photoshop to make it into a 191x280 image. I would recommend cropping it a bit, and doing a close-up on an individual soldier. If you do not have Photoshop (like me), then try GIMP. It is a free Photoshop alternative. You can find it here: http://www.gimp.org. Once you have created your image, then go to the data/ui/unit_info folder. There you should see 25 folders – one for each faction, as well as a “merc” folder for mercenaries. Put an the image into every needed folder, saving it as “your unit’s dictionary name_info.tga”.


    I'm sure I've done everything you said but the name, description, picture etc aren't appearing. I've also noticed that the .bin files in the text folder that I converted into .txt are still .txt. Is that right? I thought they were supposed to go back to .bin.

    Here is the end of my export_units.txt to show you what I've done.
    Spoiler Alert, click show to read: 
    {war_galley}War Galley
    {war_galley_descr}Used throughout the Mediterranean since the 11th century. War Galleys are larger than normal galleys, and carry more tonnage as a result of being equipped with siege weapons like ballista or catapults, and having a larger compliment of oarsmen and soldiers onboard. The standard tactic for engaging is to disable the opposing ships' sails then ram and board it.
    {war_galley_descr_short}War Galleys are larger than normal galleys. Equipped with ballista or catapults.
    {scottish_knights}Scottish Knights
    {scottish_knights_descr}While the Highlanders prefer to fight in the old way, on foot and usually with a claymore, the Scottish Lowlanders have been quick to emulate the tactics of their English rivals.
    {scottish_knights_descr_short}Scottish knights who fight in the English style.
    Last edited by PotentSchraphlon; December 17, 2010 at 02:59 PM.

  17. #17
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: How To Make New Units

    I'm sure I've done everything you said but the name, description, picture etc aren't appearing. I've also noticed that the .bin files in the text folder that I converted into .txt are still .txt. Is that right? I thought they were supposed to go back to .bin.
    The txt files are not supposed to "turn into" string.bin files -they usually cause a new string.bin file to generate. This is only the case if the txt file is 'younger' then the previous string.bin or the string.bin file doesn't exist.
    Due to reasons only known to higher mortals, this sometimes doesn't happen. Simply delete the associated string.bin file and run your game again.
    Should the new string.bin file still not generate, simply replace the first line in the txt file (the fancy sign line) with a first line from a 'working' txt file.










  18. #18

    Default Re: How To Make New Units

    I've just done that and still no string.bin

    EDIT: I've even tried manually changing export_units.txt into a strings.bin by renaming the file and there's no change. Game seems to work fine but still says unlocalised_text_placement.

    EDIT2: I continued with the tutorial to add a unit card and that now works, but still no luck with the export_units.txt issue.
    Last edited by PotentSchraphlon; December 18, 2010 at 07:16 AM.

  19. #19

    Default Re: How To Make New Units

    I didn't read your previous posts but if the .bin file is not generating for some reason than just put a default .bin file and when you will launch the game it will update from the relevant .txt file and if it doesn't than your text file is corrupt.

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: How To Make New Units

    Upload the txt file and I will have a look. Alternatively use the BinEditor that comes with Geomod - import txt file, save as string.bin file
    I have attached the Editor here. Simply extract it into your data\text folder and then "import" the txt file and "save as" string.bin










Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •