Results 1 to 10 of 10

Thread: Merging Elven faction units

Hybrid View

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

    Default Merging Elven faction units

    Hello there. Is there an easy notepad based way to merge the High and Silvan Elf unit rosters for recruitement in Campaign? I'm not a huge LoTR lore buff so that side of it doesnt really bother me, and I'd like a bit more variety. I'm fickle like that, ya see. Anyways, any helps appreciated.

  2. #2
    Tiro
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    220

    Default Re: Merging Elven faction units

    Open export_descr_unit.txt in medieval2\mods\third age\data
    Find high elves\silvan elves units.
    Find:
    ownership
    era 0
    era 1
    era 2
    In every HE/SE unit in above verses you should type/paste: egypt, mongols
    Save.
    Sorry for my bad english , I don't mind correcting!

  3. #3

    Default Re: Merging Elven faction units

    That wont work... the db ui and a txt file or two needed to be edited too


  4. #4

    Default Re: Merging Elven faction units

    Care to elaborate at all, Jon?

  5. #5

    Default Re: Merging Elven faction units

    Quote Originally Posted by Tomsie View Post
    Care to elaborate at all, Jon?
    It's a tad complicated... I'd suggest finding a tutorial if you really want to take the time to do it.. you could of course skip the UI (unit card) and text (unit description), but even then you need to edit the modeldb so your units actually have a texture (in fact I think it might just D/C without doing that), and once you're done all that you'd need to change the faction colors (if you want it to make sense at least..) and what not. In short, I wouldn't bother, it'll just waste your time and once you get it (assuming you do) it'll break lore and balance.


  6. #6
    Faris ad Din's Avatar Ducenarius
    Join Date
    Nov 2006
    Location
    Queens, NYC
    Posts
    957

    Default Re: Merging Elven faction units

    Quote Originally Posted by JonSnow View Post
    That wont work... the db ui and a txt file or two needed to be edited too
    Yeah, it's really not simple as that. Several different files/folders need looking after.
    Namely,
    1. Copying and pasting in the unit cards for the UI/units folder
    2. Copying and pasting in the unit cards for the UI/unit info folder
    3. Adding the factions to the ownership in the export_descr_unit.txt file as said
    4. Adding in the units to the appropriate factions, here for each egypt and mongols in the export_descr_buildings.txt file
    5. Edit the MODEL.DB file... that is a bit more of an editing nightmare.

    Basically you can copy and paste everything from the "egypt" folder in the UI/units folder to the "mongols" folder in the UI/units folder, and vice versa;
    ... copy and paste everything from the "egypt" folder to the "mongols" folder in the UI/unit info folder, and vice versa;
    ... add "egypt" to all the units already belonging to "moors" in the export_descr_units.txt file, and vice versa;
    ... add "egypt" to all the lines in the export_descr_buildings.txt file that already have "mongols" in it, and vice versa;
    The biggie... MODEL.DB file needs editing - you need to copy and paste all the lines under all the units (use Ctrl-F to search for the EDU file names of your desired units) which are for one or the other faction (egypt and mongols) and add it to the other - but you NEED to edit the numbers in the file that specify the length of the strings as well as the number of factions. For example, "egypt" is a string of five characters, "mongols" is a string of seven. It's some of the more tricky editing. If you fail to change those string lengths and faction number parameters, you will CTD and be left floundering as to what went wrong. Do the changes in little bits and test frequently before backtracking. Look up some tutorials as to editing this file. If you don't use a tutorial... I'm sure they're easy to find in the M2:TW mod workshop - you will be left floundering as to what the heck is going on in that 1 MB+ text file with no entered lines.

    Oh yeah, make sure to back up your EDU, EDB and the MODELS.DB file first.

    The EDB editing will be tedious. The descr_models file will be the hardest and most tedious part.
    The unit_names.txt or whatever it's named, and the unit description file won't need looking after.

    Explanation for why these are needed?
    If you don't add the cards to the appropriate units folder, you will see a gray RTW-style generic gray Roman peasant card (put in as the default when no developer-defined card is available) instead of the appropriate unit card in your unit bar and in your recruitment windows, etc.
    If you don't add the cards to the appropriate unit info folder, you will see the picture of the gray Roman peasant portrait when you click up the unit information.
    If you don't fix the EDU, you won't get the unit in that faction roster at all, even in the custom battles, gray peasant portrait or no.
    If you don't fix the EDB, you can't recruit the unit in campaign at all.
    If you don't fix the MODELS.DB file, I believe you will get the model of the unit on the battlefield, but there will be no texture, and the default is to have a Silver Surfer-type reflective silver appearance. Looks cool when you first try it out, but it gets pretty lame and annoying after a while. Either that, or CTD.

    Quote Originally Posted by Tomsie View Post
    Care to elaborate at all, Jon?
    Comes across as a bit audacious for the task you're asking about, my apologies for pointing that out.
    Last edited by Faris ad Din; May 08, 2009 at 09:33 PM.

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

    Default Re: Merging Elven faction units

    Hello Tomsie, for the most part it's simple stuff in fact battle_models.modeldb is the only potentially annoying part, that file can be pretty scary

    And it's the best place to start, you'll find it in 'data\unit_models'. Edit it with notepad and use 'find' to search for units. If you can't find one then you can check to make certain of it's name in export_descr_units.txt on the 'soldier' line for the unit.

    So the trick is to find the correct entry for the unit you want and add your faction to the list of those that can use it... sounds simple and it really is

    So here I've found some Silvan dudes:

    21 silvan_heavy_spearmen
    1 1
    56 unit_models/_Units/my_units/silvan_heavy_spear_lod0.mesh 6400
    1
    7 mongols
    48 unit_models/_Units/my_units/textures/elf.texture
    55 unit_models/_Units/my_units/textures/elf_normal.texture
    53 unit_sprites/mongols_silvan_heavy_spearmen_sprite.spr
    1
    7 mongols
    59 unit_models/_Units/my_units/textures/elf_attachment.texture
    66 unit_models/_Units/my_units/textures/elf_attachment_normal.texture
    0
    1
    4 None
    10 MTW2_Spear
    0
    2
    18 MTW2_Spear_primary
    14 fs_test_shield
    0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002


    And to get what I want I just have to make it look like this:

    21 silvan_heavy_spearmen
    1 1
    56 unit_models/_Units/my_units/silvan_heavy_spear_lod0.mesh 6400
    2
    7 mongols
    48 unit_models/_Units/my_units/textures/elf.texture
    55 unit_models/_Units/my_units/textures/elf_normal.texture
    53 unit_sprites/mongols_silvan_heavy_spearmen_sprite.spr
    5 egypt
    48 unit_models/_Units/my_units/textures/elf.texture
    55 unit_models/_Units/my_units/textures/elf_normal.texture
    53 unit_sprites/mongols_silvan_heavy_spearmen_sprite.spr
    2
    7 mongols
    59 unit_models/_Units/my_units/textures/elf_attachment.texture
    66 unit_models/_Units/my_units/textures/elf_attachment_normal.texture
    0
    5 egypt
    59 unit_models/_Units/my_units/textures/elf_attachment.texture
    66 unit_models/_Units/my_units/textures/elf_attachment_normal.texture
    0
    1
    4 None
    10 MTW2_Spear
    0
    2
    18 MTW2_Spear_primary
    14 fs_test_shield
    0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002

    See those bold 2s? Well they denote the number of factions (or entries that will follow), the rest is obviously just copy and paste and writing '5 egypt' a couple of times. Simple.

    The problem is that if you make some kind of mistake you will typically get no error message, which can make it a very frustrating file.

    As for the rest, you'd need to add your faction to the lines HUtH specified in export_descr_units.txt, and then in export_descr_buildings.txt you add your faction to the list of factions that can produce the unit (in the section of whatever building trains that unit).

    So then you're only lacking unit cards and description pictures which you'll find in 'data\ui\unit_info' and 'data\ui\units', in both folders you'll see a folder for each faction. It's then just a case of copying the pictures with the names of the units you want, into the folder for your faction.

    There... done
    Last edited by Taiji; May 08, 2009 at 10:08 PM.

  8. #8

    Default Re: Merging Elven faction units

    Cheers lads, I'll have a crack 2moro. Sounds like a bloody nightmare!
    Thanks a lot for taking the time to write all this, really is appreciated.

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

    Default Re: Merging Elven faction units

    Quote Originally Posted by Tomsie View Post
    Cheers lads, I'll have a crack 2moro. Sounds like a bloody nightmare!
    Thanks a lot for taking the time to write all this, really is appreciated.
    No worries mate, let me know if you have probs

  10. #10
    Faris ad Din's Avatar Ducenarius
    Join Date
    Nov 2006
    Location
    Queens, NYC
    Posts
    957

    Default Re: Merging Elven faction units

    Bloody nightmare it is. Back-up, back-up often, test often, release your stress often.

Posting Permissions

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