Page 1 of 34 123456789101126 ... LastLast
Results 1 to 20 of 689

Thread: How to add a new unit into game

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Stephan's Avatar Campidoctor
    Join Date
    Jun 2008
    Location
    Wien
    Posts
    1,575

    Default How to add a new unit into game

    Thats quite difficult for beginners, at least it was difficult for me
    so i made this tutorial, i hope it is helpfull


    if you want to add a new unit into game you just have to edit 2 files

    the battle_models.modelbd file and then the export_descr_units file

    open the "_units" folder which is locaded in the "unit_models" folder and create a new folder and call it "new_folder" and in this folder you create another one and call it "textures"

    instead of "new_folder" you can use any other name but just remember it has to be the same as the green marked one in the battle_models file

    copy the .mesh files (in this case "Hoplites_early_ug0_lod0-3.mesh") into the "new_folder" folder and copy your new texture and the norm_texture (in this case "ionian_hoplite.texture") into the "textures" folder.

    since the hoplite unit is a spear unit we are going to use another spear unit as base, eg the levy_spearmen unit.
    if your unit is eg an archer you copy an archer unit entry instead

    these are the original levy spearmen entries.
    the orange entries are the ones you have to change.
    the green ones tell the game where the file is locaded

    the numbers before the lines have to match the string lenght.
    eg "stephan" has 7 letters, so you would have to write a 7 before "stephan":
    7 stephan



    13 levy_spearmen
    1 4
    60 unit_models/_Units/EN_Peasant_Padded/levy_spearmen_lod0.mesh 121
    60 unit_models/_Units/EN_Peasant_Padded/levy_spearmen_lod1.mesh 900
    60 unit_models/_Units/EN_Peasant_Padded/levy_spearmen_lod2.mesh 2500
    60 unit_models/_Units/EN_Peasant_Padded/levy_spearmen_lod3.mesh 6400
    2 (this number says how many factions own this unit, in this case england and slave, so 2)
    7 england
    79 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_england.texture
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture
    49 unit_sprites/england_Dummy_EN_Spearmen_sprite.spr
    5 slave
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_rebels.texture
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture
    47 unit_sprites/slave_Dummy_EN_Spearmen_sprite.spr
    2
    7 england (these files are responsible for shields)
    58 unit_models/AttachmentSets/Final Kite_england_diff.texture
    58 unit_models/AttachmentSets/Final Kite_england_norm.texture 0
    5 slave
    56 unit_models/AttachmentSets/Final Kite_slave_diff.texture
    56 unit_models/AttachmentSets/Final Kite_slave_norm.texture 0
    1
    4 None
    10 MTW2_Spear 0
    2
    18 MTW2_Spear_primary
    14 fs_test_shield 0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    here is the new entry (orange are the changed entries)
    i also changed the faction ownership from england to france (blue)

    14 ionian_hoplite
    1 4
    55 unit_models/_Units/
    new_folder/Hoplites_early_ug0_lod0.mesh 121
    55 unit_models/_Units/
    new_folder/Hoplites_early_ug0_lod1.mesh 900
    55 unit_models/_Units/
    new_folder/Hoplites_early_ug0_lod2.mesh 2500
    55 unit_models/_Units/
    new_folder/Hoplites_early_ug0_lod3.mesh 6400
    2
    6 france
    60 unit_models/_Units/
    new_folder/textures/ionian_hoplite.texture
    67 unit_models/_Units/
    new_folder/textures/ionian_hoplite_normal.texture
    49 unit_sprites/england_Dummy_EN_Spearmen_sprite.spr
    5 slave
    60 unit_models/_Units/
    new_folder/textures/ionian_hoplite.texture
    67 unit_models/_Units/
    new_folder/textures/ionian_hoplite_normal.texture
    47 unit_sprites/slave_Dummy_EN_Spearmen_sprite.spr
    2
    6 france (you dont have to change these files, they are responsible for shields, so in this case our unit would have english shields, not france ones. but if you want to change them it works the same)
    58 unit_models/AttachmentSets/Final Kite_england_diff.texture
    58 unit_models/AttachmentSets/Final Kite_england_norm.texture 0
    5 slave
    56 unit_models/AttachmentSets/Final Kite_slave_diff.texture
    56 unit_models/AttachmentSets/Final Kite_slave_norm.texture 0
    1
    4 None
    10 MTW2_Spear 0
    2
    18 MTW2_Spear_primary
    14 fs_test_shield 0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    dont forget to add 1 new unit at the top of the page
    so if there it says 700 you change it to 701

    22 serialization::archive 3 0 0 0 0 701 0 0
    save the file and exit


    open the export_descr_units file in the data folder

    just change the orange entries to the unit name (what you wrote at the top of the battle_models entry is the unit name)
    dont forget to change the faction ownership from england to france(blue)

    type ionian hoplite (here you dont have an "_", dont know why, but its done in all the other enries)
    dictionary
    ionian_hoplite
    category infantry
    class spearmen
    voice_type Light
    banner faction main_spear
    banner holy crusade
    soldier
    ionian_hoplite , 60, 0, 1.5
    attributes sea_faring, hide_forest, can_withdraw
    formation 1.2, 1.2, 2.4, 2.4, 4, square, schiltrom
    stat_health 1, 0
    stat_pri 7, 3, no, 0, 0, melee, melee_blade, piercing, spear, 25, 0.6
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr spear, spear_bonus_8
    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, 8, flesh
    ;stat_armour_ex 0, 2, 3, 0, 3, 8, 8, flesh
    stat_sec_armour 0, 0, flesh
    stat_heat 0
    stat_ground 1, 0, 2, -2
    stat_mental 3, normal, trained
    stat_charge_dist 20
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 290, 155, 55, 135, 290, 4, 80
    armour_ug_levels 0
    armour_ug_models
    ionian_hoplite
    ownership
    france, slave
    era 0
    france
    era 1
    france
    era 2
    france
    ;unit_info 7, 0, 11
    recruit_priority_offset 0
    here is a tutorial which explains what all these numbers mean
    http://www.twcenter.net/forums/showthread.php?t=221093

    save and exit
    now your unit is ingame!!!!

    start the game, make a costom battle with france. the new unit is the one with no unit card and called "unlocalized placement text"
    that brings us to the next problem, even though the unit is ingame and you can play with it, it looks very unfinished.

    if you want to remove the "unlocalized placement text" thing and change it to your unit name, use this tutorial
    http://www.twcenter.net/forums/showthread.php?t=230009

    if you want to give the unit a unit and info card open this tutorial and scroll down
    http://www.twcenter.net/forums/showthread.php?t=221097

    Thats it, you have a totally new unit in game and it doesnt look unfinished


    formatted modeldbs:
    http://www.twcenter.net/forums/showthread.php?t=84043
    http://www.twcenter.net/forums/showthread.php?t=196382
    Last edited by Stephan; July 30, 2009 at 10:44 AM.

    Yes, I know that Ishtar is spelled wrong

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

    Default Re: How to add a new unit into game

    lol

    nice Tutorial
    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
    Stephan's Avatar Campidoctor
    Join Date
    Jun 2008
    Location
    Wien
    Posts
    1,575

    Default Re: How to add a new unit into game

    comments please

    Yes, I know that Ishtar is spelled wrong

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    Nice and compact.
    If it is for newbies then you should be merciful and give them a link to a formatted modeldb file.










  5. #5
    Stephan's Avatar Campidoctor
    Join Date
    Jun 2008
    Location
    Wien
    Posts
    1,575

    Default Re: How to add a new unit into game

    updated

    Yes, I know that Ishtar is spelled wrong

  6. #6
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: How to add a new unit into game

    There is a model.db syntax checker around (cannot find the download, but it is in the download section here on TWC). This can be very helpful: Modify models.db by changing the entries, but do not touch the numbers at the beginning of each line. When you have made your changes for that unit let the syntax checker run, it will tell you which character numbers to place where. As a side effect, if anything is wrong you can exclude the numbers to be the culprit, what saves you endless hours of counting letters.


    Another thing: Making new mounted units that way is pretty easy. In EDU change the entry

    Code:
    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, 0.3
    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, 0, 0.35
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    ap
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 0, 0.35
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  0, 16, 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      9, normal, untrained
    stat_charge_dist 40
    stat_fire_delay  -2500
    stat_food        60, 300
    stat_cost        1, 480, 15, 85, 65, 480, 4, 120	;KRP 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        sweden, denmark, slave
    era 0            sweden, denmark
    ;unit_info        9, 0, 9
    to:

    Code:
    type             Viking Raiders
    dictionary       Viking_Raiders      ; Viking Raiders
    category         cavalry
    class            light
    voice_type       Light
    banner faction   main_infantry
    banner holy      crusade
    soldier          Viking_Raiders, 60, 0, 0.3
    mount            heavy horse
    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, 0, 0.35
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    ap
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 0, 0.35
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  0, 16, 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      9, normal, untrained
    stat_charge_dist 40
    stat_fire_delay  -2500
    stat_food        60, 300
    stat_cost        1, 480, 15, 85, 65, 480, 4, 120	;KRP 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        sweden, denmark, slave
    era 0            sweden, denmark
    ;unit_info        9, 0, 9

    in models.db change
    Code:
    14 viking_raiders 
    1 4 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod0.mesh 121 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod1.mesh 900 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod2.mesh 2500 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod3.mesh 6400 
    2 
    7 denmark 
    79 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_denmark.texture 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 
    46 unit_sprites/denmark_Viking_Raiders_sprite.spr 
    5 slave 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_rebels.texture 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 
    44 unit_sprites/slave_Viking_Raiders_sprite.spr 
    2 
    7 denmark 
    60 unit_models/AttachmentSets/Final Danish_denmark_diff.texture 
    60 unit_models/AttachmentSets/Final Danish_denmark_norm.texture 0  
    5 slave 
    58 unit_models/AttachmentSets/Final Danish_slave_diff.texture 
    58 unit_models/AttachmentSets/Final Danish_slave_norm.texture 0  
    1 
    4 None 
    9 MTW2_Mace 0  
    2 
    17 MTW2_Mace_Primary 
    14 fs_test_shield 0 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    to
    Code:
    14 viking_raiders 
    1 4 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod0.mesh 121 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod1.mesh 900 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod2.mesh 2500 
    61 unit_models/_Units/EN_Peasant_Padded/viking_raiders_lod3.mesh 6400 
    2 
    7 denmark 
    79 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_denmark.texture 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 
    46 unit_sprites/denmark_Viking_Raiders_sprite.spr 
    5 slave 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_rebels.texture 
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture 
    44 unit_sprites/slave_Viking_Raiders_sprite.spr 
    2 
    7 denmark 
    60 unit_models/AttachmentSets/Final Danish_denmark_diff.texture 
    60 unit_models/AttachmentSets/Final Danish_denmark_norm.texture 0  
    5 slave 
    58 unit_models/AttachmentSets/Final Danish_slave_diff.texture 
    58 unit_models/AttachmentSets/Final Danish_slave_norm.texture 0  
    1 
    5 Horse 
    12 MTW2_HR_Mace 0  
    2 
    17 MTW2_Mace_Primary 
    14 fs_test_shield 0 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    done. Now you have the made the Viking raiders mounted. Repeat the process for the upgrade models too.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game











  8. #8
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: How to add a new unit into game

    Ah yes, it is part of the formated model.db download. Thank you!

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    One is glad to be of service










  10. #10

    Default Re: How to add a new unit into game

    I have done everything as shown but towards the BC mod. I am getting an
    unspecified error right before the strating screen can open,. any reasons for this?



  11. #11
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    Go back and check your entries. My bet: error in the modeldb file.

    Still chekc your log if there is an entry that might point you in the right direction. An error in the EDU shows up sometimes.










  12. #12

    Default Re: How to add a new unit into game

    Quick question, where do you place your new entry in the modeldb file. Top/Bottom?



  13. #13
    Adnan's Avatar Miles
    Join Date
    Jan 2008
    Location
    Slovenia
    Posts
    304

    Default Re: How to add a new unit into game

    Quote Originally Posted by NrGBaller View Post
    Quick question, where do you place your new entry in the modeldb file. Top/Bottom?
    Wherever you want.

  14. #14

    Default Re: How to add a new unit into game

    I have been able to format the M2TW 1.3 and Kingdoms 1.5 modeldb files.
    However to add a new unit in is it so simple?
    Just 2 files and a few other things to have cards ect? It seems really similar to RTW.

  15. #15
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    And the new mesh and new textures files. Got any spare ones?










  16. #16

    Default Re: How to add a new unit into game

    A couple of questions how do i use the model.db syntax checker.

    And if i extract the formatted version of battle_models.modeldb into the data/unit_models directory do i replace the vinilla version of the file that is already there.

  17. #17
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    If you extract the formatted modeldb file into that directory, you will:
    a) overwrite the vanilla file if the names are the same or
    b) have to delete\rename the vanilla file and give the formatted the name of the vanilla version.










  18. #18

    Default Re: How to add a new unit into game

    Thanks another question though. I was going to try importing a unit from a mod (dead one) but when i checked there is only one lod0.mesh file not 4 as in the example shown.

    Should the unit have more mesh files?
    Last edited by Alex-ander; September 13, 2009 at 10:37 AM.

  19. #19
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,681
    Blog Entries
    35

    Default Re: How to add a new unit into game

    A lot of modders don't go through the hassles of developing 4 meshes. It will put a strain on older machines with a low end graphic card if you have only one mesh for all the distances. This is how you would add this mesh (not sure whether it is actually necessary to enter all instances):

    19 aznauri_cavalry_ug1
    1 4
    60 unit_models/_Units/georgia/aznauri/aznauri_cavalry_lod0.mesh 121
    60 unit_models/_Units/georgia/aznauri/aznauri_cavalry_lod0.mesh 900
    60 unit_models/_Units/georgia/aznauri/aznauri_cavalry_lod0.mesh 2500
    60 unit_models/_Units/georgia/aznauri/aznauri_cavalry_lod0.mesh 6400










  20. #20

    Default Re: How to add a new unit into game

    Hi,

    There is something that I don't understand,
    you mention this: copy the .mesh files (in this case "Hoplites_early_ug0_lod0-3.mesh") into the "new_folder" folder and copy your new texture and the norm_texture (in this case "ionian_hoplite.texture") into the "textures" folder.

    in this part, I want to add three MTW2 units into the THIRD AGE TOTAL WAR mod (I hope you know about this beauty ) but I don't know where I could get the meshes and textures for Rocket Launchers, Mangonels and Naffatun, I want to add those units into that mod.

    Please help

    Thanks

Page 1 of 34 123456789101126 ... 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
  •