Mod UB does not show up

Silvermyr

Chieftain
Joined
May 15, 2019
Messages
22
I have been working with a mod for a while now, and for whatever reason the unique building does not seem to work, as it does not show up on the civilization selection screen. Any help would be appreciated.
 

Attachments

  1. Enable error logging: whoward69's enable error logging tutorial
    • You file "Sanctuary.xml" should be throwing a fatal error message into database log because of the syntax error contained within it.
  2. You have multiple incorrect usages for your xml files' activation methods: whoward69's what ModBuddy setting for what file types tutorial
    • No single xml file should be both set as Import Into VFS = true and <OnModActivated> -- <UpdateDatabase>. It should always be one or the other.
This portion of the "Sanctuary.xml" file is no good:
Code:
	-<Building_ResourceYieldChanges>
		-<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_FUR</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>2</Yield>
		</Row>

		-<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_IVORY</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>3</Yield>
		</Row>
		
		-<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_TRUFFLES</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>4</Yield>
		</Row>
		-<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_DEER</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>1</Yield>
		</Row>
		-</Building_ResourceYieldChanges>
No single row within any table can have the same column-name presented more than once. This error is fatal to the entire contents of the file: the game simply ignores everything contained within an xml file with this sort of error.

The correct code would be:
Code:
	<Building_ResourceYieldChanges>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_FUR</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_FUR</ResourceType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>2</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_IVORY</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>3</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_TRUFFLES</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_TRUFFLES</ResourceType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>4</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_DEER</ResourceType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_FOREST_GARDEN</BuildingType>
			<ResourceType>RESOURCE_DEER</ResourceType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>1</Yield>
		</Row>
	</Building_ResourceYieldChanges>
-----------------------------------------

These text characters will likely not be rendered correctly by the game when running under the English Language:
Code:
(skriv på här)
 
Last edited:
Thank you ever so much. I think I have fixed the UB,but things still does not work entirely since the mod does not show up in the menu. I enabled logging like you suggested, and from what I understand the issue is in the following log:

[3928.359] table Trait_FreePromotionUnitCombats has no column named CombatClass
[3928.359] In Query - insert into Trait_FreePromotionUnitCombats('TraitType', 'CombatClass', 'PromotionType') values (?, ?, ?);
[3928.359] In XMLSerializer while updating table Trait_FreePromotionUnitCombats from file XML/Fluttershy.xml.

So if I understand this right the problem is in the trait. I tried to follow the advice and rewrote the trait, but nothing changed. I now have all three of "('TraitType', 'CombatClass', 'PromotionType')", so I am at a loss for what I am missing here. Values, maybe, but what does that mean, exactly?

Thankful for any and all advice.
 

Attachments

The definition of the table (from the top of the game's CIV5Traits.xml file within the BNW expansion folder):
Code:
	<Table name="Trait_FreePromotionUnitCombats">
		<Column name="TraitType" type="text" reference="Traits(Type)"/>
		<Column name="UnitCombatType" type="text" reference="UnitCombatInfos(Type)"/>
		<Column name="PromotionType" type="text" reference="UnitPromotions(Type)"/>
	</Table>
As the message in Database log says, there is no column within the table called CombatClass. The correct name of the column is UnitCombatType. Your column-name is incorrect (and causes the game also to reject the entire "Fluttershy.xml" file) but the data such as UNITCOMBAT_MELEE is the correct type of data. You need to edit your file to use the correct column-name everywhere within table Trait_FreePromotionUnitCombats.
 
TradeMissionInfluenceModifier is an effect used by the Merchant of Venice to increase by 100% the amount of influence conducting a Great Merchant Trade Mission will garner for the player. Hence the code for the Merchant of Venice's promotion:
Code:
		<Row>
			<Type>PROMOTION_TRADE_MISSION_BONUS</Type>
			<Description>TXT_KEY_PROMOTION_TRADE_MISSION_BONUS</Description>
			<Help>TXT_KEY_PROMOTION_TRADE_MISSION_BONUS_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<PortraitIndex>8</PortraitIndex>
			<IconAtlas>EXPANSION2_PROMOTION_ATLAS</IconAtlas>
			<PediaType>PEDIA_ATTRIBUTES</PediaType>
			<PediaEntry>TXT_KEY_PROMOTION_TRADE_MISSION_BONUS</PediaEntry>
			<CannotBeChosen>true</CannotBeChosen>
			<TradeMissionInfluenceModifier>100</TradeMissionInfluenceModifier>
			<TradeMissionGoldModifier>100</TradeMissionGoldModifier>
			<ExtraNavalMovement>2</ExtraNavalMovement>
		</Row>
You are not only using a negative value but also assigning a promotion-effect no combat unit would be able to employ.
 
The game's BNW expansion files can be found at (assuming Win8.1)

C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML​

The game's xml files include the defintions of what is allowed within various game-tables that are related to the things being added within a particular group of files. In the folder C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML\Buildings the file named CIV5Buildings.xml contains all the definitions of the various valid Buildings tables, and what column-names are used, and what the data within these various columns must refer back to.

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

You never ever include these definitions within any file of any of your mods. You just need to know where to look to find the definitions of the various tables and what they require/allow. See also my Common Novice-Modder Mistakes thread linked in my signature. Specifically this segment: https://forums.civfanatics.com/thre...-mistakes.541578/#IncorrectlyUsingColumnNames

Unfortunately when the forum was updated to a new software a couple of years ago, the formatting in much of that tutorial was eaten by Pixies, as well as it seems some portions of the discussion topics.
 
Last edited:
Back
Top Bottom