Cosmetic Tags

Just a quick question on how custom Cosmetic Tags work, I know the code set_cosmetic_tag adds a cosmetic tag to a specific country but how do you change that tag? How do you change what the country should be called when the tag is added, or how do you change the flag when the tag is added?

That's all, just couldn't find an example on how they work with this site, thanks :)

There isn't an official way to do this on the site yet, although another user has created a guide on how you can sort-of do it here: https://edge.hoi4modding.com/forum/mod-discussion/620-guide-to-making-formable-nations-no-outside-tools


How the essentially work is you are assigning a new tag to your nation, and using this tag to get their name/flag/and potentially other things - such as focus tree.


A cosmetic tag can be something completely made up, e.g. "ZZZ", and acts exactly how you would expect. 

However, if you are just wanting to change flag/name when they are a subject of another nation you can do something very similar to cosmetic tags without assigning one. With the flag's file name, or their name ID in the localisation files, you can insert "_[OVERLORD_TAG]" or "_[AUTONOMY_TYPE]" (or both) after the nation's tag, and whenever the nation is a subject of the overlord specified, it will have the name/flag specified.

For example:

CAN: "Canada"
CAN_GER_autonomy_dominion : "Dominion of German Canada"

And for the flag file "CAN_GER_fascism.tga"

There isn't an official way to do this on the site yet, although another user has created a guide on how you can sort-of do it here: https://edge.hoi4modding.com/forum/mod-discussion/620-guide-to-making-formable-nations-no-outside-tools


How the essentially work is you are assigning a new tag to your nation, and using this tag to get their name/flag/and potentially other things - such as focus tree.


A cosmetic tag can be something completely made up, e.g. "ZZZ", and acts exactly how you would expect. 

However, if you are just wanting to change flag/name when they are a subject of another nation you can do something very similar to cosmetic tags without assigning one. With the flag's file name, or their name ID in the localisation files, you can insert "_[OVERLORD_TAG]" or "_[AUTONOMY_TYPE]" (or both) after the nation's tag, and whenever the nation is a subject of the overlord specified, it will have the name/flag specified.

For example:

CAN: "Canada"
CAN_GER_autonomy_dominion : "Dominion of German Canada"

And for the flag file "CAN_GER_fascism.tga"

-jordsta95

 So I made a new country with the tag EMP, I followed the guide and added this to my focus rewards:

 set_cosmetic_tag = BAD_EMP_communism. 

When tested in game nothing happened but also no errors showed up on the log (other than  missing country leader portrait, but I don't think that's needed). Is anything wrong or is it because there is no country leader portrait?


In that case, you only need to do "set_cosmetic_tag = EMP"

The way you have done it would be the filename for the communist flag of BAD when it is a subject of EMP

In that case, you only need to do "set_cosmetic_tag = EMP"

The way you have done it would be the filename for the communist flag of BAD when it is a subject of EMP

-jordsta95

 I did that but the same thing happens, I also added portraits (just in case), still didn't work.

It might be because every time I go to export the mod it shows an error, ErrorexportingcountrywiththetagEMP

I haven't added anything except a leader portrait, a name, a flag and a tag so I don't know how it could be causing an error, only idea I have is that it's caused by the country having no states assigned to it. When I checked the files there was no files for the country with the tag EMP. So the code most likely works it just seems that my new country isn't being exported at all.

That was due to the countries having the same name upon creation; this is used as a filename, and as you can't have two countries with the same filename, the export failed. (Anything edited when editing the country doesn't affect filenames)


I've changed the filename to "Cosmetic Baddie Empire", all of the other things inside the tool are as you left it - But seems to export as expected now :)

That was due to the countries having the same name upon creation; this is used as a filename, and as you can't have two countries with the same filename, the export failed. (Anything edited when editing the country doesn't affect filenames)


I've changed the filename to "Cosmetic Baddie Empire", all of the other things inside the tool are as you left it - But seems to export as expected now :)

-jordsta95

 Oh thanks, I was thinking that could be an issue but I couldn't find anyway to edit the name without deleting the country :)

That was due to the countries having the same name upon creation; this is used as a filename, and as you can't have two countries with the same filename, the export failed. (Anything edited when editing the country doesn't affect filenames)


I've changed the filename to "Cosmetic Baddie Empire", all of the other things inside the tool are as you left it - But seems to export as expected now :)

-jordsta95

I couldn't get the flag to work (the name worked fine) so I just changed my main countries flag but then I noticed something. The flag is upside down despite being the right way up when I view the file and look at my country on the site, is there anyway to fix this?


Edit: It seems to also happen with a different country I'm working on in a different mod, the flag look the correct way up on the site but in game they appear upside down.

That was due to the countries having the same name upon creation; this is used as a filename, and as you can't have two countries with the same filename, the export failed. (Anything edited when editing the country doesn't affect filenames)


I've changed the filename to "Cosmetic Baddie Empire", all of the other things inside the tool are as you left it - But seems to export as expected now :)

-jordsta95

I couldn't get the flag to work (the name worked fine) so I just changed my main countries flag but then I noticed something. The flag is upside down despite being the right way up when I view the file and look at my country on the site, is there anyway to fix this?


Edit: It seems to also happen with a different country I'm working on in a different mod, the flag look the correct way up on the site but in game they appear upside down.

-xdAyden

 that's just a site error, jordsta's working on it rn