What i'm doing wrong?

The Raven

Chieftain
Joined
Oct 18, 2010
Messages
3
I'm working on a Classical Era mod.
I've started modding stuff etc, but i'm stuck because even though all the other changes work, the combat strength i changed doesn't change in-game.
Here is the code:

Code:
<GameData>
		<Technologies>
			<Update>
				<Set Disable="1"/>
				<Where Type="TECH_GUNPOWDER"/>
			</Update>
		</Technologies>
		<Buildings>
			<Update>
				<Set Defense="1500"/>
				<Where Type="BUILDING_WALLS"/>
			</Update>
			<Update>
				<Set Cost="50"/>
				<Where Type="BUILDING_WALLS"/>
			</Update>
			<Update>
				<Set Defense="3000"/>
				<Where Type="BUILDING_CASTLE"/>
			</Update>
			<Update>
				<Set Cost="100"/>
				<Where Type="BUILDING_CASTLE"/>
			</Update>
			<Update>
				<Set Cost="40"/>
				<Where Type="BUILDING_BARRACKS"/>
			</Update>
			<Update>
				<Set Cost="80"/>
				<Where Type="BUILDING_ARMORY"/>
			</Update>
			<Update>
				<Set GoldMaintenance="1"/>
				<Where Type="BUILDING_ARMORY"/>
			</Update>
		</Buildings>
		<Units>
			<Update>
				<Set Combat="13"/>
				<Where Type="UNIT_GREEK_HOPLITE"/>
			</Update>
			<Update>
				<Set Disable="1"/>
				<Where Type="UNIT_KNIGHT"/>
			</Update>
			<Update>
				<Set Combat="12"/>
				<Where Type="UNIT_ARABIAN_CAMELARCHER"/>
			</Update>
			<Update>
				<Set Combat="15"/>
				<Where Type="UNIT_SIAMESE_WARELEPHANT"/>
			</Update>
			<Update>
				<Set Disable="1"/>
				<Where Type="UNIT_TREBUCHET"/>
			</Update>
			<Update>
				<Set Combat="13"/>
				<Where Type="UNIT_JAPANESE_SAMURAI"/>
			</Update>
			<Update>
				<Set Combat="13"/>
				<Where Type="UNIT_PERSIAN_IMMORTAL"/>
			</Update>
		</Units>
</GameData>

For example i gave 13 Strenght to Hoplites, yet in game they still show 9.
But for instance the stronger walls/castles work.

I'd be glad if you can find why, i see nothing wrong in the code...

Thanks in advance.
 
I'd advise you to create separate XML files for each change not because it's required, but because it's a great help when narrowing down your problems. Any file that works you know is not a problem whereas those that don't appear in your game normally.

Giving your XML code a cursory glance I can't see anything wrong. Did you set the Mod to load the file from the Action's option in your Mod Properties? If you did make sure it's in order, since a simple spelling mistake can cause it not to appear. I just had a problem like that with my own Unit changes -- something that was much easier to locate thanks to keeping the file separate of my other changes.
 
I'd advise you to create separate XML files for each change not because it's required, but because it's a great help when narrowing down your problems. Any file that works you know is not a problem whereas those that don't appear in your game normally.

Giving your XML code a cursory glance I can't see anything wrong. Did you set the Mod to load the file from the Action's option in your Mod Properties? If you did make sure it's in order, since a simple spelling mistake can cause it not to appear. I just had a problem like that with my own Unit changes -- something that was much easier to locate thanks to keeping the file separate of my other changes.

I did what you said, nothing changed.
The changes to buildings still work, the gunpowder disabling is still in place, yet units still show the old damage.

The actions are done correctly i believe:



And i still fail to see mistakes in the code:

Code:
<GameData>
	<Units>
		<Update>
			<Set Combat="13"/>
			<Where Type="UNIT_GREEK_HOPLITE"/>
		</Update>
		<Update>
			<Set Disable="1"/>
			<Where Type="UNIT_KNIGHT"/>
		</Update>
		<Update>
			<Set Combat="12"/>
			<Where Type="UNIT_ARABIAN_CAMELARCHER"/>
		</Update>
		<Update>
			<Set Combat="15"/>
			<Where Type="UNIT_SIAMESE_WARELEPHANT"/>
		</Update>
		<Update>
			<Set Disable="1"/>
			<Where Type="UNIT_TREBUCHET"/>
		</Update>
		<Update>
			<Set Combat="13"/>
			<Where Type="UNIT_JAPANESE_SAMURAI"/>
		</Update>
		<Update>
			<Set Combat="13"/>
			<Where Type="UNIT_PERSIAN_IMMORTAL"/>
		</Update>
	</Units> 
</GameData>

I have uploaded the mod here, mind trying it on your PC?
Start a game with Greeks, check techtree (Gunpowder should be disabled) and see if walls give +15 defense instead of 10 (this means the buildings changes work) then create an Hoplite and see if its damage is still stuck to 9 or it's 13.

Thanks again.
 
Do the changes apply to other units ?

If not, I would say there might be a problem with the Type of the units maybe ?

Other hint: construct a hoplite, and check its strength. It might not show in the presentation of the uint, but still being changed in the game itself.

oh, and try to put the "WHERE TYPE" BEFORE the "SET" ^^. It might work.
 
Yeah, I'm pretty sure Disable does not work with Units. Do what Asylumer said. If you want to make Knights inaccessible, disable the technology.
 
Top Bottom