XML and arithmetic operators

postalman

Chieftain
Joined
Sep 30, 2010
Messages
9
I want to change the cost of technologies, and do it in such a way that it is compatible with TBM and as many other mods as possible.

In the past I've just manually edited CIV5Technologies.xml, but with patching that is getting too cumbersome, so I'm building my first Civ5 mod.

I want to do something like
Code:
<Technologies>
	<Update>
		<Set Cost*="1.5"/>
		<Where Era="ERA_CLASSICAL"/>
	</Update>
</Technologies>

To simply multiply the tech cost of each era by a different constant. I figure this is a good way of keeping the mod simple so future tech tree updates by other moders do not require any more work here. (unlike setting the cost tech by tech)

Obviously <Set Cost*="1.5"/> doesn't work, so how can I do the cost *= 1.5 bit in XML?

Moderator Action: Moved to the main forum.
 
You can't do it in XML, so you'll need to use SQL (exactly the same principle, you'll just need a .sql mod file instead of a .xml one)

Code:
UPDATE Technologies
	SET Cost = Cost * 1.5
	WHERE Era = 'ERA_CLASSICAL';

Whether this works with other mods will ultimately depend on the mod load order

Mod A sets cost of new or existing tech to 100, Mod B multiplies all existing costs by 1.5

A loads then B, cost will be 150
B loads then A, cost will be 100

At the moment there is no simply way to control mod load order - you have to mess around with clearing caches and then downloading and enabling in the correct sequence
 
Back
Top Bottom