City States Leaders

mihaifx

Warlord
Joined
Oct 1, 2010
Messages
169
Location
Romania
I made a small mod that displays leader icons in the city state screen. You can find it in the mod browser.

The mod is compatible with other mods that add city states (you will get the default image). I tested it with Opera's City States of the World and it works.
I'm amazed how easy this was.

Enjoy :)

Edit:
v2 - fixed missing textures
v3 - added leaders for Quebec and Sydney

How to add new city states with custom leaderheads based on this mod

Based on Kruelgor's request, here's a quick guide:

1. Add the files in this mod to your project (Add->Existing Item)
2. Add a new city state via XML:
Spoiler :

PHP:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
	<MinorCivilizations>
		<Row>
			<Type>MINOR_CIV_ANTANANARIVO</Type>
			<Description>Antananarivo</Description>
			<ShortDescription>Antananarivo</ShortDescription>
			<Adjective>Antananarivo</Adjective>
			<DefaultPlayerColor>PLAYERCOLOR_MINOR_MIDDLE_CYAN</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_MINOR</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_SOUTH_AMERICA</ArtStyleType>
			<MinorCivTrait>MINOR_TRAIT_MARITIME</MinorCivTrait>
		</Row>
	</MinorCivilizations>
	<MinorCivilization_CityNames>
		<Row>
			<MinorCivType>MINOR_CIV_ANTANANARIVO</MinorCivType>
			<CityName>Antananarivo</CityName>
		</Row>
	</MinorCivilization_CityNames>
	<MinorCivilization_Flavors>
		<!-- Antananarivo -->
		<Row>
			<MinorCivType>MINOR_CIV_ANTANANARIVO</MinorCivType>
			<FlavorType>FLAVOR_NAVAL</FlavorType>
			<Flavor>8</Flavor>
		</Row>
		<Row>
			<MinorCivType>MINOR_CIV_ANTANANARIVO</MinorCivType>
			<FlavorType>FLAVOR_GROWTH</FlavorType>
			<Flavor>10</Flavor>
		</Row>
		<Row>
			<MinorCivType>MINOR_CIV_ANTANANARIVO</MinorCivType>
			<FlavorType>FLAVOR_CITY_DEFENSE</FlavorType>
			<Flavor>10</Flavor>
		</Row>
	</MinorCivilization_Flavors>
</GameData>

3. Add an insert statement in LeaderIcons.sql, with city name, texture name and leader name:
Spoiler :
insert into MinorCivLeaders_mihaifx(MinorCivType, LeaderIcon, LeaderName) values('MINOR_CIV_ANTANANARIVO', 'antananarivo_leadericon.dds', 'Mighty Leader') ;

4. Edit the DDS texture file. You can use the template I posted (requires Paint.NET) or create a new one. If you do that make sure you keep the 420x200 size I defined in CityStateDiploPopup.xml (for Image ID="TitleIcon2"), otherwise it won't work. This is close to the maximum that the game allows (the engine seems to make a size check and if it's larger it won't get displayed).
 

Attachments

  • Civ5Screen001.jpg
    Civ5Screen001.jpg
    243.8 KB · Views: 2,185
  • Civ5Screen002.jpg
    Civ5Screen002.jpg
    238.6 KB · Views: 1,745
Great idea for a mod, I was finding city states too generic and impersonal. Maybe you could add individualised text for each city state. I'm getting quite bored of them all saying: "Ahhh good, its you again" etc...
 
Mihaifx,

I just played a game where the Geneva leader caused the screen to go black. I has to hit "ESC." The game was having a hard time loading that one leaderhead.
 
Mihaifx,

I just played a game where the Geneva leader caused the screen to go black. I has to hit "ESC." The game was having a hard time loading that one leaderhead.

That's strange...I'll check it out.

Great idea for a mod, I was finding city states too generic and impersonal. Maybe you could add individualised text for each city state. I'm getting quite bored of them all saying: "Ahhh good, its you again" etc...

Yes, I thought at that. I wanted to include a 'Welcome to' message in each leader's language. However the game has some problems with localized characters, maybe someone can help.

First of all, if you add localized characters in Mod Buddy via sql, they don't get inserted in the database (instead, the '?' character is added). I tried adding them in the DB via the firefox add on, and some of them get displayed in the game, others do not (for example &#538; &#537; &#273;)

It's a minor issue, but annoying enough to make me drop the whole thing.
 
IIRC, some CS are missing from the whole 28 defaults (Seoul, for one) & caused a popup flaw.

Also i wouldn't mind if the pictures could fit the exact size of the default banner/header orbs (those with category symbols only) while keeping the vanilla citystatepopuptop(100,200,300).dds concept intact except for a laurels overlay (and the tiny reference tags) such as what the Diplomacy panel shortcut_Icon uses.
 

Attachments

  • CityStatePopup_Test.png
    CityStatePopup_Test.png
    36 KB · Views: 480
I don't know what's the deal with the missing textures. They all work fine to me. Could be some conflict with other mods or unpacking error. You could try to manually delete the mod folder and reinstall the mod, maybe it solves it. Why does this game have to be so unstable... :(

@Zyxpsilon
I went for 'the bigger the better' approach (almost as large as the game allows it), but if anyone wants to pick this up and include it in other mods I can send the original pictures.
 
nice idea, and nice mod, but I've the same problem with textures missing.

in the "..\My Games\Sid Meier's Civilization 5\MODS\City States Leaders (v 1)\Resource\DX9\CityStateLeaders" folder, there are only 24 dds files. Monaco, Seoul and some others are missing, and those missing files are not listed in the file tag of City States Leaders (v 1).modinfo, are they listed in your modbuddy project ?

good job anyway, I hope you can fix it :D
 
Thanks for loooking into this, and you are right. The textures were missing. The issue was that when I tested the mod the textures were loaded from the game folder, even if I had them deeply buried into some subfolders I made inside.

It's good to know for future mods that if you throw some texures inside Resource\DX9 (even in random subfolders), they will get loaded by the game and you can refference them by their name.

I uploaded a fixed version.
 
thank you, using it right now ;)

another request if possible : could you post the template texture ?
 
Sure, here it is, together with the original pics. It's a Paint.NET one.
 

Attachments

  • template+pics.zip
    1.4 MB · Views: 285
Depending on which version(s) you have installed, some CS could be different... like Havana or Monaco, Warsaw or Budapest (etc) may not be "included" in your own defaults installation.
That's why Seoul or Monaco failed to load since the initial release of mihaifx had what was present on his setup.
As for "Bigger the better" approach, i'm not questioning your choices... all is nice. Although i'd have to adapt your mod with my own graphics; with the templates provided above it should be even easier to re-design the whole thing.
Thks.
 
Sure, here it is, together with the original pics. It's a Paint.NET one.

thanx :goodjob:


but it seems that you use the ID number to get the leaderIcon, multiple CS mods trying to use this feature may end with minor leaderheads shuffled...

as it's name didn't suggest, GetMinorCivType() return the minorciv ID, not the type :/
 
ok, for my personal use I've changed the function to find the icons by type instead of ID...

Spoiler :


here's the change if you want to use it :

original :

Spoiler :
Code:
	if (sMinorCivType ~= nil and 
		GameInfo.MinorCivLeaders_mihaifx[sMinorCivType] ~= nil) then
		print ("MinorCivtype = " .. sMinorCivType )
		leaderIcon = GameInfo.MinorCivLeaders_mihaifx[sMinorCivType].LeaderIcon;
		leaderName = GameInfo.MinorCivLeaders_mihaifx[sMinorCivType].LeaderName;
	end
modified :

Spoiler :
Code:
	if (sMinorCivType ~= nil) then
		local realMinorCivType = GameInfo.MinorCivilizations[sMinorCivType].Type
		if realMinorCivType ~= nil then
			local condition = "MinorCivType = '" .. realMinorCivType .. "'"
			for row in GameInfo.MinorCivLeaders_mihaifx(condition) do
				leaderIcon = row.LeaderIcon;
				leaderName = row.LeaderName;
			end
		end
	end

edit : if you use this, beware of Tyre and Sidon, their type are not :
MINOR_CIV_TYRE and MINOR_CIV_SIDON

but :
MINOR_SIDON and MINOR_TYRE

the SQL rule should be changed to reflect that strange naming from firaxis...
 
Good, 28 of them in the latest version... *BUT*;

-- Curacao, Turtle Island, Port Royal, Providence, Cartagena, Havana, Tortuga... are still missing.

Possibly cuz, the actual default sets vary from 1.0.0.20 & 1.0.0.621 versions of the game as installed through Steam. Heck, even the demo had different stuff.

Bad (or good) news also, some other mods are using plenty of these new CS for themselves... i guess if you truly want to make this mod compatible with everything out there, you'll have much'o work to do. ;)
 
Top Bottom