Error when trying to add new unit

Error when trying to add new unit

randy_cat

May the Force be with you.
Joined
Sep 20, 2021
Messages
153
Reputation
12
Points
50
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
 
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.
 
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 :thumbsup2
 
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.
 

Attachments

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... .
 
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
 
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?
 
I know this is 5 years later, so I hope this aint dead. Ive been stuck on this for 2 days now and have tried all I can think of except asking. When I try to load up MTW i get the error message UNKNOWN UNIT TYPE ENCOUNTERED: COLUMN 2, ROW 185 "7". 7 is the upkeep cost for the unit, but it reads it as a type???
 

Attachments

Werewolf89, you are missing 2 arguments for the "Boat" unit after "1,1,0,2,0, boat sunk message". Arguments can be empty, but you cannot delete the separating tab. If you press the Tab key 2 times after "1,1,0,2,0, boat sunk message" and save, the error "Unknown unit type encountered:" will disappear. But a new error will appear - "Unknown unit found in anti-units list: " due to the fact that for the unit "PictishMountedCrossbows" a non-existent unit is specified, which it will turn into if it dismounts before the battle - "PictishCrossbows". Add such a unit to the file, delete the entry, or specify another existing unit, and the error will disappear. I'll attach the file just in case, I added tabs and replaced "PictishCrossbows" with "Crossbows". Now you can edit the file as you need.
 

Attachments

Site News

Thread Statistics

Created
randy_cat,
Last reply from
Welder2,
Replies
10
Views
6,108

Site Polls

  • Axis & Allies

  • Battleship

  • Checkers

  • Chess

  • Clue

  • Go

  • Monopoly

  • Risk

  • Stratego

  • Other


Results are only viewable after voting.
Back
Top Bottom