Page 1 of 4 1234 LastLast
Results 1 to 20 of 82

Thread: How-to: make battle_models.MODELDB more readable

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default How-to: make battle_models.MODELDB more readable

    Hi,

    This is study about unit models code and advice how to manage your code for modding. I will explain how the unit models and unit animations are built in that skript file and how you can edit unit textures thare. I include some rules how this must be edited to get your animation and new skins to work for your (new)units.

    If you open battle_models.MODELDB with notepad you will have really mess on screen:

    Example:
    22 serialization::archive 3 0 0 0 0 701 0 0 10 mount_pony 1.12 0 0 3 0 0 52 unit_models/Mounts/Medium_Horse/mount_pony_lod0.mesh 121 52 unit_models/Mounts/Medium_Horse/mount_pony_lod1.mesh 1225 52 unit_models/Mounts/Medium_Horse/mount_pony_lod2.mesh 10000 0 0 24 0 0 7 england 69 unit_models/Mounts/Medium_Horse/textures/medium_horse_england.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 42 unit_sprites/england_Mount_Pony_sprite.spr 8 scotland 70 unit_models/Mounts/Medium_Horse/textures/medium_horse_scotland.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 43 unit_sprites/scotland_Mount_Pony_sprite.spr 6 france 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_france.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 41 unit_sprites/france_Mount_Pony_sprite.spr 3 hre 65 unit_models/Mounts/Medium_Horse/textures/medium_horse_hre.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 38 unit_sprites/hre_Mount_Pony_sprite.spr 7 denmark 69 unit_models/Mounts/Medium_Horse/textures/medium_horse_denmark.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 42 unit_sprites/denmark_Mount_Pony_sprite.spr 5 spain 67 unit_models/Mounts/Medium_Horse/textures/medium_horse_spain.texture 68 unit_models/Mounts/Medium_Horse/textures/medium_horse_normal.texture 40 unit_sprites/spain_Mount_Pony_sprite.spr 8 portugal 70 unit_models/Mounts/Medium_Horse/textures/medium_horse_portugal.texture

    Readable? I think not. Well i study the code and results are next:
    Read more about adding units to another factions

    Thread is http://www.twcenter.net/forums/showt...t=74945&page=2

    I will ldescribe how the unit skin skript is build up in the battle_models.MODELDB as i understand it.

    Description of most widely used unit Mercenary Crossbowmen

    RULES:
    1. String lenght number AND String must be on same line, Enter key not allowed, you will have CTD if launching Medieval2.exe.

    2. To test it out, if thare are mistakes just launch medieval. If something is wrong you will have CTD. Most problem is that the number and string lenght do not mach.

    3. If you have MS Word edit it thare and keep track changes nad make spaces and othet forms visible but you have to copy it back to notepad to save the info. You can't save it in word.

    So i tested it out with next code in my battle_models.MODELDB
    This is original copy-paste from my file.

    You can read it and medieval 2 also. Have nice modding.

    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    21 mercenary_crossbowmen
    1 4
    68 unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod0.mesh 121
    68 unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod1.mesh 900
    68 unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod2.mesh 2500
    68 unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod3.mesh 6400
    1
    4 merc
    77 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_mercs.texture
    78 unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture
    50 unit_sprites/merc_Mercenary_Crossbowmen_sprite.spr
    1
    4 merc
    66 unit_models/AttachmentSets/Final European CB Gun_merc_diff.texture
    66 unit_models/AttachmentSets/Final European CB Gun_merc_norm.texture 0 <- ends with double space
    1
    4 None
    18 MTW2_Fast_Crossbow
    20 MTW2_Non_Shield_Fast
    1
    21 MTW2_Crossbow_Primary
    1
    18 MTW2_Sword_Primary

    Description about file above.

    Animation section:
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002 (<- positsion or something, pony has all 0-s entry )
    21 (string lenght of ->) mercenary_crossbowmen (< it ends with space and it is the model name. It must be same as "soldiers" in EDU, to use this animation for that unit, same rule for armor upgrades)
    1 (<- don't know what that number means, do not change it.. :hmmm: )
    4 (number of *.mesh strings or files to come. These are hardcoded unit animation files. You can't change weapons.)
    68 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod0.mesh 121 (<- distance when it is used)
    68 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod1.mesh 900 (<- distance when it is used)
    68 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod2.mesh 2500 (<- distance when it is used)
    68 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/mercenary_crossbowmen_lod3.mesh 6400 (<- distance when it is used)

    Texture section
    1 (number of factions can use the texture)
    4 (string lenght of ->) merc (<- faction whos case the unit texture is used. Merc means Mercenary_unit, so all factions can use this!)
    77 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_mercs.texture (<- unit skin texture file to be used, variety of diferent textures for same unit)
    78 (string lenght of ->) unit_models/_Units/EN_Peasant_Padded/textures/EN_Peasant_Padded_normal.texture (<- texture file to be used for shading, lighting and other effects, seems more alpha texture)
    50 (string lenght of ->) unit_sprites/merc_Mercenary_Crossbowmen_sprite.spr (<- sprite file to be used fo long range view to make game run faster)
    1 (number of factions can use the weapon texture)
    4 (string lenght of ->) merc (<- the faction whos case next animations will be used in battle: It has diferent shield pictures and weapons)
    66 (string lenght of ->) unit_models/AttachmentSets/Final European CB Gun_merc_diff.texture (<- texture file to be used for different weapons)
    66 (string lenght of ->) unit_models/AttachmentSets/Final European CB Gun_merc_norm.texture 0 (<- texture file to be used for different weapons shading and lighting effects, includes alpha and brightness)

    Weapons section
    1 (<-number of strings lines to come about mount)
    4 (string lenght of ->) None (<- mount type, if none then the unit is on foot)
    Next two files are animations, unit has crossbow and no shield
    18 (string lenght of ->) MTW2_Fast_Crossbow
    20 (string lenght of ->) MTW2_Non_Shield_Fast

    1 (<-number of strings lines to come, norse archer has two entrys and number two)
    21 (string lenght of ->) MTW2_Crossbow_Primary (<- the animation if crossbow is primary weapon)

    1 (<-number of strings lines to come, norse archer has two entrys and number two)
    18 (string lenght of ->) MTW2_Sword_Primary (<- the animation if sword is primary weapon)

    Unfortunately you can't turn one animation off to use secondary animation instead. I have not find out how to do this. Lanced units use lance instead of sword seems very funni to me.

    Now it is more readable! You can use "Enter" to separate lines, it will not disturb your code! But keep in mind that the number and stringline must be on same line!! The reason is because the game can't parse the code if it don't know the lenght to read. Keep in mind that all spaces must stay as thare are. Every line in that example ends vit one space And some 0 has double space.

    Usually it is weapon effect skin what ends with zero and double space.
    Example is "66 unit_models/AttachmentSets/Final European CB Gun_merc_norm.texture 0 <- this 0 ends with double space.

    Anothed units (Norse Archer, it has shield) full code:

    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    13 norse_archers
    1
    4
    60 unit_models/_Units/EN_Peasant_Padded/norse_archers_lod0.mesh 121
    60 unit_models/_Units/EN_Peasant_Padded/norse_archers_lod1.mesh 900
    60 unit_models/_Units/EN_Peasant_Padded/norse_archers_lod2.mesh 2500
    60 unit_models/_Units/EN_Peasant_Padded/norse_archers_lod3.mesh 6400
    1
    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
    52 unit_sprites/denmark_Dummy_EN_Archers_ug1_sprite.spr
    1
    7 denmark
    60 unit_models/AttachmentSets/Final Danish_denmark_diff.texture
    60 unit_models/AttachmentSets/Final Danish_denmark_norm.texture 0
    1
    4 None
    11 MTW2_Bowman
    14 MTW2_Swordsman
    2
    19 MTW2_Bowman_Primary
    14 fs_test_shield
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield
    Last edited by kleemann; January 29, 2007 at 01:40 AM.
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  2. #2
    M3rcury15's Avatar Libertus
    Join Date
    Dec 2006
    Location
    Estonia
    Posts
    97

    Default Re: How-to: make battle_models.MODELDB more readable

    Thank you for making this readable battle_models.modeldb fellow countryman

  3. #3
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default Re: How-to: make battle_models.MODELDB more readable

    14 mount_elephant
    1 4
    52 unit_models/Mounts/Elephant/mount_elephant_lod0.mesh 121
    52 unit_models/Mounts/Elephant/mount_elephant_lod1.mesh 625
    52 unit_models/Mounts/Elephant/mount_elephant_lod2.mesh 3600
    52 unit_models/Mounts/Elephant/mount_elephant_lod3.mesh 10000
    2
    8 timurids
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    4 merc
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    0 (<- interresting, crossbowmen don't have this, i quess it is number of men?)
    1 (<-this has to be mount number)
    8 elephant
    19 fs_african_elephant
    0 (<-Null with double space)
    0 0 -1 0 0 0 0 0 0

    21 mount_elephant_cannon
    1 4
    59 unit_models/Mounts/Elephant/mount_elephant_cannon_lod0.mesh 121
    59 unit_models/Mounts/Elephant/mount_elephant_cannon_lod1.mesh 625
    59 unit_models/Mounts/Elephant/mount_elephant_cannon_lod2.mesh 3600
    59 unit_models/Mounts/Elephant/mount_elephant_cannon_lod3.mesh 10000
    2
    8 timurids
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    4 merc
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    0
    1
    8 elephant
    19 fs_african_elephant (<- animation)
    0
    0 0 -1 0 0 0 0 0 0
    Last edited by kleemann; January 09, 2007 at 05:57 AM.
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  4. #4

    Icon4 Re: How-to: make battle_models.MODELDB more readable

    This example is mostly correct, but starts to go astray:
    Quote Originally Posted by kleemann View Post
    14 mount_elephant
    1 4
    52 unit_models/Mounts/Elephant/mount_elephant_lod0.mesh 121
    52 unit_models/Mounts/Elephant/mount_elephant_lod1.mesh 625
    52 unit_models/Mounts/Elephant/mount_elephant_lod2.mesh 3600
    52 unit_models/Mounts/Elephant/mount_elephant_lod3.mesh 10000
    2
    8 timurids
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    4 merc
    53 unit_models/Mounts/Elephant/textures/Elephant.texture
    60 unit_models/Mounts/Elephant/textures/Elephant_normal.texture 0
    0 (<- interresting, crossbowmen don't have this, i quess it is number of men?)
    1 (<-this has to be mount number)
    8 elephant
    19 fs_african_elephant
    0 (<-Null with double space)
    0 0 -1 0 0 0 0 0 0
    The 1 (<-this has to be mount number) isn't right: it's just the number of records to follow. In this case, it is the number of animation records, which really ought to be formatted like this:
    Code:
    1 
    8 elephant 19 fs_african_elephant 0 
    0 
    0 
    -1 0 0 0 0 0 0
    Meaning: Mount animation elephant, Primary weapon animation fs_african_elephant, no Secondary animation.

    The next 2 lines, which normally contain lists of animations to run for the Primary and Secondary weapons (respectively), are NULL. Apparently, mounts are a special case, and they're always unused.

    The final line usually contains floating-point numbers that might be related to animation timings. In this case, since the line starts with -1, the values are all zero. Apparently, no animation timings for mounts.

    You can read more details at: http://forums.totalwar.org/vb/showthread.php?t=79455

  5. #5
    Lusted's Avatar Look to the stars
    Join Date
    Jan 2005
    Location
    Brighton, Sussex, England.
    Posts
    18,184

    Default Re: How-to: make battle_models.MODELDB more readable

    Im doing this atm as well, once the files is organized a bit it actually becomes very readable and easy to edit.
    Creator of:
    Lands to Conquer Gold for Medieval II: Kingdoms
    Terrae Expugnandae Gold Open Beta for RTW 1.5
    Proud ex-Moderator and ex-Administrator of TWC from Jan 06 to June 07
    Awarded the Rank of Opifex for outstanding contributions to the TW mod community.
    Awarded the Rank of Divus for oustanding work during my times as Administrator.

  6. #6

    Default Re: How-to: make battle_models.MODELDB more readable

    Could you release it to the community to work from?

    While it might be better for us to learn on our own and get used to the text file ourselves, the problem is that having to tackle this monumental obstacle will be what discourages a lot of modders from learning about it in the first place, and a community release of a cleaned up version that you guys use would be very valuable.

  7. #7

    Default Re: How-to: make battle_models.MODELDB more readable

    i have decided to organize my hole battle_models.modeldb, following this kleemann, thank you very much! have a cookie :hmmm: well i couldnt find a coockie so have popcorn
    "When you do something right; it will seem as though you haven't done anything at all." -Space God
    http://www.mtgfanatic.com/?ForumReferrerID=127300

  8. #8

    Default Re: How-to: make battle_models.MODELDB more readable

    Kleeman, can you elaborate on this?

    You say "Now it is more readable! "Enter" or key stroke will not disturb your code! Have nice modding! Keep in mind that all spaces must stay as thare are.", but you first said "RULES:
    1. String lenght number AND String must be on same line, no keystroke (Enter key) allowed, you will have CTD if launching Medieval2.exe."


    Do we use spaces instead of enter, or what?

    The code I was trying to include that CTD'd me was this:

    25 Dismounted_Turkic_Knights
    1 4
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod0.mesh 121
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod1.mesh 900
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod2.mesh 2500
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod3.mesh 6400
    1 5 turks
    91 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_turks.texture
    92 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_normal.texture
    55 unit_sprites/turks_Dismounted_turkic_knights_sprite.spr
    1 5 turks
    60 unit_models/AttachmentSets/Final ME Heavy_turks_diff.texture
    60 unit_models/AttachmentSets/Final ME Heavy_turks_norm.texture 0
    1 4 None
    12 MTW2_HR_Mace
    2 17 MTW2_Mace_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    I was working in MS word like you suggested, but couldn't save it there (I think), so I copied it over to the battle_model file, opened in notepad, word-wrapped to make things clearer.


    I was editing quapukulu into a dismounted brand new unit, and it keeps ctding. I also see different formats for the coding amongst different people.


    Edit: evidently, soemthing else is causing the CTD. I reverted to the original battle.model file and it's crashing.
    Last edited by Ahiga; January 14, 2007 at 01:42 PM.

  9. #9

    Icon6 Re: How-to: make battle_models.MODELDB more readable

    Quote Originally Posted by Ahiga View Post
    Kleeman, can you elaborate on this?

    You say "Now it is more readable! "Enter" or key stroke will not disturb your code! Have nice modding! Keep in mind that all spaces must stay as thare are.", but you first said "RULES:
    1. String lenght number AND String must be on same line, no keystroke (Enter key) allowed, you will have CTD if launching Medieval2.exe."


    Do we use spaces instead of enter, or what?

    The code I was trying to include that CTD'd me was this:

    25 Dismounted_Turkic_Knights
    1 4
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod0.mesh 121
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod1.mesh 900
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod2.mesh 2500
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod3.mesh 6400
    1 5 turks
    91 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_turks.texture
    92 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_normal.texture
    55 unit_sprites/turks_Dismounted_turkic_knights_sprite.spr
    1 5 turks
    60 unit_models/AttachmentSets/Final ME Heavy_turks_diff.texture
    60 unit_models/AttachmentSets/Final ME Heavy_turks_norm.texture 0 (<- that lil bugger has to be on the line below with 1 4 none)
    1 4 None
    12 MTW2_HR_Mace
    2 17 MTW2_Mace_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    I was working in MS word like you suggested, but couldn't save it there (I think), so I copied it over to the battle_model file, opened in notepad, word-wrapped to make things clearer.


    I was editing quapukulu into a dismounted brand new unit, and it keeps ctding. I also see different formats for the coding amongst different people.


    Edit: evidently, soemthing else is causing the CTD. I reverted to the original battle.model file and it's crashing.
    hope that helps
    "When you do something right; it will seem as though you haven't done anything at all." -Space God
    http://www.mtgfanatic.com/?ForumReferrerID=127300

  10. #10
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default Re: How-to: make battle_models.MODELDB more readable

    Quote Originally Posted by Ahiga View Post
    Kleeman, can you elaborate on this?

    You say "Now it is more readable! "Enter" or key stroke will not disturb your code! Have nice modding! Keep in mind that all spaces must stay as thare are.", but you first said "RULES:
    1. String lenght number AND String must be on same line, no keystroke (Enter key) allowed, you will have CTD if launching Medieval2.exe."


    Do we use spaces instead of enter, or what?

    The code I was trying to include that CTD'd me was this:

    25 Dismounted_Turkic_Knights
    1 4
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod0.mesh 121
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod1.mesh 900
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod2.mesh 2500
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod3.mesh 6400
    1 5 turks
    91 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_turks.texture
    92 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_normal.texture
    55 unit_sprites/turks_Dismounted_turkic_knights_sprite.spr
    1 5 turks
    60 unit_models/AttachmentSets/Final ME Heavy_turks_diff.texture
    60 unit_models/AttachmentSets/Final ME Heavy_turks_norm.texture 0
    1 4 None
    12 MTW2_HR_Mace
    2 17 MTW2_Mace_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    I was working in MS word like you suggested, but couldn't save it there (I think), so I copied it over to the battle_model file, opened in notepad, word-wrapped to make things clearer.


    I was editing quapukulu into a dismounted brand new unit, and it keeps ctding. I also see different formats for the coding amongst different people.


    Edit: evidently, soemthing else is causing the CTD. I reverted to the original battle.model file and it's crashing.

    If you look yor sprite file, thare is certainli mistake!

    turks_Dismounted_turkic_knights_sprite.spr
    should be:
    Dismounted_turkic_knights_sprite.spr
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  11. #11

    Default Re: How-to: make battle_models.MODELDB more readable

    It did, although the problem is persisting, just so that I can cover all the bases, this is the code I have:

    type Dismounted Turkic Knights
    dictionary Dismounted_Turkic_Knights ; Dismounted Turkic Knights
    category cavalry
    class heavy
    voice_type Heavy
    banner faction main_cavalry
    banner holy crusade_cavalry
    soldier Dismounted_Feudal_Knights, 32, 0, 0.5
    attributes sea_faring, hide_forest, very_hardy, can_withdraw
    formation 2, 4.4, 3, 6, 2, square
    stat_health 1, 0
    stat_pri 13, 6, no, 0, 0, melee, melee_blade, piercing, spear, 0, 0.7
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr no
    stat_sec 13, 4, no, 0, 0, melee, melee_blade, blunt, mace, 0, 0.7
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr ap
    stat_pri_armour 10, 9, 4, metal
    ;stat_armour_ex 8, 9, 0, 0, 6, 4, 4, metal
    stat_sec_armour 0, 0, flesh
    stat_heat 3
    stat_ground 0, 1, -6, -1
    stat_mental 11, disciplined, highly_trained
    stat_charge_dist 45
    stat_fire_delay -20000
    stat_food 60, 300
    stat_cost 1, 1300, 300, 130, 100, 1300, 4, 270
    armour_ug_levels 4
    armour_ug_models Dismounted_Turkic_Knights
    ownership turks
    era 2 turks
    ;unit_info 13, 0, 18

    Then the battle_model code:

    25 Dismounted_Turkic_Knights
    1 4
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod0.mesh 121
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod1.mesh 900
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod2.mesh 2500
    79 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/dismounted_turkic_knights_lod3.mesh 6400
    1 5 turks
    91 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_turks.texture
    92 unit_models/_Units/ME_Mail_Plate_Hvy_Mplate/textures/ME_Mail_Plate_Hvy_Mplate_normal.texture
    39 unit_sprites/turks_quapukulu_sprite.spr
    1 5 turks
    60 unit_models/AttachmentSets/Final ME Heavy_turks_diff.texture
    60 unit_models/AttachmentSets/Final ME Heavy_turks_norm.texture
    0 1 4 None [There is two spaces on this zero in my code]
    13 MTW2_HR_Lance
    12 MTW2_HR_Mace
    2 21 MTW2_HR_Lance_Primary
    14 fs_test_shield
    2 17 MTW2_Mace_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    [I threw back in the lance and mace thing to see if that was the problem]

    When I made it so it ran together continuously like the other code, it didn't do a thing.

    What is bothering me is that I see in the first post that the format is the same as mine when posted on the website. Yet when it says 'enter will mess up your code' at the start, kleeman then says it won't later on.
    Last edited by Ahiga; January 14, 2007 at 02:50 PM.

  12. #12

    Default Re: How-to: make battle_models.MODELDB more readable

    what is that? unit_sprites/turks_quapukulu_sprite.spr
    "When you do something right; it will seem as though you haven't done anything at all." -Space God
    http://www.mtgfanatic.com/?ForumReferrerID=127300

  13. #13

    Default Re: How-to: make battle_models.MODELDB more readable

    Quote Originally Posted by Zorgrath View Post
    what is that? unit_sprites/turks_quapukulu_sprite.spr
    turks_quapukulu_sprite.spr is the original, unpacked file, I believe.

  14. #14

    Default Re: How-to: make battle_models.MODELDB more readable

    I am sorry for the silly question , but where is there double space ?
    after norm.texture or there is not any rule ?

    Thanks ...

  15. #15

    Default Re: How-to: make battle_models.MODELDB more readable

    It's for the line mentioned in the first post: 50 (string lenght of ->) unit_sprites/merc_Mercenary_Crossbowmen_sprite.spr (<- sprite file to be used)

  16. #16

    Default Re: How-to: make battle_models.MODELDB more readable

    is that the right spr for it though?
    "When you do something right; it will seem as though you haven't done anything at all." -Space God
    http://www.mtgfanatic.com/?ForumReferrerID=127300

  17. #17
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default Re: How-to: make battle_models.MODELDB more readable

    Ahiga wrote: 0 1 4 None [There is two spaces on this zero in my code]
    Well if you copy paste it then thare is not. I end every texture with 0__ double space. No errors so far. Well the word is good to edit but can't save. You have to copy back to notepad.

    This is working code. If you get CTD when launching then your string lenght and string will not mach. Use enter to separate diferent lines. Number and string must be on same line.
    1. Every line ends with one space!
    2. _ <- this means two spaces

    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    19 knights_hospitaller 1 4
    63 unit_models/_Units/EN_Lmail_Hmail/knights_hospitaller_lod0.mesh 121
    63 unit_models/_Units/EN_Lmail_Hmail/knights_hospitaller_lod1.mesh 900
    63 unit_models/_Units/EN_Lmail_Hmail/knights_hospitaller_lod2.mesh 2500
    63 unit_models/_Units/EN_Lmail_Hmail/knights_hospitaller_lod3.mesh 6400
    10
    7 england
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    51 unit_sprites/england_Knights_Hospitaller_sprite.spr
    8 scotland
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    52 unit_sprites/scotland_Knights_Hospitaller_sprite.spr
    6 france
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    50 unit_sprites/france_Knights_Hospitaller_sprite.spr
    7 denmark
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    51 unit_sprites/denmark_Knights_Hospitaller_sprite.spr
    5 milan
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    49 unit_sprites/milan_Knights_Hospitaller_sprite.spr
    6 venice
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    50 unit_sprites/venice_Knights_Hospitaller_sprite.spr
    12 papal_states
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    56 unit_sprites/papal_states_Knights_Hospitaller_sprite.spr
    6 sicily
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    50 unit_sprites/sicily_Knights_Hospitaller_sprite.spr
    6 poland
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    50 unit_sprites/poland_Knights_Hospitaller_sprite.spr
    7 hungary
    77 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_hospitaller.texture
    81 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_crusader_normal.texture
    51 unit_sprites/hungary_Knights_Hospitaller_sprite.spr
    10
    7 england
    68 unit_models/AttachmentSets/Final Heater Special_england_diff.texture
    68 unit_models/AttachmentSets/Final Heater Special_england_norm.texture 0__ <- this must have double space
    8 scotland
    69 unit_models/AttachmentSets/Final Heater Special_scotland_diff.texture
    69 unit_models/AttachmentSets/Final Heater Special_scotland_norm.texture 0__ <- this must have double space
    6 france
    67 unit_models/AttachmentSets/Final Heater Special_france_diff.texture
    67 unit_models/AttachmentSets/Final Heater Special_france_norm.texture 0__ <- this must have double space
    7 denmark
    68 unit_models/AttachmentSets/Final Heater Special_denmark_diff.texture
    68 unit_models/AttachmentSets/Final Heater Special_denmark_norm.texture 0__ <- this must have double space
    5 milan
    66 unit_models/AttachmentSets/Final Heater Special_milan_diff.texture
    66 unit_models/AttachmentSets/Final Heater Special_milan_norm.texture 0__ <- this must have double space
    6 venice
    67 unit_models/AttachmentSets/Final Heater Special_venice_diff.texture
    67 unit_models/AttachmentSets/Final Heater Special_venice_norm.texture 0__ <- this must have double space
    12 papal_states
    73 unit_models/AttachmentSets/Final Heater Special_papal_states_diff.texture
    73 unit_models/AttachmentSets/Final Heater Special_papal_states_norm.texture 0__ <- this must have double space
    6 sicily
    67 unit_models/AttachmentSets/Final Heater Special_sicily_diff.texture
    67 unit_models/AttachmentSets/Final Heater Special_sicily_norm.texture 0__ <- this must have double space
    6 poland
    67 unit_models/AttachmentSets/Final Heater Special_poland_diff.texture
    67 unit_models/AttachmentSets/Final Heater Special_poland_norm.texture 0__ <- this must have double space
    7 hungary
    68 unit_models/AttachmentSets/Final Heater Special_hungary_diff.texture
    68 unit_models/AttachmentSets/Final Heater Special_hungary_norm.texture 0__ <- this must have double space
    <- no space only enter
    1 5 Horse
    13 MTW2_HR_Lance <- the HR means horse, so it is similar in RTW code. If thare is no mount then the men have half
    13 MTW2_HR_Sword body and can' move
    2
    21 MTW2_HR_Lance_Primary
    14 fs_test_shield
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield

    As you see this code has 1 double space. Try to separate the code with similar units. Actually i tried to make this units dismounted, but i could not get rid of the lance. The soldier uses the lance as sword if i use Dismounted Feudal Knights weapon code in this.

    Well the alternative solution is damn easy. To make this knight dismounted i just have to reskin Dismounted feudal knights and use its code, change the texture only. Because CA reused same animations to save money
    Last edited by kleemann; January 25, 2007 at 12:00 PM.
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  18. #18
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default Re: How-to: make battle_models.MODELDB more readable

    Well i edited my first post and removed some mistakes.
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  19. #19
    kleemann's Avatar Libertus
    Join Date
    Jan 2006
    Location
    In EU (Estonia)
    Posts
    74

    Default Re: How-to: make battle_models.MODELDB more readable

    About zero 0 with double space. It reprsents empty string. 0 number of character to come (none) and space. Why it is used i haven't find out. Usually it is before the next weapons animation section.

    CA uses empty string to turn some animations off i belive. If you look merchant_cavarly code its weapon section has next code:

    Merchant_cavalry_militia weapons code:
    1
    5 Horse
    13 MTW2_HR_Sword
    0 <-zero ends with double space (empty string or means none)
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield
    0 <-zero ends with double space (empty string or means none)

    No lance is used. But with Knight Hospitaller i couldn't turn off their lance. So i asume that it used to describe that thare is no second weapon animation. Have to testi it out.

    Knights_hospitaller weapons code:
    1
    5 Horse
    13 MTW2_HR_Lance
    13 MTW2_HR_Sword
    2
    21 MTW2_HR_Lance_Primary
    14 fs_test_shield
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield

    As you see, first one has one weapon and the other has two (horse lance and horse sword)
    Last edited by kleemann; January 26, 2007 at 08:09 AM.
    Trading tip: Load your mercants on your (crapy, cheap upkeep) unit and place that crapy unit on the valuable trade ressource. All will earn money on that single ressourec AND other merchants can't do anything! ha:ha

    BUT it has bad side efect, if the unit rebel you will lose your merchants :hmmm:

    How-to: edit battle_model.modeldb to add new animations and skins.

  20. #20

    Default Re: How-to: make battle_models.MODELDB more readable

    I found the issue I had. -0.090000004 0 0 -0.34999999 0.80000001 0.60000002 was not the end of the passage but rather the start. When I used it as an end I crashed, but when I started with it it works.

Page 1 of 4 1234 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
  •