Help with custom unit names?

Have modding questions or discovered something new? Post here.
Post Reply
User avatar
FlamingC64
Machine Gunner
Machine Gunner
Posts: 24
Joined: Mon Jan 17, 2022 9:40 am
United States of America

Help with custom unit names?

Post by FlamingC64 »

I was working on custom buildings and unit models but when I added them to the game their preview name was army.unit.___ or game.type____
Does anyone know how to fix this? I have seen in Gears of Plastic the Flamethrower unit has its name properly working.
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: Help with custom unit names?

Post by TommyCD1 »

It's hard coded into the game for the way the name is displayed. The name is taken from the type name and displayed as
  • #game.types.XXX
where XXX is the type name defined in the .cfg file. For the vanilla units, these "#game.types" have values they correspond to in the "english.dat" file. This way the code can refer to them as the same no matter what machine you are using, while the name displayed on the HUD can be properly localized by modifying the english.dat file.

There are some unused values in the vanilla english.dat file, such as for 'army.unit.flame' or 'army.unit.truck' or 'army.unit.flag' and these are typically used by map makers since they get properly translated. However, anything not defined in the english.dat file gets displayed with the "game.types" still in front of it.

Bascially, you can either use one of the values defined in english.dat, or you can deal with the game.types text at the front of the name. There aren't any currently known ways I'm aware of to displaying the type name without this text.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
FlamingC64
Machine Gunner
Machine Gunner
Posts: 24
Joined: Mon Jan 17, 2022 9:40 am
United States of America

Re: Help with custom unit names?

Post by FlamingC64 »

Is there anyway to edit the english.dat file or is it a lost cause?
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: Help with custom unit names?

Post by TommyCD1 »

You can edit english.dat, but it's really recommended that you don't do that, because edits to english.dat are not only global, as in they apply everywhere in the game and not just your custom map, but they also aren't "exchangable". That is, if you were to edit your english.dat for your custom units, then someone else where to create their own version of english.dat for their custom units; You would end up with conflicting files without any way to interchangibly use one over the other without manually going into the files and swapping .dat files. As in each time you want to play each version. And creating a "global" english.dat with all custom units in it is infeasible considering anyone would be able to make a custom unit at anytime...
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest