Results 1 to 9 of 9

Thread: Error when trying to add new unit

  1. #1

    Default Add new units

    Hello, i just want to ask something about adding new units to mtw. The problem is as follows: when i try to add a new string to the " crusader_unit_prod11 " it often gives an error message, like " invalid format, building label should be: BUILDING_BUILDINGLABEL ", despite the correct building label is written. For example, building requirement " SPEARMAKER3 " is not allowed for unknown reason. But spearmaker level 3 exists in the campaign so i don't know what's wrong. Another error is simple, " uknown unit type at column Y and string X ).

    Why it doesn't work, i don't know, since everything seems fine, building requirements, faction ID, and region ID for those units that you can only train in specific provinces.

    Let me do a brief example: i try to make bulgarianarmouredpikemen recruitable but it gives me error, despite i modified the FN_FACTION ( BULGARIAN ), to HUNGARIAN, a faction that exists in vanilla mtw ( while bulgarian does not exist in vanilla )

    I followed some guides, where they explain how to add new units, followed all the instructions and it still does not work. Since i want to add many new units to my personal modification, i'd appreciate very much some help from someone who can mod mtw, thx a lot.

    Cheers

  2. #2

    Default Error when trying to add new unit

    I get this message whenever i try to add more units to the " CRUSADERS_UNIT_PROD11 " text file. I managed to add a few functional units but now it always give me this message, for example: " unknown unit type at column 300 row 8 ". Maybe i reached the unit max cap? I read somewhere that there is a unit cap of 100 but not sure about it. Can someone help? I'd like to add more units to the game but it proves to be a little tricky.

  3. #3
    Libertus
    Join Date
    Nov 2016
    Location
    Ratae Corieltauvorum
    Posts
    76

    Default Re: Error when trying to add new unit

    Unit cap is 256, so it's not that.

    Sounds more like a formatting error. I don't know whether you're using Gnome editor or going straight in with Notepad, but generally the safest way to edit this file for adding units is to first open it up with Notepad, copy an existing unit entry (obviously choose something as similar as possible to what you want to create...), paste it in the next slot so you can find it easily, then save and open up with Gnome. In Gnome, edit the details you want to change and resave. All should be well formatted, and it *should* work.

    If you're editing in Notepad, you'll find that tabs, spaces and the 'wraparound' in the middle of one of the columns can cause horrible problems. Gnome has its faults (you need to clear out junk at the end of the file if you reduce overall file length) but it is generally the best tool for the job.

    Hope this helps

  4. #4

    Default Re: Error when trying to add new unit

    Quote Originally Posted by Macsen Rufus View Post
    the safest way to edit this file for adding units is to first open it up with Notepad, copy an existing unit entry (obviously choose something as similar as possible to what you want to create...), paste it in the next slot so you can find it easily, then save and open up with Gnome. In Gnome, edit the details you want to change and resave. All should be well formatted, and it *should* work.
    What i did is exactly what you say... i pick a string from another modification and paste it in my " CRUSADERS_UNIT_PROD11 " text file. Then i first start the game, before picking anything else, to see if it works but it doesn't even start, giving me an " unknown unit type " error message. I try with gnome editor but the last unit added doesn't even appear in the list, for some reason. Then, i manage to add some new units but with difficulty, but now it seems like the game won't accept any new unit since it always gives me the error message whenever trying to add a new one. If you can help me i would be very grateful... i will put here the crusaders_unit_prod11 file so you can take a look. The last entry " brabanconspearmen " for example makes the game crash but i don't know how to fix it.
    Attached Files Attached Files

  5. #5

    Default Re: Error when trying to add new unit

    randy_cat, The data of each next unit is placed on a new row. The values of the fields are separated using Tab.
    You just need to move the data of this unit to the next row by pressing the "Enter" key.

    Instead of

    ..."FN_ITALIAN, FN_SICILIAN"BrabanconSpearmen...

    it should become

    ..."FN_ITALIAN, FN_SICILIAN"
    BrabanconSpearmen... .

  6. #6

    Default Re: Error when trying to add new unit

    Damn i don't know what to do then, i did put the new unit in the next row like you say it still gives me the same error message. I did the same thing with some other units and they work, but now it doesn't allow me to add any more units

  7. #7

    Default Re: Error when trying to add new unit

    randy_cat,
    Attached Files Attached Files

  8. #8

    Default Re: Error when trying to add new unit

    Oh, thank you so much! Now it works... may i ask another question? I added " byzantinespearmen " to the unit roster and they work, but in the battle map, they don't have shields, just the spear... maybe i messed up with the textures files?

  9. #9

    Default Re: Error when trying to add new unit

    Nevermind, i fixed it.

Posting Permissions

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