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

Thread: battle_models.modeldb sweeper

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default battle_models.modeldb sweeper

    Superseded with UnitEditor
    Download that instead.


    Download:
    http://www.multiupload.com/MQD1P3TNPU
    Or: attachment

    What does this do?
    First, it sweeps the modeldb code and sorts it out in a nice 'human way'. It accepts any kind of .modeldb file, so it doesn't matter if you are using the formatted files or un-formatted ones.

    The programs output will mostly look like this, with numbers in red computed automatically:
    11 condottieri
    1 3
    56 unit_models/_Units/EN_Pplate_Plate/condottieri_lod0.mesh 121
    56 unit_models/_Units/EN_Pplate_Plate/condottieri_lod1.mesh 1225
    56 unit_models/_Units/EN_Pplate_Plate/condottieri_lod2.mesh 6400
    1
    4 merc
    72 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_mercs.texture
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
    40 unit_sprites/merc_Condottieri_sprite.spr
    1
    4 merc
    65 unit_models/AttachmentSets/Final Heater Special_merc_diff.texture
    65 unit_models/AttachmentSets/Final Heater Special_merc_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 (or -1 0 0 0 0 0 0 for mounts)
    The serialization number will also get updated.

    Second, the program will ask you if you want to check for files that are referenced by the modeldb but are missing from the directory structure. Trying to load the battlemap with a missing texture\attachement will lead to a CTD.

    Third, You can check for any file not referenced by the modeldb, but inside the directory structure. Such files are mostly leftovers and only make the mod folder bigger, an option to automatically remove the files will show up as a yes/no (first view the unneeded.txt tho).

    Run it from within unit_models.
    This does not overwrite any of your files, it will simply create a mdb.txt file which you can use or compare with you base modeldb file.
    Although this tool is highly resistant to "mistakes", it does not work miracles and if the structure of your modeldb file is highly damaged it will not be able to work properly.
    It's best used when merging a lot of different unit roosters, and you just have to copy the relevant text strings, without worrying about faction/string counts.
    Last edited by gracul; March 01, 2012 at 08:02 AM.

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

    Default Re: battle_models.modeldb sweeper

    Great tool, Gracul! Very useful - has already helped identify a couple of incorrect faction name entries in my work - thankyou!

    edit:

    I notice a potential area for improvement. When I run the tool the skeleton/animation lines get combined, which makes it hard to analyse:

    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

    To be able to read it easily I think it should look like this:

    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

    Hope that helps

    edit:

    In my testing it's replacing the double space after the 0 on an attachment_set line with a single space.
    Last edited by Taiji; March 05, 2011 at 09:57 AM.

  3. #3
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: battle_models.modeldb sweeper

    ca you upload somewere else?


    it's not available for me
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  4. #4
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    Additional link up and it sorts stuff in the way Taiji wanted.

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

    Default Re: battle_models.modeldb sweeper

    Excellent, and thankyou

    I don't know if you noticed this:

    Quote Originally Posted by Taiji View Post
    In my testing it's replacing the double space after the 0 on an attachment_set line with a single space.
    What I mean is that I think it's correct syntax to have 2 spaces after the 0 on the attachment_set normal texture line, and on the line for the normal texture for the main body on captains. I can't remember what issue it causes to have more or less, but I'm pretty sure it's something like a crash on load, or a misaligned texture, or something like that... Easy to sort out manually ('texture 0 ' replaced by 'texture 0 ') but I thought you'd want to add it.
    Last edited by Taiji; March 05, 2011 at 02:01 PM.

  6. #6
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    It either needs to be a space there, or a newline. Since this one is sorted for a human, a newline char will do.

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

    Default Re: battle_models.modeldb sweeper

    Oh, interesting, thanks

  8. #8

  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,682
    Blog Entries
    35

    Default Re: battle_models.modeldb sweeper

    Nice effort!

    Silly question: why don't you attach the file? Saves a lot of jumping through hoops.
    Last edited by Gigantus; March 05, 2011 at 11:52 PM.










  10. #10
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,483

    Default Re: battle_models.modeldb sweeper

    thank you, i will. this is very usefull!

  11. #11
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: battle_models.modeldb sweeper

    Why not upload it to the downloads section of TWC?
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  12. #12
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    I've added it as an attachement.

  13. #13
    Heeehehe's Avatar Tiro
    Join Date
    Dec 2010
    Location
    City of Lightning, Equator Emerald, 1st Level of Heaven
    Posts
    246

    Default

    Thank You very much this is what i search

    it crash when i used it
    Last edited by Ishan; April 16, 2011 at 12:07 PM. Reason: Double Post
    "And indeed We created man (Adam) out of an extract of clay (water and earth). Thereafter We made him (the offspring of Adam) as a Nutfah (mixed drops of the male and female sexual discharge) (and lodged it) in a safe lodging (womb of the woman). Then We made the Nutfah into a clot (a piece of thick coagulated blood), then We made the clot into a little lump of flesh, then We made out of that little lump of flesh bones, then We clothed the bones with flesh, and then We brought it forth as another creation. So blessed be Allah, the best of creators. After that, surely, you will die. Then (again), surely, you will be resurrected on the Day of Resurrection. And indeed We have created above you seven heavens (one over the other), and We are never unaware of the creation." (QS. Al-Mu'minun (23):12-17)

    "He who has not seen it does not know the power of Islam." -Ibn Khaldun

  14. #14
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    You'd have to be a little more specific - like attaching your modeldb file.

  15. #15

    Default Re: battle_models.modeldb sweeper

    It's probably the format of the BMDB file like BC uses a different format while SS uses a different which majority of the mods use.

  16. #16
    Heeehehe's Avatar Tiro
    Join Date
    Dec 2010
    Location
    City of Lightning, Equator Emerald, 1st Level of Heaven
    Posts
    246

    Default Re: battle_models.modeldb sweeper

    Uh Yes i used BC modeldb, this don't work on BC modeldb?
    "And indeed We created man (Adam) out of an extract of clay (water and earth). Thereafter We made him (the offspring of Adam) as a Nutfah (mixed drops of the male and female sexual discharge) (and lodged it) in a safe lodging (womb of the woman). Then We made the Nutfah into a clot (a piece of thick coagulated blood), then We made the clot into a little lump of flesh, then We made out of that little lump of flesh bones, then We clothed the bones with flesh, and then We brought it forth as another creation. So blessed be Allah, the best of creators. After that, surely, you will die. Then (again), surely, you will be resurrected on the Day of Resurrection. And indeed We have created above you seven heavens (one over the other), and We are never unaware of the creation." (QS. Al-Mu'minun (23):12-17)

    "He who has not seen it does not know the power of Islam." -Ibn Khaldun

  17. #17
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    This works on any modeldb file. Why doesn't it work on the BC file? Because they use linux style end of line markers - LF instead of the windows CRLF.
    I really didn't think someone would use it like that, and seeing med is developed for windows there is no need for that.

    Just change the end of line style to windows for the BC modeldb. You'll need to use something more sophisticated then notepad for this - like notepad+ or notepad2 (which i use)

  18. #18

    Default Re: battle_models.modeldb sweeper

    Follow up what gracul said that will fix it.

  19. #19
    Heeehehe's Avatar Tiro
    Join Date
    Dec 2010
    Location
    City of Lightning, Equator Emerald, 1st Level of Heaven
    Posts
    246

    Default Re: battle_models.modeldb sweeper

    Thanks
    "And indeed We created man (Adam) out of an extract of clay (water and earth). Thereafter We made him (the offspring of Adam) as a Nutfah (mixed drops of the male and female sexual discharge) (and lodged it) in a safe lodging (womb of the woman). Then We made the Nutfah into a clot (a piece of thick coagulated blood), then We made the clot into a little lump of flesh, then We made out of that little lump of flesh bones, then We clothed the bones with flesh, and then We brought it forth as another creation. So blessed be Allah, the best of creators. After that, surely, you will die. Then (again), surely, you will be resurrected on the Day of Resurrection. And indeed We have created above you seven heavens (one over the other), and We are never unaware of the creation." (QS. Al-Mu'minun (23):12-17)

    "He who has not seen it does not know the power of Islam." -Ibn Khaldun

  20. #20
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: battle_models.modeldb sweeper

    Added the functionality:
    Third, You can check for any file not referenced by the modeldb, but inside the directory structure. Such files are mostly leftovers and only make the mod folder bigger, an option to automatically remove the files will show up as a yes/no (first view the unneeded.txt tho).

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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