Custom Civ not showing on leader screen.

Countbuffalo

Chieftain
Joined
Aug 16, 2013
Messages
94
Hi, I've been making a custom Civ for a bit now, and I've come upon a problem where the mod will load but the Civ doesn't actually show in the game setup screen, are there any possible known reasons for this? Or should I attach my Mod?
 
Did you tick your mod on the mod screen? i know its a dumb question.

attach it if you did.
 
I ticked it, I'm clueless but not that clueless :lol:

I'll attach the mod, it might be a nightmare of coding but I'm aiming for something that works first. If you, or anyone else could take a look, I'd be grateful.
 

Attachments

  • Hitusgi no Chaika - Chaika (v 2).civ5mod
    750 KB · Views: 37
First off, LeeS has created this excellent guide for common mistakes.

Next, you have this in the Civilization file:

Code:
<GameData>
	<GameData>
		<Civilizations>

The double <GameData> elements will cause the game to discard the whole file. There is a similar error in the Mage file:

Code:
<GameData>
	<GameData>
            <Units>
			-<Row>
				<Row>

With the units, are you intending them to replace a standard unit, like the Musketman or the Bomber? If so, you would use the same <Class> as the standard unit, and this entry in the Civilization file assigns it to your civ:

Code:
<Civilization_UnitClassOverrides>

So, the start of your UniqueunitMage file would be:

Code:
<GameData>
    <Units>
        <Row>
		<Class>UNITCLASS_MUSKETMAN</Class>
		<Type>UNIT_MAGE</Type>
Make sure you change the entry in the NeoGazCiv file to match the change in UnitClass.

For the Flying Fortress, if you really want it to be a unique UnitClass, you will have to define the UnitClass first:

Spoiler :
Code:
<UnitClasses>
		<Row>
			<Type>UNITCLASS_FLYING_FORTRESS</Type>
			<Description>TXT_KEY_UNIT_FLYING_FORTRESS</Description>
			<DefaultUnit>NONE</DefaultUnit>
		</Row>
</UnitClasses>

You could follow a similar process to create a unique building class for your dummy building:

Spoiler :
Code:
<BuildingClasses>
		<Row>
			<Type>BUILDINGCLASS_MAGICAL_FUEL</Type>
			<DefaultBuilding>BUILDING_MAGICAL_FUEL</DefaultBuilding>
			<Description>TXT_KEY_BUILDING_MAGICAL_FUEL</Description>
                        [COLOR="Red"]<NoLimit>true<NoLimit>[/COLOR]
		</Row>
</BuildingClasses>

Note that the <NoLimit> line will be important to add more than 1 to your capitol.

No promises I didn't miss something :) Best of luck
 
Thanks for the help! I've done all your fixes but I must have really messed up, as it still doesn't work.

Does this:
<UnitClasses>
<Row>
<Type>UNITCLASS_FLYING_FORTRESS</Type>
<Description>TXT_KEY_UNIT_FLYING_FORTRESS</Description>
<DefaultUnit>NONE</DefaultUnit>
</Row>
</UnitClasses>
Go in the UniqueUnit.XML or the Civ.XML?

Also, under the Unique Units there is a <IconAtlas> Command, do I use the name of my Icon Atlas for this? Since the mods I was looking at would have me use:
UNIT_FLYING_FORTRESS_FLAG_ATLAS
 
Thanks for the help! I've done all your fixes but I must have really messed up, as it still doesn't work.

Does this:

Go in the UniqueUnit.XML or the Civ.XML?
Doesn't matter. You place it where it is more logical to you to more easily find it later. So long as the file has <GameData> at the top and
</GameData> at the bottom of the code, it does not matter what "sort" of XML is included therein: it can be code about units, or about civs, or about policies, or about buildings, or all of these mashed-together within the same file. How and where you put things within your mod's XML files is really about what is easiest for you to understand.
 
Here's one I didn't notice before: The Trait file is missing the table identifier:

Code:
<Row>
    <Type>TRAIT_MAGICAL_FUEL</Type>
    <Description>TXT_KEY_TRAIT_MAGICALFUEL</Description>
    <ShortDescription>TXT_KEY_TRAIT_CULTURE_FROM_KILLS_SHORT</ShortDescription>
    <ScienceFromKills>100</ScienceFromKills>
</Row>

It should be:

Code:
[COLOR="Red"]<Traits>[/COLOR]
    <Row>
        <Type>TRAIT_MAGICAL_FUEL</Type>
        <Description>[COLOR="Blue"]TXT_KEY_TRAIT_MAGICALFUEL[/COLOR]</Description>
        <ShortDescription>[COLOR="blue"]TXT_KEY_TRAIT_CULTURE_FROM_KILLS_SHORT[/COLOR]</ShortDescription>
        [COLOR="Magenta"]<ScienceFromKills>100</ScienceFromKills>[/COLOR]
    </Row>
[COLOR="red"]</Traits>[/COLOR]

Also, note the mismatch of TXT_KEY description entries. And, unless I'm missing something, there isn't a line for <ScienceFromKills>. This will cause the file to be discarded. It's a common mistake to try to substitute one yield for another in these types of entries, but the game doesn't work that way.

EDIT: Your IconAtlas file also has a duplicate entry:

Spoiler :
Code:
<Row>
				<Atlas>CIV_COLOR_ATLAS_CHAIKA</Atlas>
				<IconSize>80</IconSize>
				<Filename>CivAsari80.dds</Filename>
				<IconsPerRow>4</IconsPerRow>
				<IconsPerColumn>1</IconsPerColumn>
			</Row>
<Row>
				<Atlas>CIV_COLOR_ATLAS_CHAIKA</Atlas>
				<IconSize>80</IconSize>
				<Filename>ChaikaAtlas80.dds</Filename>
				<IconsPerRow>4</IconsPerRow>
				<IconsPerColumn>1</IconsPerColumn>
			</Row>

This link will tell you more about needed sizes.
 
The Icon atlas issue will be as a result of using other formats to make it easier.

The Trait issue I can't find, so I might have already fixed it. Though, it has just made me aware of another issue I have.
 
The Icon atlas issue will be as a result of using other formats to make it easier.

The Trait issue I can't find, so I might have already fixed it. Though, it has just made me aware of another issue I have.

Here's the most recent one with all the current fixes, still not working :sad:

I guess starting again from scratch would probably be a pretty drastic fix, but we'll see.
 

Attachments

  • Hitusgi no Chaika - Chaika (v 3).civ5mod
    750.1 KB · Views: 33
This link will explain enabling logging, the modder's best friend in troubleshooting: http://forums.civfanatics.com/showthread.php?t=487482

In getting the UnitClass set up, you "nested" 2 tables in side each other:

Spoiler :
Code:
[COLOR="Blue"]<UnitClasses>
		<Row>
			<Type>UNITCLASS_FLYING_FORTRESS</Type>
			<Description>TXT_KEY_UNIT_FLYING_FORTRESS</Description>
			<DefaultUnit>NONE</DefaultUnit>
		</Row>[/COLOR]
		[COLOR="Red"]<BuildingClasses>
			<Row>
				<Type>BUILDINGCLASS_MAGICAL_FUEL</Type>
				<DefaultBuilding>BUILDING_MAGICAL_FUEL</DefaultBuilding>
				<Description>TXT_KEY_BUILDING_MAGICAL_FUEL</Description>
				<NoLimit>true</NoLimit>
			</Row>
		</BuildingClasses>[/COLOR]
	[COLOR="blue"]</UnitClasses>[/COLOR]

No time right now to do a deeper check, sorry.

EDIT: The Chaiga_Scene file is an anomaly; it does not use <GameData> tags, just the "stuff" in between and nothing else.
 
Alright, thanks for the help! It now sort of works, sort of (You can pick the Civ, but the trait isn't working,the name is () and information is just a placeholder of text, but I'll see what I can do) I should have thought of enabling logging from the start.

Results for my XML error log are
[26509.218] Missing Entry for UNIT_FLYING_FORTRESS
[26509.218] Missing Entry for UNIT_MAGE

I'm going to work my way through all the logs and report back when it's done.
Also under the Database error log is
[29625.338] Invalid Reference on Leader_Traits.TraitType - "TRAIT_MAGICAL_FUEL" does not exist in Traits - I tried putting all the information for my Trait into the leader.xml file but this just results in the Civ not appearing again.

In addition, does the Flying Fortress still need to have an entry in </Civilization_UnitClassOverrides> If it is it's own unit class?
 
Another instance of nested tables:

Spoiler :
Code:
<GameData>
	[COLOR="red"]<Traits>[/COLOR]
		[COLOR="Blue"]<Language_en_US>[/COLOR]
			<Row>
				<Type>TRAIT_MAGICAL_FUEL</Type>
				<Description>TXT_KEY_TRAIT_MAGICAL_FUEL</Description>
				<ShortDescription>TXT_KEY_TRAIT_MAGICAL_FUEL_SHORT</ShortDescription>
				
			</Row>
			<Row Tag="TXT_KEY_TRAIT_MAGICAL_FUEL">
				<Text>Every city held increases great scientist generation by 3 points in the capital.</Text>
			</Row>
			<Row Tag="TXT_KEY_TRAIT_MAGICAL_FUEL">
				<Text>Magical Fuel</Text>
			</Row>
			<Row Tag="TXT_KEY_TRAIT_MAGICAL_FUEL_SHORT">
				<Text>Magical Fuel</Text>
			</Row>
		[COLOR="blue"]</Language_en_US>[/COLOR]
	[COLOR="Red"]</Traits>[/COLOR]

	</GameData>

You're getting close!

EDIT: I believe the Lua file does not need to be imported into VFS=true, since it's not a repalcement of an existing game file. I'm not the Lua expert, though.
 
In addition, does the Flying Fortress still need to have an entry in </Civilization_UnitClassOverrides> If it is it's own unit class?
If all civilizations, inlcuding Barbarians and City-States are able to use the unit, then there's no need for a <Civilization_UnitClassOverrides>.

If you want to lock barbarians from building any unit from within a unit-class, this is an example of how it is done for the Scout class of unit:
Code:
<GameData>
	<Civilization_UnitClassOverrides>
		<Row>
			<CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
			<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
			<UnitType/>
		</Row>
	</Civilization_UnitClassOverrides>
</GameData>
To lock City-States from building a Scout, you would use:
Code:
<GameData>
	<Civilization_UnitClassOverrides>
		<Row>
			<CivilizationType>CIVILIZATION_MINOR</CivilizationType>
			<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
			<UnitType/>
		</Row>
	</Civilization_UnitClassOverrides>
</GameData>
To lock out both, you would use:
Code:
<GameData>
	<Civilization_UnitClassOverrides>
		<Row>
			<CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
			<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
			<UnitType/>
		</Row>
		<Row>
			<CivilizationType>CIVILIZATION_MINOR</CivilizationType>
			<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
			<UnitType/>
		</Row>
	</Civilization_UnitClassOverrides>
</GameData>

-------------------------------------------------------------------------------------------------------------------------------------

and as Calcul8or noted, you don't want Trait/TraitScript.lua set as "true" for the Import Into VFS, you just need the InGameUIAddin as you have it set up.
 
Can the XML find values across documents? Am I better off putting all the information in my trait.xml file in my civ or leader.xml files? Since I'm getting that "TRAIT_MAGICAL_FUEL" does not exist in Traits, Is it looking in the default game? Is there a way to prioritise what is loaded first within a mod?
 
Can the XML find values across documents? Am I better off putting all the information in my trait.xml file in my civ or leader.xml files? Since I'm getting that "TRAIT_MAGICAL_FUEL" does not exist in Traits, Is it looking in the default game? Is there a way to prioritise what is loaded first within a mod?

There is nothing wrong with the way your files are set up, as long as you've made the changes in my last post to your traits.xml file.
 
Yeah, that's done.

Sorry to be such a bother, but I'm still getting several problems in the logs.
[37376.279] Invalid Reference on Leader_Traits.TraitType - "TRAIT_MAGICAL_FUEL" does not exist in Traits
[37378.635] Missing Entry for UNIT_FLYING_FORTRESS
[37378.635] Missing Entry for UNIT_MAGE

I'll attach what my Leader Screen now looks like following the work you've been doing.

My icons are WIP.
 

Attachments

  • 2015-03-21_00001.jpg
    2015-03-21_00001.jpg
    300.5 KB · Views: 130
Oops, didn't notice before that there is an error in the text part of the trait file. You have:

Code:
<Row Tag="[COLOR="Blue"]TXT_KEY_TRAIT_MAGICAL_FUEL[/COLOR]">
    <Text>Every city held increases great scientist generation by 3 points in the capital.</Text>
</Row>
<Row Tag="[COLOR="blue"]TXT_KEY_TRAIT_MAGICAL_FUEL[/COLOR]">
    <Text>Magical Fuel</Text>
</Row>
The blue parts are the duplicates, meaning the game drops the whole file. The second one can be deleted.
 
I might try using another civ's trait temporarily and see how that turns out, I still need to fix the problem with my Unique units though.

Edit - Latest version has no trait issues! Hurrah! You've done it!

Everything is working except for the Unique Unit Icons, I'll look into them and why they're not working, thanks for all your help, it's now a functioning mod!

Thanks again!
 
Latest version has no trait issues! Hurrah!

Yay! Isn't it satisfying when everything shows up?

Units need 2 icon references. One for the icon, and one for the little flag above the unit in game. They are defined with lines in the <Units> table and refer to the Icon Atlas(es) that contain the art.

Code:
<Units>
    <Row>
		<Class>UNITCLASS_FLYING_FORTRESS</Class>
		<Type>UNIT_FLYING_FORTRESS</Type>
		.
                .		
		.
		[COLOR="Red"]<UnitFlagAtlas> [I]atlas name here[/I] </UnitFlagAtlas>[/COLOR]
                <UnitFlagIconOffset>37</UnitFlagIconOffset>
		<IconAtlas>UNIT_FLYING_FORTRESS_FLAG_ATLAS</IconAtlas>
		<PortraitIndex>3</PortraitIndex>
	</Row>	
</Units>

Make sure you have the correct icon sizes as defined in this post. If I remember correctly, you were missing some sizes.

If you want to use flags from the base game for the time being, the Vanilla flag atlas is UNIT_FLAG_ATLAS, and you could choose, say, the Musketman flag for the mage. The code would be:

Code:
<UnitFlagAtlas>UNIT_FLAG_ATLAS</UnitFlagAtlas>
<UnitFlagIconOffset>37</UnitFlagIconOffset>

You could use the Steampunk flag for the Flying Fortress :

Code:
<UnitFlagIconOffset>8</UnitFlagIconOffset
<UnitFlagAtlas>EXPANSION_SCEN_UNIT_FLAG_ATLAS</UnitFlagAtlas>
 
That's helpful, thank you. I'm going to need to look into the issue of why instead of my dummy building I'm getting floating gardens, which is an interesting bug to say the least.
 
Top Bottom