1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

City States Leaders

Discussion in 'Civ5 - Mod Components' started by mihaifx, Nov 12, 2010.

  1. mihaifx

    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).
     

    Attached Files:

  2. Txurce

    Txurce Deity

    Joined:
    Jan 4, 2002
    Messages:
    8,274
    Location:
    Venice, California
    Thanks! These definitely personalize the game. Contact with the CS has felt very much like talking in the dark.
     
  3. Txurce

    Txurce Deity

    Joined:
    Jan 4, 2002
    Messages:
    8,274
    Location:
    Venice, California
    I couldn't find it in the mod browser under "City State Leaders."
     
  4. bobbyboy29

    bobbyboy29 I was saying boo-urns...

    Joined:
    Oct 14, 2008
    Messages:
    1,401
    Location:
    Melbourne, Australia
    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...
     
  5. Txurce

    Txurce Deity

    Joined:
    Jan 4, 2002
    Messages:
    8,274
    Location:
    Venice, California
    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.
     
  6. mihaifx

    mihaifx Warlord

    Joined:
    Oct 1, 2010
    Messages:
    169
    Location:
    Romania
    That's strange...I'll check it out.

    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.
     
  7. Zyxpsilon

    Zyxpsilon Running Spider

    Joined:
    Oct 29, 2009
    Messages:
    3,242
    Gender:
    Male
    Location:
    On Earth
    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.
     

    Attached Files:

  8. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,949
    Location:
    DE/NL/FR
    Simple idea, not game changing, but atmosphere enhancing...-> great idea :goodjob:.
     
  9. Describer

    Describer Chieftain

    Joined:
    Jan 13, 2008
    Messages:
    87
    Location:
    Ukraine
    Seoul doesnt work for me, it says "unable to load texrure". Others seem to be ok.
     
  10. mihaifx

    mihaifx Warlord

    Joined:
    Oct 1, 2010
    Messages:
    169
    Location:
    Romania
    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.
     
  11. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,723
    Location:
    France
    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
     
  12. mihaifx

    mihaifx Warlord

    Joined:
    Oct 1, 2010
    Messages:
    169
    Location:
    Romania
    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.
     
  13. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,723
    Location:
    France
    thank you, using it right now ;)

    another request if possible : could you post the template texture ?
     
  14. mihaifx

    mihaifx Warlord

    Joined:
    Oct 1, 2010
    Messages:
    169
    Location:
    Romania
    Sure, here it is, together with the original pics. It's a Paint.NET one.
     

    Attached Files:

  15. Kruelgor

    Kruelgor Emperor

    Joined:
    May 12, 2010
    Messages:
    1,165
    Location:
    The United States
    Can you make a tutorial on how someone would go about using your template to create their own unique city states with leaderheads?
     
  16. Zyxpsilon

    Zyxpsilon Running Spider

    Joined:
    Oct 29, 2009
    Messages:
    3,242
    Gender:
    Male
    Location:
    On Earth
    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.
     
  17. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,723
    Location:
    France
    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 :/
     
  18. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,723
    Location:
    France
    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...
     
  19. Zyxpsilon

    Zyxpsilon Running Spider

    Joined:
    Oct 29, 2009
    Messages:
    3,242
    Gender:
    Male
    Location:
    On Earth
    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. ;)
     
  20. Kruelgor

    Kruelgor Emperor

    Joined:
    May 12, 2010
    Messages:
    1,165
    Location:
    The United States
    One quick question, will this work in DX10 and 11 too? I see the leaderheads are placed in a DX9 folder.

    Also, please make a tutorial on we can create our own city state leaderheads.
     

Share This Page