Totally New to Modding

RDH3030

Chieftain
Joined
Mar 26, 2011
Messages
3
Hey all. I'm a long time civ player, but am totally new to modding (no idea how to code). Been looking around on the forums and such, and Im having a lot of trouble creating mods. Even when cutting and pasting some code from others, things just don't work. Here is such an example.

<GameData>
<Traits>
<Update>
<Where Type="TRAIT_RIVER_EXPANSION"/>
<Set PlotBuyCostModifier="-10"/>
</Update>
</Traits>
<Language_en_US>
<Update>
<Where Tag="TXT_KEY_TRAIT_RIVER_EXPANSION"/>
<Set Text="[ICON_BULLET]+10% [ICON_GOLD] Gold discount when purchasing tiles.[NEWLINE] Receive double [ICON_GOLD] Gold from Barbarian encampments."/>
</Update>
</Language_en_US>

<Language_en_US>
<Update>
<Where Tag="TXT_KEY_TRAIT_RIVER_EXPANSION_SHORT"/>
<Set Text="Manifest_Destiny"/>
</Update>
</Language_en_US>

<Language_en_US>
<Update>
<Where Tag="TRAIT_RIVER_EXPANSION"/>
<Set Text="[ICON_BULLET]+10% [ICON_GOLD] Gold discount when purchasing tiles.[NEWLINE] Receive double [ICON_GOLD] Gold from Barbarian encampments."/>
</Update>
</Language_en_US>
<Traits>
<Update>
<Where Type="TRAIT_RIVER_EXPANSION"/>
<Set PlunderModifier="200"/>
</Update>
</Traits>

</GameData>

This was taken from the new traits portion of the NIGHTS mod. I just wanted to upgrade Washington's trait because I feel it is pretty useless. I hope to get into modding the social policies in a way that makes the game a little more political (centralized/ limited gov't, expansionism/isolationism, etc.)

The above mod was not meant to be complete...I'd also like to have america start with a free scout in addition to the warrior, but just couldn't find anything to make that work. Any help is appreciated. Thanks.
 
Been checking in here and I've seen that I'm getting some views but no replies, so I figured I'd put in some more information.

I am thinking my problem may be with ModBuddy. Firstly, when I create a new project, it will not allow me to "add new item" so that I can put in my code. At first that was working fine, but now it is not.

Secondly, I think I may be going wrong with the file path. What I'm talking about is when you go into the properties and put in "OnModActivated" and then "UpdateDatabase" that third window I am not sure what to put in there. Mbuddy was creating an xml file and a modinfo file in the Mods folder, so I was just putting the name of the mod in that third window. Noticed in the much talked about guide by Kael that in that window he was putting an entire path starting with XML. Love to try it if I could even add the code.

I feel like my issue is with specifying the wrong path or with a faulty modbuddy. Now that I've been a bit more specific I hope someone could help me out. Thanks.
 
I had the same problem the other day.
I couldn't figure out what I did wrong, so maybe it is modbuddy then.
 
There's too much information you've left out. For instance, the most common mistake new modders make is not setting up their load actions correctly. (That's OnModActivated for new XML, InGameUIAddin for new Lua, and VFS for modified versions of existing things or art assets.) So even if there's nothing wrong with your code itself, it won't actually load. (Next most common error: picking New Game at the main menu instead of going in through the Mods menu.)

If you don't know what I mean by those, then you might want to read through the tutorials again.
 
I'm definitely setting those boxes "onmodactivated" etc. Also going through the mods menu.

On a side note, if I take someone's mod files and change them (ie, cut and paste other stuff into the mod, or simply change a value) that mod works fine.

What I've tried to do so far is improve Washington's trait. I went with increasing tile purchasing to 35%. Just increased the value and it worked. Also tried to put the plunder modifier in from songai. Does not work on barbarian encampments although upon meeting city states I am given more money (50 if I am first to find them)

Spatz, I noticed you mentioned "...VFS for modified versions of existing things..." All I have done with modding so far has been updating existing files. I have been putting in onmodactivated and updatedatabase in the first two boxes. Is that wrong? No idea what you're talking about with VFS. May be onto something there?
 
Is that wrong? No idea what you're talking about with VFS. May be onto something there?

When I say "modified versions of existing things" I mean anything other than GameData editing or newly-created Lua files. If you're editing, say, AssignStartingPlots.lua (part of the existing game's files), then you need to replace the file in its entirety. This also applies to UI-related XML files, like TechTree.xml. So for these, you do NOT use OnModActivated (for XML) or InGameUIAddin (for Lua). Instead, you load it into the VFS, by right-clicking on the file in ModBuddy and set "Import into VFS" to True, which tells the game to replace the existing file in its entirety with the new one.

All of the things you listed in the first post were GameData updates, so no, you wouldn't use this for those. But since you didn't attach any files, I have no way of knowing if there was anything you left out.

But I did spot one error:
Code:
<Language_en_US>
<Update>
<Where Tag="TRAIT_RIVER_EXPANSION"/>
<Set Text="[ICON_BULLET]+10% [ICON_GOLD] Gold discount when purchasing tiles.[NEWLINE] Receive double [ICON_GOLD] Gold from Barbarian encampments."/>
</Update>
</Language_en_US>

There isn't a text key with the tag of TRAIT_RIVER_EXPANSION. You've already updated both tags that tie to this trait, so this one won't do anything.

Also, your texts aren't quite correct in two other ways:
1> You didn't remove the +1 visibility part of the original trait.
2> Setting PlunderModifier=200 means you TRIPLE the gold, not double it.

None of these would cause it to fail outright, though.
 
Back
Top Bottom