Can anyone see a problem with this?

LonelyCatfish

Chieftain
Joined
Apr 28, 2011
Messages
6
Hi, I'm new to Civ5 modding and things have been going pretty well until I ran into this stumbling block, when I try to run one of my own mods the game simply removes what I want from the production list.

For example, after a couple of my slightly more complex mods failed I tried creating the simplest mod possible:
Code:
<GameData>
	<Buildings>
		<Update>			
			<Where Type="BUILDING_COURTHOUSE"/>
			<Set GoldMaintenance="2"/>
		</Update>		
	</Buildings>	
</GameData>
And the courthouse promptly disappears from my production list and stays unchanged with the civilopedia and tech tree.

Is this a problem with my coding? The actions run pretty much as you'd expect: 'OnModActivated...UpdateDatabase...Courthouse.xml(my filename)

The modinfo goes:
Spoiler :
<?xml version="1.0" encoding="utf-8"?>
<Mod id="0959e61f-8dd5-4d9f-af73-8ae1ae067592" version="1">
<Properties>
<Name>Courthouse Mod</Name>
<Stability>Alpha</Stability>
<Teaser>Lowers the maintenance cost of the Courthouse. Aimed at making annexing cities as a viable way of playing the game.</Teaser>
<Description>Lowers the maintenance cost of the Courthouse. Aimed at making annexing cities as a viable way of playing the game.</Description>
<Authors>Edward</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>1</AffectsSavedGames>
<MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsMac>1</SupportsMac>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
<ReloadUnitSystem>0</ReloadUnitSystem>
</Properties>
<Dependencies />
<References />
<Blocks />
<Files>
<File md5="FB818DB4A1F0439E1289F835B791E5AF" import="0">XML/Buildings/CIV5Buildings.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>CIV5Buildings.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>


Thanks in advance,
LonelyCatfish
 
I don't see anything obviously wrong with your code; I'm already doing the following in my own mod:
Code:
<GameData>
	<Buildings>
		<Update>
			<Set HurryCostModifier="25" GoldMaintenance="8"/>
			<Where Type="BUILDING_COURTHOUSE"/>
		</Update>
	</Buildings>
</GameData>
I didn't see any misspellings in your version, so it should be working.

The bigger question is why you think conquering as an expansion isn't viable. Currently, it's THE way to play. Note that cities with a courthouse don't add to your per-city unhappiness, so it's already effectively +2 happiness in addition to part where it stops conquering unhappiness.
 
That's a tad pedantic when I was simply trying to fill in the character requirement and gameplay changes and means a lot for different people, regardless I agree with you the mod isn't really required nor is the explanation correct and I literally did this in 3 minutes to test what was going on.

Cheers for having a look none the less.
 
If the problem isn't something to do with the code, what are the other options?
Could it be something going on with my pc and does anyone know of any similar cases?

Any thoughts on the matter would be appreciated,

Cheers LonelyCatfish
 
Shot in the dark here since I haven't recently made any mods with any sort of folder structure, but from the modinfo it looks like your file is in the folder XML/Buildings while the UpdateDatabase command just has the filename without the path. Assuming Kael's guide is not out of date in this respect, the UpdateDatabase entry should also use the full relative path "XML/Buildings/CIV5Buildings.xml"
 
Nope still no luck, can't build Courthouse and it sits there mocking me beneath the mathematics tech with 4 maintenance cost (I am starting the game in the Renaissance so lack of tech isn't the reason)

Thanks anyway
 
Hey, if XML fails, you can still use SQL which is much better compatibilitywise anyway.
Delete your XML file and create a Buildings.sql file and add following into its cleared content:

Code:
UPDATE Buildings
SET GoldMaintenance = 2
WHERE Type = "BUILDING_COURTHOUSE";

Add OnModActivated - UpdateDatabase - Buildings.sql to Actions like with XML entries and debug the mod.

Enable the mod in the Mods menu and start from there a Single Player game to see if it works.

You can check my Unit-Tweaks mod for plenty examples how I mistreat units there. Buildings or Units, there is not much difference in handling. After a short while, you will never want to do it XML-style anymore.
 
Thanks I'll try the sql method some time later today if I can get some spare time, and yeah I am going through the mod menu (without leaving it) and setting up a game.

Many thanks,

LonelyCatfish
 
Back
Top Bottom