Results 1 to 8 of 8

Thread: Switching in units

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Civis
    Join Date
    May 2007
    Location
    Bismarck, ND
    Posts
    109

    Default Switching in units

    I am currently trying to switch in a couple units from the Baltic Crusades mod into my Stainless Steel 6.1 with Battle For The Baltic 2.0. I realize the units are at the max registration in the .edu so I have been trying to switch in the Lithuanian Foot Knights into the Afghan Javelins seeing as I do not use mercs that often.

    Here is my battle_models.modeldb for what I have edited. Everything I changed is in red.

    17 afghan_javelinmen
    1 4
    82 unit_models/_Units/Lithuania/lith_late_footknights_lod0.mesh 9400
    1
    9 lithuania
    93 unit_models/_Units/Lithuania/textures/lith_latefootknightsarmor.texture
    100 unit_models/_Units/Lithuania/textures/lith_latefootknightsarmor_normal.texture
    96 unit_sprites/lith_late_footknights_sprite.spr
    1
    9 lithuania
    104 unit_models/_Units/Lithuania/attachments/lith_latefootknightsstuff_diff.texture
    104 unit_models/_Units/Lithuania/attachments/lith_latefootknightsstuff_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

    and here is the original entry

    17 afghan_javelinmen
    1 4
    62 unit_models/_Units/ME_Light_Padded/afghan_javelinmen_lod0.mesh 121
    62 unit_models/_Units/ME_Light_Padded/afghan_javelinmen_lod1.mesh 900
    62 unit_models/_Units/ME_Light_Padded/afghan_javelinmen_lod2.mesh 2500
    62 unit_models/_Units/ME_Light_Padded/afghan_javelinmen_lod3.mesh 6400
    3
    8 timurids
    76 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_timurids.texture
    74 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_normal.texture
    50 unit_sprites/timurids_Afghan_Javelinmen_sprite.spr
    7 kwarezm
    75 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_kwarezm.texture
    75 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_normal2.texture
    46 unit_sprites/merc_Afghan_Javelinmen_sprite.spr
    4 merc
    75 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_kwarezm.texture
    75 unit_models/_Units/ME_Light_Padded/textures/ME_Light_Padded_normal2.texture
    46 unit_sprites/merc_Afghan_Javelinmen_sprite.spr
    3
    8 timurids
    63 unit_models/AttachmentSets/Final ME Heavy_timurids_diff.texture
    63 unit_models/AttachmentSets/Final ME Heavy_timurids_norm.texture 0
    7 kwarezm
    62 unit_models/AttachmentSets/Final ME Heavy_kwarezm_diff.texture
    62 unit_models/AttachmentSets/Final ME Heavy_kwarezm_norm.texture 0
    4 merc
    59 unit_models/AttachmentSets/Final ME Heavy_merc_diff.texture
    59 unit_models/AttachmentSets/Final ME Heavy_merc_norm.texture 0
    1
    4 None
    17 MTW2_Fast_Javelin
    19 MTW2_Fast_Swordsman 2
    20 MTW2_Javelin_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

    Now I have temporarily kept the afghan javelin name in the export_descr_unit for the ease. I deleted all traces of the units being owned by it's old factions in the campaign_script, merc and slave texts, export_descr_buildings, and the descr_strat in the campaigns. I have not given ownership to Lithuania in any texts except for the export_descr_unit, battle_models.modeldb, and the ui files.

    I'm still getting a crash before the game can load and am a bit stuck, any help would be much appreciated.

  2. #2
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Switching in units

    17 afghan_javelinmen
    1 4
    82 unit_models/_Units/Lithuania/lith_late_footknights_lod0.mesh 9400
    1
    9 lithuania

    That 4 needs to be 1. That number tells the game how many model lines are to follow.

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  3. #3
    Civis
    Join Date
    May 2007
    Location
    Bismarck, ND
    Posts
    109

    Default Re: Switching in units

    I changed it to one but it still is not starting, still just loading into a black screen. Would it be easier for me to delete the entire unit first beforehand instead of changing it?

    Is there any way of checking the system log for the error?
    Last edited by Agent2P; February 09, 2011 at 01:36 AM.

  4. #4

    Default Re: Switching in units

    Read this old post of mine, if it still doesn't works then tell me exactly what you want and i will do one unit for you so that you can see how it's done.

    Quote Originally Posted by Ishan View Post
    Although Dwaine nailed the possible best answer to you. I'll try again to explain.
    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 now co-relate my post with dwaine's post and it should be crystal clear that is every part about it.
    And if you still don't get it then let me go to Sahara desert first and do this
    Also use this modeldb checker to eliminate count errors.

  5. #5
    Caesar Clivus's Avatar SS Forum Moderator
    Join Date
    May 2007
    Location
    Australia
    Posts
    12,693

    Default Re: Switching in units

    If the problem is with the modeldb file, then the system.log wont show it. But if the problem is with another file, it should show in the log

    BftB2 UPDATED 22nd DECEMBER. Member of the Complete Byzantine Unit Roster team

  6. #6
    Civis
    Join Date
    May 2007
    Location
    Bismarck, ND
    Posts
    109

    Default Re: Switching in units

    Wow, can't believe I oversighted counting characters, everything is working fine now. Thank you Caesar and Ishan for all the help.

  7. #7

    Default Re: Switching in units

    Quote Originally Posted by Agent2P View Post
    Wow, can't believe I oversighted counting characters, everything is working fine now. Thank you Caesar and Ishan for all the help.
    Glad to help mate.

  8. #8
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: Switching in units

    yeah, if it's the BMDB issue when you load it'll crash on start with a message of "encounted unexpected error" something like that, if it doesn't say anything and simply doesn't launch then check the system.log file in the main SS folder and search for "error" it'll usually tell you whats wrong and where.
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

Posting Permissions

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