• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days (this includes any time you see the message "account suspended"). For more updates please see here.

Custom Civ Not Working Correctly

Aidence

The Archduke
Joined
Nov 23, 2013
Messages
224
So, my latest mod is working, though not in the way you would expect (or that I would like it to) and I need help to fix it. Here are the three problems I noticed in the Civilization Selection screen:

1) Leader Icon too big.

2) Civ Icon not showing up.

3) UU and UB not showing up.

4) Only other civs are Greece and Morocco.

How would I fix these bugs. I want to put this mod out as soon as possible. Please help
 

Attachments

Ok, first of all the building:

Code:
<Buildings>
		<Row>
			[COLOR="Red"]<Type>BUILDING_FORGE</Type>
			<BuildingClass>BUILDINGCLASS_HOOVERIAN_SMITHERY</BuildingClass>[/COLOR]
			<Cost>120</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_METAL_CASTING</PrereqTech>
			<FaithCost>240</FaithCost>
			<Description>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY</Description>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_HOOVERIAN_SMITHERY_TEXT</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY_STRATEGY</Strategy>
			<Help>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY_HELP</Help>
			[COLOR="red"]<ArtDefineTag>ART_DEF_BUILDING_HOOVERIAN_SMITHERY</ArtDefineTag>[/COLOR]
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>66</ConquestProb>
			<HurryCostModifier>25</HurryCostModifier>
			<IconAtlas>BW_ATLAS_1</IconAtlas>
			<PortraitIndex>2</PortraitIndex>
		</Row>
	</Buildings>

The Buildingclass should be BUILDINGCLASS_FORGE and the Type should be BUILDING_HOOVERIAN_SMITHERY
Also, do you have custom graphics for the Hooverian Smithery? Otherwise you probably need to change the ArtDefineTag to ART_DEF_BUILDING_FORGE

And now the unit. In Hooveria_CivInfo there's this line of code:

Code:
<Civilization_UnitClassOverrides>
		<Row>
			<CivilizationType>CIVILIZATION_HOOVERIA</CivilizationType>
			<UnitClassType>[COLOR="Red"]UNITCLASS_LONGSWORDSMEN[/COLOR]</UnitClassType>
			<UnitType>UNIT_ROYAL_HOOVERIAN_KNIGHT</UnitType>
		</Row>
	</Civilization_UnitClassOverrides>

I'm pretty sure it's UNITCLASS_LONGSWORDSMAN and not MEN :P

A Typo here (in Hooveria_Units):

Code:
<Row>
			<UnitType>UNIT_ROYAL_HOOVERIAN_KNIGHT</UnitType>
			<UnitAIType>UNITAI_[COLOR="Red"]DFENSE[/COLOR]</UnitAIType>
		</Row>

Also, I'm not sure if a 214 icon size is necessary. I have never used that size and encountered no problems so far.

Will edit if I see more problems. Hope this helped.
 
1) 256x256 does NOT mean the icon is that size - see http://forums.civfanatics.com/showthread.php?t=499400
2) No <IconAtlas> entry for the civ
3) Is due to errors in the xml
4) is a direct result of 3

Enable logging and check the logs!!!!!!!!!!!!!!!!!!!!
Code:
[12626.798] no such table: Unit_Promotions
[12626.798] In Query - insert into Unit_Promotions('Type', 'Description', 'Help', 'Sound', 'CannotBeChosen', 'PortraitIndex', 'IconAtlas', 'OutsideFriendlyLandsModifier', 'FriendlyLandsModifier', 'PediaType', 'PediaEntry') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
[12626.798] In XMLSerializer while updating table Unit_Promotions from file XML/Units/Hooveria_Units.xml.
[12634.676] Validating Foreign Key Constraints...
[12634.910] Invalid Reference on Buildings.Strategy - "TXT_KEY_BUILDING_HOOVERIAN_SMITHERY_STRATEGY" does not exist in Language_en_US
[12634.957] Invalid Reference on Buildings.Civilopedia - "TXT_KEY_CIV5_BUILDINGS_HOOVERIAN_SMITHERY_TEXT" does not exist in Language_en_US
[12635.222] Invalid Reference on Civilization_CityNames.CityName - "TXT_KEY_CITY_NAME_HOOVERIA_BICKFORD" does not exist in Language_en_US
[12635.222] Invalid Reference on Civilization_Religions.ReligionType - "RELIGION_CATHOLICISM" does not exist in Religions
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_0" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_1" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_2" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_3" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_4" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_5" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_6" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_7" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOLY_HOOVERIA_8" does not exist in Language_en_US
[12635.285] Invalid Reference on Civilization_SpyNames.SpyName - "TXT_KEY_SPY_NAME_HOOVERIA_9" does not exist in Language_en_US
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions
[12635.597] Invalid Reference on Trait_FreePromotionUnitCombats.PromotionType - "PROMOTION_ELITE" does not exist in UnitPromotions

Also, the leader scene should be VFS=true and not db activated (see File Attrs link in my sig)
 
Before you spend boatloads of time chasing the error wrt PROMOTION_ELITE, fix the typo in the <Unit_AITypes>. Sometimes the game will dump all of, or major chunks of, an xml file because of a typo. This leads you to believe you structured something wrong that's at the bottom of the file when the real problem is a goof much higher up in the file.
 
@Whoward I checked the logs and got nothing. And I did import the Leader scene to VFS. Do you mean the XML?

Also, I fixed these errors, and nothing different happened...
 
you don't have any of these anywhere in your civ

Code:
<PortraitIndex>0</PortraitIndex>
<IconAtlas>EXAMPLE_ATLAS</IconAtlas>
<AlphaIconAtlas>EXAMPLE_ALPHA_ATLAS</AlphaIconAtlas>

without these three commands the game knows neither which atlas to look for in <IconTextureAtlases> nor which little circle within your art files is the one you want to use for your in-game icon. I don't know what the difference is between <IconAtlas> and <AlphaIconAtlas> with respect to civs, but for all game elements that require icons (promotions, units, buildings, civs) you always need at least the <PortraitIndex> line and the <IconAtlas> line.

Note that a quick check of the Firaxis-created civs tells me that they all look to have the three commands I showed you.

These commands need to be added somewhere in:

Code:
	<Civilizations>
		<Row>
			<Type>CIVILIZATION_HOOVERIA</Type>
			<Description>TXT_KEY_HOOVERIA_DESC</Description>
			<ShortDescription>TXT_KEY_HOOVERIA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_HOOVERIA_ADJECTIVE</Adjective>
			<CivilopediaTag>TXT_KEY_CIVLOPEDIA_HOOVERIA</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_HOOVERIA</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_GERMANY</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN</ArtStylePrefix>
			<PortraitIndex>8</PortraitIndex>
			<MapImage>AoH_Map.dds</MapImage>
			<DawnOfManQuote>TXT_KEY_DAWN_OF_MAN_HOOVERIA_TEXT</DawnOfManQuote>
			<DawnOfManImage>AoH_DoM.dds</DawnOfManImage>
			<SoundtrackTag>Germany</SoundtrackTag>
		</Row>
	</Civilizations>

ok. sorry, you did have the PortraitIndex command.
 
I have those everywhere where they're supposed to be...
Spoiler :
Code:
<Civilizations>
<Row>
			<Type>CIVILIZATION_HOOVERIA</Type>
			<Description>TXT_KEY_HOOVERIA_DESC</Description>
		<ShortDescription>TXT_KEY_HOOVERIA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_HOOVERIA_ADJECTIVE</Adjective>
			<CivilopediaTag>TXT_KEY_CIVLOPEDIA_HOOVERIA</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_HOOVERIA</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_GERMANY</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN</ArtStylePrefix>
			[B]<PortraitIndex>8</PortraitIndex>[/B]
			<MapImage>AoH_Map.dds</MapImage>
<DawnOfManQuote>TXT_KEY_DAWN_OF_MAN_HOOVERIA_TEXT</DawnOfManQuote>
			<DawnOfManImage>AoH_DoM.dds</DawnOfManImage>
			<SoundtrackTag>Germany</SoundtrackTag>
		</Row>
<Civilizations>
-----------------------------------------------------------------------------------
<Units>
		<Row>
			<Class>UNITCLASS_LONGSWORDSMAN</Class>
			<Type>UNIT_ROYAL_HOOVERIAN_KNIGHT</Type>
			<PrereqTech>TECH_STEEL</PrereqTech>
			<Combat>24</Combat>
			<Cost>120</Cost>
			<FaithCost>240</FaithCost>
		<RequiresFaithPurchaseEnabled>true</RequiresFaithPurchaseEnabled>
			<Moves>2</Moves>
			<HurryCostModifier>20</HurryCostModifier>
			<CombatClass>UNITCOMBAT_MELEE</CombatClass>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
		<Description>TXT_KEY_UNIT_ROYAL_HOOVERIAN_KNIGHT</Description>
<Civilopedia>TXT_KEY_CIVILOPEDIA_UNITS_ROYAL_HOOVERIAN_KNIGHT_TEXT</Civilopedia>
			<Help>TXT_KEY_UNIT_ROYAL_HOOVERIAN_KNIGHT_HELP</Help>
			<MilitarySupport>true</MilitarySupport>
			<MilitaryProduction>true</MilitaryProduction>
			<Pillage>true</Pillage>
			<ObsoleteTech>TECH_GUNPOWDER</ObsoleteTech>
<GoodyHutUpgradeUnitClass>UNITCLASS_MUSKETMAN</GoodyHutUpgradeUnitClass>
			<AdvancedStartCost>20</AdvancedStartCost>
			<XPValueAttack>3</XPValueAttack>
			<XPValueDefense>3</XPValueDefense>
			<Conscription>3</Conscription>
			<UnitArtInfo>ART_DEF_UNIT_LONGSWORDSMAN</UnitArtInfo>
			<UnitFlagIconOffset>35</UnitFlagIconOffset>
			<IconAtlas>UNIT_ATLAS_1</IconAtlas>
			<PortraitIndex>36</PortraitIndex>
			<MoveRate>BIPED</MoveRate>
		</Row>
	</Units>
-----------------------------------------------------------------------------------
<Buildings>
		<Row>
			<Type>BUILDING_FORGE_HOOVERIAN_SMITHERY</Type>
			<BuildingClass>BUILDINGCLASS_FORGE</BuildingClass>
			<Cost>120</Cost>
			<GoldMaintenance>1</GoldMaintenance>
			<PrereqTech>TECH_METAL_CASTING</PrereqTech>
			<FaithCost>240</FaithCost>
<Description>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY</Description>
	<Civilopedia>TXT_KEY_CIV5_BUILDINGS_HOOVERIAN_SMITHERY_TEXT</Civilopedia>
<Strategy>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY_STRATEGY</Strategy>
			<Help>TXT_KEY_BUILDING_HOOVERIAN_SMITHERY_HELP</Help>
			<ArtDefineTag>ART_DEF_BUILDING_FORGE</ArtDefineTag>
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>66</ConquestProb>
			<HurryCostModifier>25</HurryCostModifier>
			<IconAtlas>BW_ATLAS_1</IconAtlas>
			<PortraitIndex>2</PortraitIndex>
		</Row>
	</Buildings>
 
I checked the logs and got nothing.

Then you need to double check that you have correctly enabled logging and that you are starting the mod correctly - as ALL the errors given above are in the database.log file and do relate to your mod
 
I have those everywhere where they're supposed to be...
Spoiler :
Code:
<Civilizations>
<Row>
			<Type>CIVILIZATION_HOOVERIA</Type>
			<Description>TXT_KEY_HOOVERIA_DESC</Description>
		<ShortDescription>TXT_KEY_HOOVERIA_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_HOOVERIA_ADJECTIVE</Adjective>
			<CivilopediaTag>TXT_KEY_CIVLOPEDIA_HOOVERIA</CivilopediaTag>
			<DefaultPlayerColor>PLAYERCOLOR_HOOVERIA</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_GERMANY</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<ArtStyleSuffix>_EURO</ArtStyleSuffix>
			<ArtStylePrefix>EUROPEAN</ArtStylePrefix>
			[B]<PortraitIndex>8</PortraitIndex>[/B]
			<MapImage>AoH_Map.dds</MapImage>
<DawnOfManQuote>TXT_KEY_DAWN_OF_MAN_HOOVERIA_TEXT</DawnOfManQuote>
			<DawnOfManImage>AoH_DoM.dds</DawnOfManImage>
			<SoundtrackTag>Germany</SoundtrackTag>
		</Row>
<Civilizations>

Look more closely at the code you just posted. <IconAtlas> and <AlphaIconAtlas> are nowhere within your <Civilizations> table. You have entries for such things as <ArtDefineTag>, <ArtStyleType>, <ArtStyleSuffix>, and <ArtStylePrefix> but you do not have
commands for <IconAtlas> and <AlphaIconAtlas>. You need these in addition to the <PortraitIndex> command to get everything to work correctly.

I deleted all the non-relevant tables from the code you posted in post #7, and am only showing the <Civilizations> table in my "quote" of your post #7. I think you might be making a basic mistake in thinking that since you have an <IconAtlas> command for a unit or a building that this will also "carry over" into your definition of the Civilization. This is not true. Each of these must have their own PortraitIndex and an IconAtlas command, even if they are sharing the same actual "something.dds" art files and the same Atlas definitions in the <IconTextureAtlases> table.

And files of "something.dds" always require that directly within ModBuddy (not within your xml) you need to right-click on the name of the file and pick "properties'. Then in the upper-right ModBuddy window you have to manually set "Import into VFS" to "true". This must be done in each and every "something.dds" file you add to your mod in ModBuddy. There is no way to get around this requirement. It has to be done.

----------
edit p.s. -- I made pretty much the same basic mistake back in the day. It didn't click in my head right away that you might be making the same sort of mistake.
 
You've defined PortraitIndex as 8 - in other words, you're telling the game to use the 9th icon in a specific file. Is this actually the case? Nope. According to the icon atlases you've defined in XML\Art\Atlases\IconAtlases.xml, the file the game is supposed to be using is 1 icon x 1 icon (and so contains only one icon, which is true of the referenced file - though as others have said, the icon is too big). PortraitIndex should be, therefore, set to 0.

Moving along...
Your trait in XML\Trait\Hooveria_Trait.xml references a promotion called "PROMOTION_ELITE_SOLDIERS". It doesn't exist. Did you mean PROMOTION_ELITE, which is the actual name you gave to a new promotion in XML\Units\Hooveria_Units.xml? ;)
 
1st off, I imported all of my .dds files into VFS already... I know I have to do this, which I have. 2nd. I added the

Code:
<IconAtlas>EXAMPLE_ATLAS</IconAtlas>
<AlphaIconAtlas>EXAMPLE_ALPHA_ATLAS</AlphaIconAtlas>

Require to make the icon work and now the mod doesn't work, and it says this in the logs:

[43325.252] no such table: Unit_Promotions
[43325.252] In Query - insert into Unit_Promotions('Type', 'Description', 'Help', 'Sound', 'CannotBeChosen', 'PortraitIndex', 'IconAtlas', 'OutsideFriendlyLandsModifier', 'FriendlyLandsModifier', 'PediaType', 'PediaEntry') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
[43325.252] In XMLSerializer while updating table Unit_Promotions from file XML/Units/Hooveria_Units.xml.
[43414.922]
Which it did not previously and I already have all of these lines. I am lost...
 
and now the mod doesn't work, and it says this in the logs:

[43325.252] no such table: Unit_Promotions

Which it did not previously

In which case the mod you have been changing on your own machine is NOT the one you attached to post #1 as that is exactly the same error I highlighted in post #3

The table is called UnitPromotions (no underscore)

I am lost...
You said it
 
I fixed that error, yet it still persists and says the Unit_Promotions error in the logging... Even though I fixed it! And that's still the only error in the logging. I am so lost as to how to fix this...
 
Okay, so I decide to remove the bugged code and replace it with the same thing, and now the bug persists yet there's nothing in the logs... =/ I need help.
 
Alright then...
Attach your most recently built version of the mod, your database and lua logs from the last time you playtested the most recently built version, and describe your exact problem in such extreme detail that it puts all your other descriptions to shame.

This is the problem, Aidence - you never give us enough information to work with.
 
My problem was that there was only the custom civ, Greece, and Morroco, the Uniques would not show up, the leader art was too big and the civ icon would not work, and there was no info as to how to fix it in the logs. Now my problem is that it won't work at all and there's no info as to how to fix it in the logs. I'll give you the requested files.
 

Attachments

As to why your art isn't showing up correctly, you still haven't fixed this:
eXJscUx.png

The icon should, according to the Icon and Screen Pixel Dimension Reference , be 172 pixels in diameter. Right now it's 256. Logically, if it was showing up correctly, then you would have a problem.

And your uniques aren't showing up because you haven't referenced them correctly.
You have this as the UB:
Code:
	<Civilization_BuildingClassOverrides>
		<Row>
			<CivilizationType>CIVILIZATION_HOOVERIA</CivilizationType>
			<BuildingClassType>BUILDINGCLASS_FORGE</BuildingClassType>
			<BuildingType>BUILDING_HOOVERIAN_SMITHERY</BuildingType>
		</Row>
	</Civilization_BuildingClassOverrides>
Which is all fine and dandy, but look at what you actually named your building:
Code:
<Type>BUILDING_FORGE_HOOVERIAN_SMITHERY</Type>
Copy and paste is your friend.
 
I fixed those errors but the mod still won't work, I activate it and no new civ and still nothing in the logs... =/
 
Ah. I apparently forgot to check the .modinfo file. You forgot to set an UpdateDatabase entry for the civilization itself.
 
Back
Top Bottom