First Time Modding Question

Susemiehlian

Chieftain
Joined
Aug 9, 2011
Messages
5
As the title says, this is my first time attempting to make a mod. I've followed multiple guides on using ModBuddy, and it seems that I'm doing everything right (obviously I'm messing up somewhere) but my mod just isn't working.

I'm attempting to reduce the strength and cost of the musketman and its related unique units as well as allow the longswordman to upgrade into a rifleman instead of the musketman. I'm doing this because I downloaded a mod that allows pikemen to upgrade into musketman, which in my opinion fixes a glaring problem with the troop tree. However, with this pikeman to musketman mod alone, the necessity of iron is severely devalued in my opinion. With this tweak and the other mod, musketmen will become an alternative to longswordmen rather than a replacement, thus maintaining the value of iron in the mid-game as well as not rendering an army of spear/pikemen useless later in the game (when they upgrade from a strong front-line unit to specialty units which, in my opinion, have little use.)

Here is what I have done thus far for this mod (hopefully I'm not forgetting anything):
Made a new project in Mod Buddy, titled MusketmanTweak
Added folder titled XML and a new XML file titled Musketman.xml in the solution explorer
Added the following code:
Code:
<GameData>
	<Units>
		<Update>
			<Where Type="UNIT_MUSKETMAN" />
			<Set Combat="18"/>
			<Set Cost="105"/>
		</Update>
		<Update>
			<Where Type="UNIT_AMERICAN_MINUTEMAN"/>
			<Set Combat="18"/>
			<Set Cost="105"/>
		</Update>
		<Update>
			<Where Type="UNIT_FRENCH_MUSKETEER"/>
			<Set Combat="20"/>
			<Set Cost="105"/>
		</Update>
		<Update>
			<Where Type="UNIT_OTTOMAN_JANISSARY"/>
			<Set Combat="18"/>
			<Set Cost="105"/>
		</Update>
		<Update>
			<Where Type="UNIT_SPANISH_TERCIO"/>
			<Set Combat="19"/>
			<Set Cost="105"/>
		</Update>
	</Units>

	<Unit_ClassUpgrades>
		<update>
		<row>
			<UnitType>UNIT_LONGSWORDMAN</UnitType>
			<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
		</row>
		<row>
			<UnitType>UNIT_JAPANESE_SAMURAI</UnitType>
			<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
		</row>
		</update>
	</Unit_ClassUpgrades>

</GameData>
Went to mod properties, changed action to On ModActivated->UpdateDatabase - XML/Musketman.xml
Went to build->build project

Then I started up Civ, enabled the mod, and went in the game but nothing has changed.

My thought as to why this isn't working is that I'm not pointing the mod to a specific file to modify. (As I recently found, there are different unit.xml files for the vanilla game and BNW as well as misc dlc units such as the tercio.) However, I have not noticed any mention of this in any guide.

Any help is greatly appreciated.
 
Look through this thread. It's not official but the first post has a nice checklist of things to go through to see if you failed to comply with each one, all of which are necessary in order for the mod to take effect. The second post has links to logging and mod attachment tutorials.

Also it helps to put coding in
Code:
 blocks.

What I can see right there is that you've got some <Row> capitalization issues near the bottom, and you'll want to check the [I][B][U]exact[/U][/B][/I] names of the units, especially the UUs, where Firaxis' naming convention is inconsistent to say the least. Also, there can only be one <Set> per <Where>, so you'll need to merge them, like so:
[CODE]<Set Combat="18" Cost="105"/>

Not an issue, but if you'd like to reduce the amount of coding, instead of referencing each musketman-class unit individually, you could use just one Where tag (and subsequently one Set tag):
Code:
<Where UnitClass="UNITCLASS_MUSKETMAN"/>

OH! Just realized - In the bottom part of your code: <Row> is not a subset of <Update>. In fact, since you're not adding anything new, you don't need the <Row>s there at all.
 
This is where I'm currently at:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 10/25/2014 8:44:12 PM -->
<GameData>
	<Units>
		<Update>
			<Set Combat="18" Cost="105"/>
			<Where Type="UNIT_MUSKETMAN" />
		</Update>
		<Update>
			<Set Combat="18" Cost="105"/>
			<Where Type="UNIT_AMERICAN_MINUTEMAN"/>
		</Update>
		<Update>
			<Set Combat="20" Cost="105"/>
			<Where Type="UNIT_FRENCH_MUSKETEER"/>
		</Update>
		<Update>
			<Set Combat="18" Cost="105"/>
			<Where Type="UNIT_OTTOMAN_JANISSARY"/>
		</Update>
		<Update>
			<Set Combat="19" Cost="105"/>
			<Where Type="UNIT_SPANISH_TERCIO"/>
		</Update>
	</Units>

	<Unit_ClassUpgrades>
		<Update>
			<UnitType>UNIT_LONGSWORDMAN</UnitType>
			<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
		</Update>
		<Update>
			<UnitType>UNIT_JAPANESE_SAMURAI</UnitType>
			<UnitClassType>UNITCLASS_RIFLEMAN</UnitClassType>
		</Update>
	</Unit_ClassUpgrades>

</GameData>

I've followed your advice and the advice of that thread, but it still isn't working. I would use one Where tag to reference the musket type, but some of the unique units have different combat values.
I've ensured that all of the unit types are correct.
 
Top Bottom