Results 1 to 19 of 19

Thread: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

  1. #1

    Default cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Dear modders,

    For weeks I've been consumed by the thought that there should be a easy
    way to edit the dreaded battle_models.modeldb (BMDB). My first attempt
    was not that user-friendly and helpful probably because it included too
    many steps. To make things worse it sounded complicated for the
    unintiated in gvim ( a text editor).

    Here is my second attempt, which I think will be much more easier for
    people to follow. The catch is that it is based on command lines rather
    than GUI, and those command lines invoke shell scripts written for bash
    shell (linux). But don't worry, cygwin has developed an linux emulator
    that will run the shells in a windows XP machine, without any further
    changes in the shells.

    -------------------------
    what you'll need:
    -------------------------

    1) Knight Errant's battle_models.modelsdb;
    2) the shells I've written (http://www.twcenter.net/forums/downl...o=file&id=1487)
    3) To install cygwin
    4) To install gvim (optional)

    caveat: during the installation of cygwin it is asked of you which file
    format you want to work with , Unix or DOS. Choose Unix.

    -------------------------
    what you will do:
    -------------------------

    1) convert the Knigths Errant 's battle_models.modeldb to unix format.
    You can use gvim for doing that. Open the file in gvim, then go to Edit
    menu> File Setting > File Format and choose unix. Save the file and exit

    2) move the battle_models.modeldb to the directory of your choice,
    preferably an empty one, along with the two shells provided on the .tar
    file at the download area.

    3) click on the desktop icon for cygwin and through the cygwin window
    find the directory where you have put the files on the preceding step 2.

    4) type faction.sh at the cygwin command prompt. This will print on the
    screen a help for this shell, showing you how to use it. An example:

    ./faction.sh battle_models.modeldb milan milan_units.txt

    The shell takes three arguments:
    a) the name of the BMDB file;

    b) the "base" faction name, as it appears on BMDB, from which you want
    to clone the units to another faction

    c) the name of an output file, which will contain all the names of units
    assigned to your base faction (in this case, milan) in BMDB

    NOTE:the use of ./ is optional: it means that the shell script
    faction.sh is in your current directory.

    The output file will contain all of milan units. This file will now be
    used to add all these units (or only some of them if you chose to delete
    lines on this file) to a "target" faction, say "ireland".

    7) type units.sh. A similar help will be output to the screen. Now add
    those units in milan_units.txt to ireland faction! At the command prompt
    type

    units.sh '5 milan' '7 ireland' milan_units.txt battle_models.modeldb newBMDB

    The units.sh does the heavy work (in a couple of seconds). It takes 5
    arguments:

    i) '5 milan' ----->the name of the 'base' faction and the #
    of characters in it (note that they have
    to be quoted using single quotes)

    ii) '7 ireland' ----->the name of the "target" faction in the same
    format.

    iii) milan_units.txt -----> the name of the file containing the units
    from the "base" faction

    iv) battle_models.modeldb ----> the name of the input BMDB file

    v) newBMDB ----->the name of the output edited file.

    Now you are done and successfully added units to "ireland" faction,
    which could be an existing faction or a brand new one.

    To better understand and check the results of this editing ( and to
    report bugs on the shell scripts) you should still read the tutorial
    about adding units to a faction by M3rcury15.

    What these shells I provided do is to make your life easier by saving you all the cutting and pasting work. Should you like to add new skins to your cloned faction, then you will have to edit the file manually after this first run!

    I hope this will be useful for modders!

    cheers,

    Cururu
    Last edited by Cururu; July 02, 2007 at 09:47 PM.

  2. #2
    B. Ward's Avatar ★★★★ RockNRolla ★★★★
    Join Date
    Feb 2007
    Location
    East Coast, United States
    Posts
    4,376

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    great job man, very impressive. +rep for your contribution man, many will find this useful

  3. #3

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Is the output file a new fully working BMDB, or a text file from which we must copy paste into the old BMDB?

  4. #4

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    The output should be a fully working BMDB file.

  5. #5

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Quote Originally Posted by Cururu View Post
    The output should be a fully working BMDB file.
    Hooray! Thats fantastic! I can't wait to try it out tonight.

  6. #6

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    this is very useful, +rep,

    but the Knight Errant's battle_models.modelsdb link is wrong.

  7. #7
    KnightErrant's Avatar Decanus
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    578

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    This is a cool tool for the modeldb file.
    I got the same wrong page thingy for
    version 1.2 of the modeldb file too. Here's
    a link for it:

    http://www.twcenter.net/forums/downl...o=file&id=1180

    Note that even though I said version 1.2 for the file its for the
    1.1 game patch. The Venetian Heavy Infantry upgrade thing is
    still needed for compliance with the 1.2 game patch.

    I think both Hans Kloss and zxiang1983 have made formatted
    modeldb files for the 1.2 patch so you can look for them or do
    your own using the Python script.

  8. #8

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Knight Errant,

    Thanks for correcting the link problem, I think I missed a character when cutting and pasting... Soon I should be releasing a newer version of the scripts plus other additions that let you do all the editing to create a new faction from cloning others.

  9. #9
    KnightErrant's Avatar Decanus
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    578

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    @Cururu,
    That would be excellent. I think where your tools would be
    most useful is to the mod developers who need to do multiple
    edits to get new units available to multiple factions, especially
    non standard factions. The Unix tools you've made should really
    help there

  10. #10

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    @Knight Errant,

    Thanks for the encouraging words!


    Dear modders,

    I have noticed that the unitToolBox has been downloaded about 70 times... I would appreciate feedback on it, if any...
    cheers,
    Cururu

  11. #11
    Milos98's Avatar Semisalis
    Join Date
    Nov 2006
    Location
    Zini da ti ka˛em
    Posts
    444

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Quote Originally Posted by Cururu View Post
    @Knight Errant,

    Thanks for the encouraging words!


    Dear modders,

    I have noticed that the unitToolBox has been downloaded about 70 times... I would appreciate feedback on it, if any...
    cheers,
    Cururu
    Make it 71,...

    Great tool
    Last edited by Milos98; July 13, 2007 at 02:27 AM.
    Regards, Milos98

  12. #12

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    @Cururu
    Great stuff mate!

    This saves so much time...and so many bug hunts...

    Thanks alot.

  13. #13

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Thanks,

    Milos and ME2_junky, always nice to hear compliments and feeling we are doing something useful

    cheers,
    cururu

  14. #14

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Does this work with a normal (say vanilla or other moded bmdb file) bmdb file, or does it HAVE to be the edited Knight errants file.

  15. #15

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Shaba,

    It needs to have the same format as Knight Errant's BMDB. You could already have some new units there and other changes. I think the safest bet is to use KE python script to format the BMDB file and then use the shell scripts...

  16. #16
    Turtules's Avatar Campidoctor
    Join Date
    Jan 2007
    Location
    FL
    Posts
    1,712

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    72 very good work.

  17. #17
    Lycodelphos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    St. Petersburg, Florida USA
    Posts
    264

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Cururu,

    I'm not sure if you're still monitoring this thread but I need some help using your shell files. I've gotten all the steps down correctly until your instruction to 'type in "faction.sh" at the cygwin prompt for help, nothing happens, and when I hit enter I get the 'command not found' error message. I tried just entering the string for creating the first units txt file and got the same result. What am I doing wrong? FYI I'm not an experienced UNIX user. Also my prompt is "$" and on entering the 'bash' operation occurs. Can you assist me?

  18. #18

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    Yeah that had me puzzled for a bit, too.

    You have to add /usr/bin/sh before faction.sh with this Cygwin version.

    so usr/bin/sh faction.sh [etc] works, but I get an error in line 80 with a kingdoms modeldb, everything else is hunkydory as to Unix format etc, it conks out on an unexpected value or something - something different in the modeldb format I guess.

    units.sh line 80 7england value too great for base <error token is: 7england>

    (the missing space in 7england doesn't make sense, it's nowhere in the original file, BTW)

  19. #19

    Default Re: cururu's unit toolbox v1.0 ---- tools for easy editing of battle_models.modeldb

    [edit] argh, thought I had it sussed for a second, but running units.sh had emptied the first output file, so I got a no-change modelsdb. When I ran it again, I still get the same error. Alas. Hope you can fix this for us, this is one helpful tooly.

    [edit2] I did get it to sortof run after adding 26 manually after the first mount type. That's curiously the only one without a tally line. Then it works, but gives errors at *some* units (I think it expected an integer value or something, can give you the screenies etc.) and goes wrong at the end, and produces no output, alas.

    So it's something with the formatting, I guess, they changed something in either Cygwin shell scripts or Kingdoms modelsdb I'm afraid.
    Last edited by Spurius; January 16, 2008 at 07:47 PM.

Posting Permissions

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