WC4 Adding Countries Guide
Jul 30, 2022 23:13:38 GMT
Antonina of Philippopolis and Darth Vader like this
Post by Darth Nihilus on Jul 30, 2022 23:13:38 GMT
I wanted to make a more visual guide by combining the existing EFC guide and Canadian Modder’s Youtube guide. See their posts here for info:
Erebus’ Guide: https://european-war-4.boards.net/thread/11462/wc4-adding-country
(edit: idk why link doesn't take you there so just copy-paste it)
Canadian Modder’s Guides: www.youtube.com/playlist?list=PLx9NDgtEvnsaFdJYoKuFJgVigblT5Xk7f
What You’ll need:
1. Tacticalmap.webp & tacticalmap.xml (under assets)
2. Countrysettings.json (under assets -> json)
3. Image_flags_hd.webp & image_flags_hd.xml (under assets -> image)
4. Stringtable_en.ini (under assets), (optionally you can include cn, ko, tw, etc.)
5. A hex editor (eg. hexed.it) or a map editor (you can find two in CM’s playlist)
6. An image editor (I use photopea.com on a pc); a JSON editor (can probably do on phone)
7. A WC4 unlock APK (obviously)
I’m currently working on a Cold War mod so here I’m gonna be adding the Azerbaijan People’s Government, which existed from 1945 - 1946 during the Iran Crisis.
Step 1: Extract files 1-4 from your APK
Step 2: Open image_flags_hd.xml and create a new country profile. Just copy-paste the last line of code before the closing bracket, and change the image name to a number that hasn’t been used (You should have 48, but I have 49 cause I made another country earlier).
From this we see that you want your flag image to be 52 x 54 in size. So find your flag and do that. Preferably you want your flag to also be a circle (cause it looks better). If your picture looks grainy don't worry cause it's gonna get really shrunken down in-game
Step 3: Take your flag and slap it onto image_flags_hd.webp where it won’t overlap with anything else. Now find the coordinates of the UPPER LEFT CORNER (NOT CENTER) of your image and set that as the x and y values in your xml file.
Step 4: Now do the same thing in tactical maps but twice; Once for flag_[x].png as a 52 x 54 image, and once for f_[x].png as a 37 x 38 image. Because of the dimension ratio you can simply just scale the image down for the smaller image.
Step 5: We’re almost setting up now. Go to CountrySettings.json and copy-paste any line of code, and make some edits.
Note: Make sure to end your code without a comma, otherwise the game will crash.
“Name”: Put the Chinese version of your country’s name. Google translate should do fine.
“Camp”: If you’re adding an axis, then 1. Allies, then 2. Otherwise 5.
“[x]Mod”: Whatever design units will have, which you can copy-paste from other countries. I chose to use Iranian unit models. You might use US models, USSR models, etc. or a combination of multiple countries
Step 6: Go to stringtable_en.ini and add the name of your country under the country number you added. You'll have to scroll down a fair amount to find them.
Adding said country to your game: Compile all the files into your APK. If replacing an existing country, simply changing the “country” byte of the “country” block to the ID you added (in my case, 50). Remember to convert this number to hex!
If you're adding, then edit the "main" block as shown below, and add a country "block" at the end of all the country blocks so you can designate your country.
A useful link here is the BTL guide so you'll know how to edit your country: european-war-4.boards.net/thread/9609/wc4-btl-guide
In conquest, also go to ConquerCountrySettings.json and copy-paste an existing line of code in whatever era you’re adding the country in, remembering to change the “CountryID” to a new value.
End result on the red hex (colours are added in-stage). I also included the Iranian flag which already exists in Vanilla for comparison.
Erebus’ Guide: https://european-war-4.boards.net/thread/11462/wc4-adding-country
(edit: idk why link doesn't take you there so just copy-paste it)
Canadian Modder’s Guides: www.youtube.com/playlist?list=PLx9NDgtEvnsaFdJYoKuFJgVigblT5Xk7f
What You’ll need:
1. Tacticalmap.webp & tacticalmap.xml (under assets)
2. Countrysettings.json (under assets -> json)
3. Image_flags_hd.webp & image_flags_hd.xml (under assets -> image)
4. Stringtable_en.ini (under assets), (optionally you can include cn, ko, tw, etc.)
5. A hex editor (eg. hexed.it) or a map editor (you can find two in CM’s playlist)
6. An image editor (I use photopea.com on a pc); a JSON editor (can probably do on phone)
7. A WC4 unlock APK (obviously)
I’m currently working on a Cold War mod so here I’m gonna be adding the Azerbaijan People’s Government, which existed from 1945 - 1946 during the Iran Crisis.
Step 1: Extract files 1-4 from your APK
Step 2: Open image_flags_hd.xml and create a new country profile. Just copy-paste the last line of code before the closing bracket, and change the image name to a number that hasn’t been used (You should have 48, but I have 49 cause I made another country earlier).
From this we see that you want your flag image to be 52 x 54 in size. So find your flag and do that. Preferably you want your flag to also be a circle (cause it looks better). If your picture looks grainy don't worry cause it's gonna get really shrunken down in-game
Step 3: Take your flag and slap it onto image_flags_hd.webp where it won’t overlap with anything else. Now find the coordinates of the UPPER LEFT CORNER (NOT CENTER) of your image and set that as the x and y values in your xml file.
Step 4: Now do the same thing in tactical maps but twice; Once for flag_[x].png as a 52 x 54 image, and once for f_[x].png as a 37 x 38 image. Because of the dimension ratio you can simply just scale the image down for the smaller image.
Step 5: We’re almost setting up now. Go to CountrySettings.json and copy-paste any line of code, and make some edits.
Note: Make sure to end your code without a comma, otherwise the game will crash.
“Name”: Put the Chinese version of your country’s name. Google translate should do fine.
“Camp”: If you’re adding an axis, then 1. Allies, then 2. Otherwise 5.
“[x]Mod”: Whatever design units will have, which you can copy-paste from other countries. I chose to use Iranian unit models. You might use US models, USSR models, etc. or a combination of multiple countries
Step 6: Go to stringtable_en.ini and add the name of your country under the country number you added. You'll have to scroll down a fair amount to find them.
Adding said country to your game: Compile all the files into your APK. If replacing an existing country, simply changing the “country” byte of the “country” block to the ID you added (in my case, 50). Remember to convert this number to hex!
If you're adding, then edit the "main" block as shown below, and add a country "block" at the end of all the country blocks so you can designate your country.
A useful link here is the BTL guide so you'll know how to edit your country: european-war-4.boards.net/thread/9609/wc4-btl-guide
In conquest, also go to ConquerCountrySettings.json and copy-paste an existing line of code in whatever era you’re adding the country in, remembering to change the “CountryID” to a new value.
End result on the red hex (colours are added in-stage). I also included the Iranian flag which already exists in Vanilla for comparison.