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

Thread: unit.txt problem!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Icon4 unit.txt problem!!

    hey, i just had the idea of giving the sicilian norman knights to every european faction, so i edited the ownership in the export_descr_unit.txt file, but when i want to see them on the battlemap, their unit-skins are glowing white, but they still work perfectly for sicily. how can i fix that?
    Last edited by puelladeluxe; December 30, 2011 at 04:34 AM.

  2. #2

    Default Re: unit.txt problem!!

    You also have to add textures to them in the BMDB file aka battle_models.modeldb file found in the unit_models folder of your mod.
    You need a formatted version so download it from here if you don't have it.
    In it you would have to do it like this:
    14 norman_knights
    1 4
    51 unit_models/_Units/ES_Mail/norman_knights_lod0.mesh 121
    51 unit_models/_Units/ES_Mail/norman_knights_lod1.mesh 900
    51 unit_models/_Units/ES_Mail/norman_knights_lod2.mesh 2500
    51 unit_models/_Units/ES_Mail/norman_knights_lod3.mesh 6400
    3
    7 england
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    6 sicily
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    5 slave
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_rebels.texture
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_normal.texture
    44 unit_sprites/slave_Norman_Knights_sprite.spr
    3
    7 england
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    6 sicily
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    5 slave
    58 unit_models/AttachmentSets/Final Heater_slave_diff.texture
    58 unit_models/AttachmentSets/Final Heater_slave_norm.texture 0
    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
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    Also you MUST read this to understand what this file is all about:
    BMDB Basics explained(Click to Open).

    Quote Originally Posted by Ishan View Post
    First thing is you need to understand the modeldb file that is the key file of the game.

    Lets take an example of armored swordsmen entry in the BMDB or modeldb file:-
    Code:
    17 armored_swordsmen
    The first line is the name of the unit and is the one that is written in the armor_ug line in the EDU. This name is 17 characters big (including the “_”). This number is shown before the name. This format is repeated throughout the file: first the length of the line, then the line itself. If the written number is different from the amount of characters in a line then the game will crash at start up. Using the modeldb checker in this case helps.

    Code:
    1 3  
    62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod0.mesh 121  
    62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod1.mesh 1225  
    62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod2.mesh 6400
    The first line in the above code stats that a 1 character string is about to come. Things string (“3”) tells the game how many model lines there are to come. In this example there are 3 model lines. If we take a closer look at the first model line we see that it is 62 characters big, and that it points to a .mesh file. The number 121 represents the distance at which the model is last shown. The game takes the square-root of 121 (or whatever number there is) to calculate the distance. So here the distance in meters is 11 in game meters. Notice that the distance number is not counted with the 62 characters. When you zoom out in the game, it goes to the next model at a distance of 121 which continues to be shown till a distance of 1225, and so on. The reason for this is that the game, like many other games, uses a LoD system. LoD stands for “Level of Detail”: the lower the lod number (lod0) the more faces, or polygons, the model contain. The reason for this system is to optimise the performance. After a distance of 6400 the games does no longer show 3d models, but 2d representations called Sprites which are very light in comparison laying stress on your GPU.

    Code:
    2  
    7 england  
    74 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_england.texture  
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture  
    49 unit_sprites/england_Armored_Swordsmen_sprite.spr  
    5 slave  
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_rebels.texture  
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture  
    47 unit_sprites/slave_Armored_Swordsmen_sprite.spr
    The first number tells us that now comes two faction entries for the unit’s main textures. The two factions are England and the slaves (rebels). Each of these faction names, as always, have a number in front of them with the length of the string. The texture entries consist of 3 lines:
    • The first line is the “diffuse map”, or simple the ordinary textures.
    • Next up is the normal map.
    • Lastly is the link to the sprites.

    Code:
    2  
    7 england  
    60 unit_models/AttachmentSets/Final Heater_england_diff.texture  
    60 unit_models/AttachmentSets/Final Heater_england_norm.texture 0   
    5 slave  
    58 unit_models/AttachmentSets/Final Heater_slave_diff.texture  
    58 unit_models/AttachmentSets/Final Heater_slave_norm.texture 0
    The next entries concern the attachmentsets. These are textures used mainly for weapons and shields. The lines are built up pretty much the same way as the main texture entries, with a diffuse and a normal map.
    Code:
    1  
    4 None  
    19 MTW2_Slow_Swordsman 0   
    2  
    18 MTW2_Sword_Primary  
    14 fs_test_shield 0  
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    These are the animations used by the unit. They are probably the hardest part of the ModelDB to read. The “4 none” states that the unit doesn’t now use a mount. Next up it says that he uses the slow swordsman animationset and the “fs_test_shield” line says that he uses a shield animation for his off hand.


    Now you are interested in changing textures of this unit so see the red and blue highlighted part red part is the texture faction wise for the figure of the unit while blue about attachments that is sword, shield etc etc.
    So you have to edit those textures types to make a difference. Also you will find that this file is used by many units so if you change the texture it will affect say 5-6 units. To skip this from happening you will save the texture with a different name and then put the info in the modeldb, how?
    Say you changed
    Code:
    74 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_england.texture
    After that rename the file to something else like "mtw2_EN_Pplate_england.texture" to "mtw2_TWC_Pplate_england.texture"
    Now you can see i increased the characters by one and the file name is changed so put them back and increase the count by 1.
    Code:
    75 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_TWC_Pplate_england.texture
    So that's the max i can tell you and if you still don't get it then let me go to Sahara desert first and do this

  3. #3

    Default Re: unit.txt problem!!

    WOW thanks sooo much! it worked!

  4. #4

  5. #5

    Default Re: unit.txt problem!!

    sorry to bother you again. but now i've changed everything and i can recruit the norman knights in custom battles, but i can't recruit the on the campaign map, although i already changed the export_descr_buildings.txt, but everytime i want to start a campaignt i get a CTD

  6. #6
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: unit.txt problem!!

    Attach your log report, this could be a number of things.

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  7. #7

    Default Re: unit.txt problem!!

    Are you modifying vanilla or do you have a mod folder of your own?

  8. #8

    Default

    i am trying to chage the "Deus Lo Vult" mod

    i've attached 2 txt files, somehow i cant attach the battle_modelsbd file, but if you may look through it, that would be cool. the unnits i changed ar the "Norman_Knights" and "Dismounted_Norman_Knights"

    ok, this is what the "Norman_Knights" part in my battle_modelsbd looks like

    Spoiler Alert, click show to read: 
    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
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    14 norman_knights
    1 4
    51 unit_models/_Units/ES_Mail/norman_knights_lod0.mesh 121
    51 unit_models/_Units/ES_Mail/norman_knights_lod1.mesh 900
    51 unit_models/_Units/ES_Mail/norman_knights_lod2.mesh 2500
    51 unit_models/_Units/ES_Mail/norman_knights_lod3.mesh 6400
    10
    6 sicily
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    5 slave
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    8 flanders
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    6 norway
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    7 denmark
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    7 england
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    7 teutons
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    6 france
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    3 hre
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    3 elo
    63 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily.texture
    70 unit_models/_Units/ES_Mail/textures/mtw2_ES_Mail_sicily_normal.texture
    45 unit_sprites/sicily_Norman_Knights_sprite.spr
    10
    6 sicily
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    5 slave
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    8 flanders
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    6 norway
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    6 france
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 england
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 teutons
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 denmark
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    3 hre
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    3 elo
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    1
    5 Horse
    18 MTW2_HR_Long_Lance
    13 MTW2_HR_Sword 2
    26 MTW2_HR_Long_Lance_Primary
    14 fs_test_shield 2
    18 MTW2_Sword_Primary
    14 fs_test_shield
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    18 norman_knights_ug1
    1 3
    63 unit_models/_Units/EN_Pplate_Plate/norman_knights_ug1_lod0.mesh 121
    63 unit_models/_Units/EN_Pplate_Plate/norman_knights_ug1_lod1.mesh 1225
    63 unit_models/_Units/EN_Pplate_Plate/norman_knights_ug1_lod2.mesh 6400
    10
    6 sicily
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    5 slave
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    7 england
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    3 elo
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    7 teutons
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    7 denmark
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    8 flanders
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    6 norway
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    6 france
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    3 hre
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_sicily.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    49 unit_sprites/sicily_Norman_Knights_ug1_sprite.spr
    10
    6 sicily
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    5 slave
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    8 flanders
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    6 norway
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    6 france
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 england
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 teutons
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    7 denmark
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    3 hre
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    3 elo
    59 unit_models/AttachmentSets/Final Heater_sicily_diff.texture
    59 unit_models/AttachmentSets/Final Heater_sicily_norm.texture 0
    Last edited by Ishan; December 30, 2011 at 08:46 AM. Reason: Double Post

  9. #9

    Default Re: unit.txt problem!!

    You can put all the files in a zip folder, that's the easiest and fast way.
    And Taiji will solve it for you, he is a DLV dev member so he knows his mod inside out.

    Anyways you can cross out BMDB because if there was some error in it then your mod wouldn't even launch, remember that. Check this unit in custom battle for all the added factions, if it crashes to desktop then it means that you haven't given textures and such correctly in BMDB, another tip. Your EDU also looks ok.

    And i can't spot anything suspicious in EDB so you would have to upload your DLV crach log here so that we may get a hint on the reason for the crash.

  10. #10

    Default Re: unit.txt problem!!

    If its edb or edu related then a log report should be quite clear.


  11. #11

    Default Re: unit.txt problem!!

    where do i find the log?

    i found something that says

    [features]
    editor = true
    mod = mods/DLV_ext

    [io]
    file_first = true

    [log]
    to = logs/system.log.txt
    level = * error
    Last edited by puelladeluxe; December 30, 2011 at 09:01 AM.

  12. #12

    Default Re: unit.txt problem!!

    There should be a folder called log before your mod folder in the m2tw installation.


  13. #13

    Default Re: unit.txt problem!!

    ok, i found the log!

    this is the last line
    15:49:12.950 [system.rpt] [error] Medieval 2: Total War encountered an unspecified error and will now exit.
    the whole of the log is in the attachment

  14. #14

    Default Re: unit.txt problem!!

    Self-explanatory.
    15:48:42.376 [script.err] [error] Script Error in mods/DLV_ext/data/descr_rebel_factions.txt, at line 447, column 21
    rebel unit type 'Norman Knights' not available to faction type 'Island_Rebels' (see unit ownership)
    15:48:42.458 [script.err] [error] Script Error in mods/DLV_ext/data/export_descr_buildings.txt, at line 657, column 176
    unit(Christian Guard) does not match up to the ownership for faction(elo)

  15. #15

    Default Re: unit.txt problem!!

    From Ishan's post: the first error is because you removed Rebel ownership for norman knights in the edu.
    The second error is self-explanatory.


  16. #16

    Default Re: unit.txt problem!!

    ok, thanks again, it worked finally + rep!

  17. #17

    Default Re: unit.txt problem!!

    sigh... i encountered another problem , the game now crashes when i want to start a custom battle but oddly enough it has worked before and even 5 minutes before it still worked...

    my sytstem log.

  18. #18

    Default Re: unit.txt problem!!

    the log is the same as the log you posted earlier: nothing new in there!


  19. #19

    Default Re: unit.txt problem!!

    that's even more odd

  20. #20

    Default Re: unit.txt problem!!

    The log is still the same, so either you didn't fixed the errors or uploaded the same file again. & if you're getting a crash in loading custom battle when selecting Norman knights then for a newly added faction then check BMDB file & make sure the files indicated by it are in the right folders.

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
  •