Civilzation 5 Flags Revamped Mod - Help.

Mjalnar

Kitten Arsonist
Joined
May 19, 2014
Messages
45
Location
Venice, Serene Republic of Venice
Hi, I've created a series of updated symbols for every civilization, except a couple, which make them either more historically accurate, have colours more similar to their real colours, or have colours which avoid visually displeasing combinations, like Indonesia and the Aztecs with their orange and light blue, which always makes me feel a little ill.

I have all of these emblems created on a big icon atlas, along with emblem alphas, and a plan for the colours to be used on each civ, I just need a scripter to help me put this plan into action.
This would require one of two things:
1. Create a script which finds a Civ 5 Civ, changes their colours and changes their emblem, making it easy for me to edit and change for every civ, or
2. Receive the textures and alphas and script the mod.

If you'd like to see the emblems, here is the icon atlas:
Spoiler :
From left to right and top to bottom:
Line 1: Venice, Sweden, Spain, Siam, Russia, Rome, Polynesia, Poland
Line 2: Persia, Mongolia, Japan, Iroquis, Indonesia, India, Inca, Huns
Line 3: Greece, Germany, France, Ethiopia, England, Egypt, Denmark, China
Line 4: Carthage, Russia, Celts, Aztecs, Arabians, Austria, America
8GKFhaK.png
 
Make this in XML:

Code:
<Civilizations>
      <Update>
	   <Where Type="CIVILIZATION_CHINA"/>
	   <Set DefaultPlayerColor="MYNEWCOLOR" IconAtlas="MYNEWATLAS" PortraitIndex="NUMBER"/>
       </Update>
</Civilizations>


This is really simple, but boring because you will have to write this for every civ of which you have changed the icon.
 
So is the script for the entire mod just that repeated over and over?
Does the colour part change both colours? How do I select a colour for it?
Where do Emblem Alphas come into play?

Sorry for all the questions - I've never really scripted before for mods. I have a fairly decent understanding of C# and C++, but not of the languages used for Civ 5.
 
In this way you will define your new atlas, that contains all your new icons:

Code:
<IconTextureAtlases>
		<Row>
			<Atlas>MYNEWATLAS</Atlas>
			<IconSize>256</IconSize>
			<Filename>YOURFILE256.dds</Filename>
			<IconsPerRow>8</IconsPerRow>
			<IconsPerColumn>8</IconsPerColumn>
		</Row>
		<Row>
			 <Atlas>MYNEWATLAS</Atlas>
			 <IconSize>128</IconSize>
			 <Filename>YOURFILE128.dds</Filename>
 			 <IconsPerRow>8</IconsPerRow>
 			 <IconsPerColumn>8</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MYNEWATLAS</Atlas>
			<IconSize>80</IconSize>
			<Filename>YOURFILE80.dds</Filename>
			<IconsPerRow>8</IconsPerRow>
			<IconsPerColumn>8</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MYNEWATLAS</Atlas>
			<IconSize>64</IconSize>
			<Filename>YOURFILENAME64.dds</Filename>
			<IconsPerRow>8</IconsPerRow>
			<IconsPerColumn>8</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MYNEWATLAS</Atlas>
			<IconSize>45</IconSize>
			<Filename>YOURFILENAME45.dds</Filename>
			<IconsPerRow>8</IconsPerRow>
			<IconsPerColumn>8</IconsPerColumn>
		</Row>
		<Row>
			<Atlas>MYNEWATLAS</Atlas>
			<IconSize>32</IconSize>
			<Filename>YOURFILENAME32.dds</Filename>
			<IconsPerRow>8</IconsPerRow>
			<IconsPerColumn>8</IconsPerColumn>
		</Row>
   </IconTextureAtlases>

In this way you can define new PlayerColors

Code:
<PlayerColors>
	<Row>
		<Type>PLAYERCOLOR_MYNEWCOLOR</Type>
		<PrimaryColor>COLOR_PLAYER_DARK_YELLOW</PrimaryColor> 
		<SecondaryColor>COLOR_PLAYER_BLACK</SecondaryColor>
		<TextColor>COLOR_PLAYER_DARK_YELLOW_TEXT</TextColor>
	</Row>
</PlayerColors>


If you wanna create new colors, instead of using the defaults you will need to play with the RGB value:

Code:
<Colors>
     <Row>
          <Type>COLOR_NEWCOLOR</Type>
          <Red>1.000</Red>
          <Green>1.000</Green>
          <Blue>1.000</Blue>
          <Alpha>1.0</Alpha>
     </Row>
</Colors>

Since you're new to modding civ 5, looking for some introductory guide on the forum!!
 
Does all the code go in one .xml file? I've tried both separate and together, and neither made a difference to Arabia's emblem, and now the mod buddy thing says that my mod is unvailable and, with the following error message:

C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj : error : The project file could not be loaded. Could not find file 'C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj'. C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj

Even though it is there.
 
And I'm guessing I need to put the atlases in the same folder as the xml scripts?

Not necessary, it is to your liking. For example you can create a folder with the name that you wanna give to your mod and two subfolder: one for the Art files and a second for the XML files.

Does all the code go in one .xml file?

No, you're not forced to write everything in one file, but if you want you can.

C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj : error : The project file could not be loaded. Could not find file 'C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj'. C:\Users\User\Documents\Firaxis ModBuddy\Civ5Mod3\EmblemsRevamped.civ5proj

I dont know what you have done :S
 
The main problem is the fact that the mod didn't seem to do anything. I did it just for Arabia to test it.
1. I created a new mod called Revamped Emblems
2. I right clicked Civ5Mod4 and added a .xml file called EmblemScript.xml
3. I deleted all the things automatically in the file.
4. I put all the .dds atlas files inside Civ5Mod4
5. I put in the following script:
Code:
<IconTextureAtlases>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>256</IconSize>
		<Filename>EmblemAtlas256.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>128</IconSize>
		<Filename>EmblemAtlas128.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>80</IconSize>
		<Filename>EmblemAtlas80.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>64</IconSize>
		<Filename>EmblemAtlas64.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>45</IconSize>
		<Filename>EmblemAtlas45.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>32</IconSize>
		<Filename>EmblemAtlas32.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
</IconTextureAtlases>
<PlayerColors>
	<Row>
		<Type>PLAYERCOLOR_NEWARABIA</Type>
		<PrimaryColor>COLOR_PLAYER_GREEN</PrimaryColor>
		<SecondaryColor>COLOR_PLAYER_YELLOW</SecondaryColor>
		<TextColor>COLOR_PLAYER_YELLOW_TEXT</TextColor>
	</Row>
</PlayerColors>
<Civilizations>
	<Update>
		<Where Type="CIVILIZATION_ARABIA"/>
		<Set DefaultPlayerColor="NEWARABIA" IconAtlas="REVAMPEDEMBLEMS" PortraitIndex="29"/>
	</Update>
</Civilizations>
6. I debugged it.
7. I right clicked Civ5Mod4 and clicked Properties.
8. I went to actions and made a new one:
Event: OnModActivated
Action: UpdateDatabase
File: EmblemScript.xml
9. I clicked Build and Saved All
10. I looked at the folder, and saw that it had created a new folder with the more recent files in, so I deleted the folder and replaced the files in the main Civ5Mod4 folder with the new ones.
11. I launched Civ 5 and turned on the mod.
12. Nothing was different.
 
You also have to select all of your atlas texture files, right-click, choose Properties, then set "Add to VFS" to True.

That error message re: a missing "EmblemsRevamped.civ5proj" file means you manually deleted or renamed a crucial file in the project folder. Since it's not very involved, I recommend just deleting your mod and starting again. You shouldn't need to do any manual copying as you described in Step 10. When you build the mod, it will update the copy of the mod in the Build folder, make a .civ5proj in the Packages folder for uploading to steam, and copy the mod to your user Mods folder.

If it doesn't work this time, we can troubleshoot more easily if you attach the .civ5proj file or zip up the copy in your Mods folder and attach it to your post.
 
Step 9. After clicking on 'Build NameOfYourMod', wait for it to finish building the mod.

Lower left ModBuddy window will say 'build succeeded' or something very close to that (I can't remember the exact phrasing off the top of my head).

Before doing anything else go back to the 'Build' drop-down menu and click 'Build Solution'. The solution is a necessary file for reloading the mod later on.

For example, if you've created a series of other mods afterward, the name of your original mod may drop off the short-list that comes up when you open ModBuddy. In order to load a mod that isn't on the short-list, you'll be looking for a solution file in an older mod. But if you never built a solution file, you will never be able to find it to re-load an older mod.
 
Nutty, when I right click the icon atlases, and open properties, I don't get the option to "Add to VFS". Should it be visible inside the Modd Buddy? I can't see it, I was trying to do it via the folder.

LeeS, I was originally only building solution. I tried doing what you said, but still no change, but this time I did get an error, saying
XML document cannot contain multiple root level elements.
And points me to where, in the code I pasted earlier, <PlayerColors>

Here's the mod folder: View attachment Civ5Mod4.zip
 
The error you are getting is because no <GameData> -- </GameData> wraps around your code. <GameData> is one of the acceptable "root level elements" the message is referring to, but the other tables are not. They must be encapsulated by <GameData>.

Spoiler :
Code:
[COLOR="red"]<GameData>[/COLOR]
<IconTextureAtlases>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>256</IconSize>
		<Filename>EmblemAtlas256.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>128</IconSize>
		<Filename>EmblemAtlas128.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>80</IconSize>
		<Filename>EmblemAtlas80.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>64</IconSize>
		<Filename>EmblemAtlas64.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>45</IconSize>
		<Filename>EmblemAtlas45.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
	<Row>
		<Atlas>REVAMPEDEMBLEMS</Atlas>
		<IconSize>32</IconSize>
		<Filename>EmblemAtlas32.dds</Filename>
		<IconsPerRow>8</IconsPerRow>
		<IconsPerColumn>8</IconsPerColumn>
	</Row>
</IconTextureAtlases>
<PlayerColors>
	<Row>
		<Type>PLAYERCOLOR_NEWARABIA</Type>
		<PrimaryColor>COLOR_PLAYER_GREEN</PrimaryColor>
		<SecondaryColor>COLOR_PLAYER_YELLOW</SecondaryColor>
		<TextColor>COLOR_PLAYER_YELLOW_TEXT</TextColor>
	</Row>
	<Row>
		<Type>PLAYERCOLOR_NEWRUSSIA</Type>
		<PrimaryColor>COLOR_PLAYER_DARK_BLUE</PrimaryColor>
		<SecondaryColor>COLOR_PLAYER_YELLOW</SecondaryColor>
		<TextColor>COLOR_PLAYER_YELLOW_TEXT</TextColor>
	</Row>
</PlayerColors>
<Civilizations>
	<Update>
		<Where Type="CIVILIZATION_ARABIA"/>
		<Set DefaultPlayerColor="PLAYERCOLOR_NEWARABIA" IconAtlas="REVAMPEDEMBLEMS" PortraitIndex="29"/>
	</Update>
	<Update>
		<Where Type="CIVILIZATION_RUSSIA"/>
		<Set DefaultPlayerColor="PLAYERCOLOR_NEWARUSSIA" IconAtlas="REVAMPEDEMBLEMS" PortraitIndex="5"/>
	</Update>
</Civilizations>
[COLOR="Red"]</GameData>[/COLOR]

Second, you aren't actually adding your art files to the mod. They've merely been pasted into the ModBuddy folder
Code:
C:.......\Firaxis ModBuddy\Civ5Mod4\Civ5Mod4

This is what you are getting in the 'Built' version of the mod under the Build Folder and the in there the file "Revamped Emblems (v 1).modinfo". The "xxx.modinfo" is the file that tells the game what to do with a particular mod, and what files are a part of it.
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="56669ac6-0da6-4b47-bc52-3b5a29c585e7" version="1">
  <Properties>
    <Name>Revamped Emblems</Name>
    <Stability>Alpha</Stability>
    <Teaser>A change to Civ 5 Emblemology</Teaser>
    <Description>A change to Civ 5 Emblemology</Description>
    <Authors>Matty</Authors>
    <HideSetupGame>0</HideSetupGame>
    <AffectsSavedGames>1</AffectsSavedGames>
    <MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
    <SupportsSinglePlayer>1</SupportsSinglePlayer>
    <SupportsMultiplayer>1</SupportsMultiplayer>
    <SupportsHotSeat>1</SupportsHotSeat>
    <SupportsMac>1</SupportsMac>
    <ReloadAudioSystem>0</ReloadAudioSystem>
    <ReloadLandmarkSystem>0</ReloadLandmarkSystem>
    <ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
    <ReloadUnitSystem>0</ReloadUnitSystem>
  </Properties>
  <Dependencies />
  <References />
  <Blocks />
  <Files>
    <File md5="725A7795AF79818451186DD7128F8DBA" import="0">EmblemScript.xml</File>
  </Files>
  <Actions>
    <OnModActivated>
      <UpdateDatabase>EmblemScript.xml</UpdateDatabase>
    </OnModActivated>
  </Actions>
</Mod>
You need to right-click on Civ5Mod4 after you open the mod in ModBuddy, then select Add, then Existing Item. You then need to navigate to where the art files are located and select them. Note that you can use the method of selecting the first of the art files and then Holding 'SHIFT' to select the last of the files, and this will select all the files in-between. Then click the Add button in the lower portion of the pop-up dialog. This actually adds your art files as a part of the mod. You then need to select all the art files and right-click for Properties, and set VFS=true.

I just did all that and built the mod. In-game everything works just fine. The Icons for the two civs you've coded in look great.

The other thing I would suggest in future is when you start a new empty mod, don't let it use the default name of Civ5Mod4, etc. Actually give the mod a file name as close to the actual Mod name you intend to use as is possible. So, if I want my mod to have a name like Civ-Appropriate Great General Names I will name the file-name fields at the bottom of the first ModBuddy dialog box the exact same name of Civ-Appropriate Great General Names. So long as this name for the ModBuddy Project, Solution, Modinfo files isn't refused because it's too long I keep the names all the same. When the second diaolog comes up I also enter Civ-Appropriate Great General Names for the title, which is actually what shows in the game, and what will show in the 'Build' sub-folders after I do the 'Build' and 'Build Solution' for my mod. When I accept all that I will have a 'root' folder in ModBuddy called Civ-Appropriate Great General Names, and a subfolder under that called Civ-Appropriate Great General Names. This sub-folder is where all the files I 'Add' to the mod thru ModBuddy will be located. (I will sometimes create additional subfolders under this one for ART or SQL or LUA, but I do so only through ModBUddy). I never paste any files or additional sub-subfolders into this main subfolder using a browser. I only ever add files to this main sub-folder using the ModBuddy 'Add'. This makes it many times easier for me to understand at a glance which files I've correctly added through ModBuddy, and which I have not.
 
Thanks so much! Now the mod works it's great, the main hard part is done
Now I've got a new problem, though.

There's a big black square around the new emblems. How do I get rid of this? I can't save .dds files with transparent backgrounds...
 
Sorry. I fixed the original bug I posted here. Just a memory problem, restarted mod buddy and it was fine.

Original error message was something about 7zip compression failing to operate.

But I still need help with the black box problem - how do I make it like the normal civ emblems?
 
Sorry. I fixed the original bug I posted here. Just a memory problem, restarted mod buddy and it was fine.

Original error message was something about 7zip compression failing to operate.

But I still need help with the black box problem - how do I make it like the normal civ emblems?
I have no idea what's going on there but I also notice the active unit box on the lower left is also gone when running your mod, and the city banner is all a confusion, though this last one might be coming from a conflict between your mod and the improved city banner mod I had running. Unfortunately I know nothing about creating artwork files or background layers, or what else you might have done wrong in your player color tables. I understand what those types of tables are for, I just have no understanding of how to correctly use them.

The previous test I didn't go any farther than seeing that the icons were showing in the set-up game menu. Sorry I can't be of any help on these new issues.
 
Back
Top Bottom