Not off to a good start...

evanbgood

Chieftain
Joined
Sep 26, 2010
Messages
77
Well, I hate to say it this early, but I'm stuck on my attempts to mod. Admittedly, I'm a bit new to all of it (I've only dabbled with modding in a few games and never with a Civ before), but I didn't think I'd hit a road block right at the beginning!

So, here's my problem. All I'm trying to do is test out a simple override that should beef up the scout and the warrior to rediculous levels (just for testing purposes, obviously). The problem is, it simply doesn't work... No error messages or crashes or anything, it's just as if the mod doesn't exist.

As for what I've done so far, I started out by writing this xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 10/8/2010 12:52:33 PM -->
<GameData>
	<Units>
		<Update>
			<Where Type="UNIT_SCOUT" />
			<Set Combat="40" />
			<Set Cost="1" />
			<Set Moves="10" />
		</Update>
		<Update>
			<Where Type="UNIT_WARRIOR" />
			<Set Combat="40" />
		</Update>
	</Units>
</GameData>
I saved it as "uberscout.xml" in my project. In my project's properties, I named it "Weird Mod", set it to work with saved games, and set an action of OnModActivated, UpdateDatabase, uberscout.xml.

From what I read, that should really be it, right? I publish the project, I find it in the mod browser, activate it and load it like any of the other dozens of mods I've used successfully... but no success! If it helps, I also have the raw data from my .modinfo file:

Spoiler :
<?xml version="1.0" encoding="utf-8"?>
<Mod id="ce0b5452-ef5c-4e1b-898c-634fc9b1d55b" version="1">
<Properties>
<Name>WeirdMod</Name>
<Stability>Experimental</Stability>
<Description>Completely ruins the game for testing purposes, fun, and profit.</Description>
<Authors>Evan B Good</Authors>
<AffectsSavedGames>0</AffectsSavedGames>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsMac>1</SupportsMac>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadUnitSystem>0</ReloadUnitSystem>
</Properties>
<Dependencies />
<References />
<Blocks />
<Files>
<File md5="C5F1E40513989A224592C146B724050B">uberscout.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>uberscout.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>


Any help would be most appreciated. I feel like I really understand the whole XML thing... yet I don't understand what's holding me back here.
 
Try this:

<GameData>
<Units>
<Update>
<Set Combat="40"/>
<Where Type="UNIT_SCOUT/>
</Update>
<Update>
<Set Cost="1"/>
<Where Type="UNIT_SCOUT/>
</Update>
<Update>
<Set Moves="10"/>
<Where Type="UNIT_SCOUT/>
</Update>
<Update>
<Set Moves="40"/>
<Where Type="UNIT_WARRIOR/>
</Update>
</Units>
</GameData>
 
You can perform multiple Sets in a single Update as follows:

Code:
	<Units>
		<Update>
			<Where Type="UNIT_SCOUT" />
			<Set Combat="40" Cost="1" Moves="10" />
		</Update>
		<Update>
			<Where Type="UNIT_WARRIOR" />
			<Set Combat="40" />
		</Update>
	</Units>

Haven't tested myself but this is what I've read ;) The same applies for multiple Where conditions, see Kael's guide for more info.
 
Ah-ha! That did it! Seems obvious now that I look at it. The way I had it set up, I think it was telling the code to Set Combat 40 if Set Cost 1.. which obviously doesn't make sense. Thanks a ton!
Out of curiosity, a little follow-up question, what's the difference between "Build Solution" and "Build <modname"? Should I be using just one or the other?
Thanks again!
 
Ah-ha! That did it! Seems obvious now that I look at it. The way I had it set up, I think it was telling the code to Set Combat 40 if Set Cost 1.. which obviously doesn't make sense. Thanks a ton!
Out of curiosity, a little follow-up question, what's the difference between "Build Solution" and "Build <modname"? Should I be using just one or the other?
Thanks again!

Just use "Build Solution". And no problem!
 
<Set Combat="40" Cost="1" Moves="10" />

Thank you for that one, as well! Tested and confirmed functional, and much prettier!

A couple other observations:
Changing unit properties on a saved game doesn't have any effect on already deployed units, but does on produced units.
There wasn't anything wrong with my mod file, which is where I thought the problem was.
Taking over 3 city states and the entire arab nation in three turns with scouts is really, really funny. :goodjob:
 
Top Bottom