Inconsistant effect of data modding...

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
I've noticed some bizzare behavior when modding data files. In the CIV5Buildings.xml file, cost and happiness fields update perfectly, but updates to yield and worker speed have no effect ingame. Why is this?

Code:
    <Buildings>
        <Update>
            <Where Type="BUILDING_MACHU_PICHU" />
            <Set Cost="550" />
        </Update>
    </Buildings>
    <Buildings>
        <Update>
            <Where Type="BUILDING_NOTRE_DAME" />
            <Set Happiness="10" />
        </Update>
    </Buildings>
    <Buildings>
        <Update>
            <Where Type="BUILDING_PYRAMID" />
            <Set WorkerSpeedModifier="100" />
        </Update>
    </Buildings>
    <Building_SeaPlotYieldChanges>
        <Update>
            <Where BuildingType="BUILDING_COLOSSUS" />
            <Set Yield="2" />
        </Update>
    </Building_SeaPlotYieldChanges>

All in the same mod, but the first two changes show up ingame and the last two do not.

I haven't been able to get changes to social policies to show up ingame, either. At first I thought it was just restricted to those, but now I'm finding a whole slew of data elements where, if you update them, nothing happens.
 
ha, its like how my night has been going with Units. I don't think you need to end buildings after every segment, like thus:

<Buildings>
<Update>
<Where Type="BUILDING_MACHU_PICHU" />
<Set Cost="550" />
</Update>
<Update>
<Where Type="BUILDING_NOTRE_DAME" />
<Set Happiness="10" />
</Update>
</Buildings>

As an example, but hey I can be wrong. Also does <Where have to go on top of <Set?

:edit:
Oh and also I noticed this diffrence:

<Buildings>
<Update>
<Where Type="BUILDING_PYRAMIDS" />
<Set WorkerSpeedModifier="100" />
</Update>
</Buildings>
<Building_SeaPlotYieldChanges>
<Update>
<Where BuildingType="BUILDING_COLOSSUS" />
<Set Yield="2" />
</Update>
</Building_SeaPlotYieldChanges>

Maybe it&#8217;s hosing something up?
 
I think it doesn't matter. I've just been following the pattern I saw in the Queen of the Iceni mod.

I've even tried doing some of this in SQL directly instead of xml (thinking it might be a bug with translation) but there's some fields that still have no effect ingame when updated. This is getting frustrating as I discover more and more of these.

The difference between Type and BuildingType is actually in the standard game files, I'm using the field names there.
 
I would try begining with an open <Buildings> then all of your code within and close it with </Buildings> tag.

Without a beginning and an end for your sea plots, it wouldn&#8217;t recognize it as a building... Right?
</Building_SeaPlotYieldChanges>
 
Tried grouping everything under Buildings, that did work nicely to cut down on clutter for the cost/happiness edits. Updates to any of the following fields still have no effect:

Buildings -> WorkerSpeedModifier
Buildings -> ObsoleteTech
Building_SeaPlotYieldChanges -> Yield

Going to go through and see if it's specific changes to social policy fields that don't work, or if all social changes don't work.
 
Good catch, thank you. Still doesn't work. :\

After hours of testing, it appears the majority of fields in the CIV5Policies.xml file are in the category of updates having no effect, in addition to the fields listed above for buildings.
 
Did you change the Colossus entry as well?

Wrong:
<Where BuildingType="BUILDING_COLOSSUS" />

Correct:
<Where Type="BUILDING_COLOSSUS" />
 
Are you certain? The difference between Type and BuildingType is delineated in the files. The reason is there can be more than one Type in this section of each database:

Spoiler :
Code:
	<Buildings>
		<Row>
			[B]<Type>[/B]BUILDING_COLOSSUS</Type>
			<BuildingClass>BUILDINGCLASS_COLOSSUS</BuildingClass>
			<Cost>150</Cost>
			<PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
			<Help>TXT_KEY_WONDER_COLOSSUS_HELP</Help>
			<Description>TXT_KEY_BUILDING_COLOSSUS</Description>
			<Civilopedia>TXT_KEY_WONDER_COLOSSUS_DESC</Civilopedia>

        [...]


	<Building_SeaPlotYieldChanges>
		<Row>
			[B]<BuildingType>[/B]BUILDING_LIGHTHOUSE</BuildingType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			[B]<BuildingType>[/B]BUILDING_COLOSSUS</BuildingType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Building_SeaPlotYieldChanges>

I tried it with Type for the second part, still didn't work.

Here's the whole file. Again, everything works but Yield, ObsoleteTech, and WorkerSpeedModifier.

Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 9/28/2010 8:45:41 PM -->
<GameData>
	<Building_SeaPlotYieldChanges>
		<Update>
			<Where BuildingType="BUILDING_COLOSSUS" YieldType="YIELD_GOLD" />
			<Set Yield="2" />
		</Update>
	</Building_SeaPlotYieldChanges>
	<Buildings>
		<Update>
			<Where Type="BUILDING_COLOSSUS" />
			<Set ObsoleteTech="NULL" />
		</Update>		
		<Update>
			<Where Type="BUILDING_EIFFEL_TOWER" />
			<Set Happiness="16" />
		</Update>
		<Update>
			<Where Type="BUILDING_FORBIDDEN_PALACE" />
			<Set Cost="500" />
		</Update>
		<Update>
			<Where Type="BUILDING_GREAT_WALL" />
			<Set Cost="175" />
		</Update>
		<Update>
			<Where Type="BUILDING_HANGING_GARDENS" />
			<Set Cost="175" />
		</Update>
		<Update>
			<Where Type="BUILDING_KREMLIN" />
			<Set Cost="325" />
		</Update>
		<Update>
			<Where Type="BUILDING_MACHU_PICHU" />
			<Set Cost="450" />
		</Update>
		<Update>
			<Where Type="BUILDING_NOTRE_DAME" />
			<Set Happiness="10" />
		</Update>
		<Update>
			<Where Type="BUILDING_PYRAMID" />
			<Set WorkerSpeedModifier="100" />
		</Update>
		<Update>
			<Where Type="BUILDING_STATUE_OF_LIBERTY" />
			<Set Cost="1000" />
		</Update>
	</Buildings>
</GameData>

Also, none of these work if added to the file:

Spoiler :
Code:
	<Policy_CityYieldChanges>
		<Update>
			<Where PolicyType="POLICY_REPUBLIC" YieldType="YIELD_PRODUCTION" />
			<Set Yield="2" />
		</Update>
	</Policy_CityYieldChanges>
	<Policy_CoastalCityYieldChanges>
		<Update>
			<Where PolicyType="POLICY_MERCHANT_NAVY" YieldType="YIELD_PRODUCTION" />
			<Set Yield="4" />
		</Update>
	</Policy_CoastalCityYieldChanges>
	<Policy_BuildingClassHappiness>
		<Update>
			<Where PolicyType="POLICY_HUMANISM" BuildingClassType="BUILDINGCLASS_UNIVERSITY" />
			<Set Happiness="2" />
		</Update>
	</Policy_BuildingClassHappiness>
	<UnitPromotions>
		<Update>
			<Where Type="PROMOTION_NATIONALISM" />
			<Set FriendlyLandsAttackModifier="50" />
		</Update>
	</UnitPromotions>
	<Policies>
		<Update>
			<Where Type="POLICY_TRADITION" />
			<Set CapitalUnhappinessMod="-50" />
		</Update>
		<Update>
			<Where Type="POLICY_LANDED_ELITE" />
			<Set CapitalGrowthMod="100" />
		</Update>
		<Update>
			<Where Type="POLICY_COLLECTIVE_RULE" />
			<Set FreeFoodBox="0" />
			<Set NewCityExtraPopulation="1" />
		</Update>
		<Update>
			<Where Type="POLICY_CITIZENSHIP" />
			<Set WorkerSpeedModifier="50" />
		</Update>
		<Update>
			<Where Type="POLICY_MANDATE_OF_HEAVEN" />
			<Set HappinessToCulture="100" />
		</Update>
		<Update>
			<Where Type="POLICY_THEOCRACY" />
			<Set UnhappinessMod="30" />
		</Update>
		<Update>
			<Where Type="POLICY_UNITED_FRONT" />
			<Set OtherPlayersMinorFriendshipDecayMod="100" />
		</Update>
		<Update>
			<Where Type="POLICY_UNIVERSAL_SUFFRAGE" />
			<Set CityStrengthMod="100" />
		</Update>
	</Policies>
 
<Row>
<Type>POLICY_CITIZENSHIP</Type>
<Description>TXT_KEY_POLICY_CITIZENSHIP</Description>
<Civilopedia>TXT_KEY_CIV5_POLICY_CITIZENSHIP_TEXT</Civilopedia>
<Help>TXT_KEY_POLICY_CITIZENSHIP_HELP</Help>
<PolicyBranchType>POLICY_BRANCH_LIBERTY</PolicyBranchType>
<CultureCost>10</CultureCost>
<GridX>4</GridX>
<GridY>1</GridY>
<WorkerSpeedModifier>100</WorkerSpeedModifier>
<PortraitIndex>26</PortraitIndex>
<IconAtlas>POLICY_ATLAS</IconAtlas>
<IconAtlasAchieved>POLICY_A_ATLAS</IconAtlasAchieved>
</Row>
<Row>
This worked correctly
<Row>
<Type>BUILDING_PYRAMID</Type>
<BuildingClass>BUILDINGCLASS_PYRAMID</BuildingClass>
<Cost>175</Cost>
<PrereqTech>TECH_MASONRY</PrereqTech>
<Help>TXT_KEY_WONDER_CHICHEN_ITZA_HELP</Help>
<Description>TXT_KEY_BUILDING_PYRAMID</Description>
<Civilopedia>TXT_KEY_WONDER_PYRAMIDS_DESC</Civilopedia>
<Quote>TXT_KEY_WONDER_PYRAMIDS_QUOTE</Quote>
<ArtDefineTag>THE PYRAMIDS</ArtDefineTag>
<MaxStartEra>ERA_CLASSICAL</MaxStartEra>
<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
<GreatPeopleRateChange>1</GreatPeopleRateChange>
<NukeImmune>true</NukeImmune>
<HurryCostModifier>-1</HurryCostModifier>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>100</ConquestProb>
<WorkerSpeedModifier>100</WorkerSpeedModifier>
<Culture>1</Culture>
<DisplayPosition>4</DisplayPosition>
<IconAtlas>BW_ATLAS_2</IconAtlas>
<PortraitIndex>0</PortraitIndex>
<WonderSplashImage>WonderConceptPyramids.dds</WonderSplashImage>
<WonderSplashAudio>AS2D_WONDER_SPEECH_THE_PYRAMIDS_01</WonderSplashAudio>
</Row>
<Row>

So small testing yielded 100 cuts a 6 turn mine into a 3 turn, while 200 turns the mine 2 turns.
 
You're not alone, friend. I'm running into the very same problem, my mod has three XML files and only one seems to be updating, and not all of it either.
http://forums.civfanatics.com/showthread.php?t=385198

Did you set up an OnModActivated for each XML file?

Indeed, some updates taking effect, others not. That rules out most file-wide or project-wide problems... there's gotta be some bug or something we're overlooking on an instruction-line basis.
 
I'm not having much success either when updating 'Concepts' (here), I will try the Tuner to see if helps (or at least help me learn how to use it). I don't know if it hooks this kind of thing, maybe only Lua code.
 
Still awake I see Thalassicus.

Can you take a screen shot of your OnModActivated, I would just like to see if it also pertains to my problem, maybe a path destination is messed up...
 
Are you certain? The difference between Type and BuildingType is delineated in the files. The reason is there can be more than one Type in this section of each database
You are absolutely right, my bad. That'll teach me not to post when using matchsticks to keep my eyes open. ;)
 
Thalassicus, when you say it doesn't take effect, do you mean it doesn't show up (in description) or it actually doesn't work?

We already know social policy text is independent of their actual effects, as the trading post one really gives only +1 science. So maybe those things (worker speed, etc) just need manually updated descriptions?
 
I, for instance, have updated the Honor policy both on it's value and on it's description (in the GameInfos_Jon file), and neither took effect. I confirmed the bonus to barbarians persisted when I had set it to zero, and the mouser over tooltip for the policy remained unchanged.
 
You're absolutely right, now that I've had some proper sleep it's much clearer. Some tooltips must be simply be hardcoded and not updated from data values... not a bug but just some sloppy programming. It felt too inconsistent and widespread to be bugs.
 
OK, I think I've managed to clear this up. At least now my mod is fully working for me, and I didn't change it to get it so. Yesterday when I first playtested my mod it annoyed me that the AI complained about me settling near them in the three games I played, before I even built a settler! I thought "I must have messed up some XML core files while skimming them in Notepad++".

And today it occurred to me that our problem might be not with our mods, but with our own installations of Civ. See, when we have changed anything in the core XMLs it is logical that Civ would see that and not apply any mods' actions on those particular files. Hence why we only get our mods partially working. So I deleted CiV and let Steam redownload and install. All my changes are working like a charm now. I'm inconceivably happy.
 
Back
Top Bottom