What I'm doing wrong?

Anachist

Chieftain
Joined
Oct 29, 2010
Messages
37
I'm trying to get my very first testing mod working. It shows up in game mod database and I can launch it without any problems.

But when I try to play my mod, nothing happens. I'm thinking if I got something wrong in my XML file.

I'm, for the sake of testing, going to modify culture given from monument. I have following code in my mod:

Code:
<GameData>
<Buildings>
<Row>
<Type>BUILDING_MONUMENT</Type>
<BuildingClass>BUILDINGCLASS_MONUMENT</BuildingClass>
<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
<Cost>60<Cost>
<GoldMaintenance>1</GoldMaintenance>
<Help>TXT_KEY_BUILDING_MONUMENT_STRATEGY</Help>
<Description>TXT_KEY_BUILDING_MONUMENT_DESC</Description>
<Civilopedia>TXT_KEY_BUILDING_MONUMENT_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_MONUMENT_STRATEGY</Strategy>
<ArtDefineTag>MONUMENT</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<Culture>2</Culture>
<HurryCostModifier>40</HurryCostModifier>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<NeverCapture>true</NeverCature>
<PortraitIndex>21</PortraitIndex>
</Row>
<Update>
<Set Culture="4"/>
<Where BuildingClass="BUILDINGCLASS_MONUMENT"/>
</Update>

Is there something wrong with my code, or is it something else what I'm doing wrong?
 
I'm far from knowledgeable but but I'd be trying this first:

Code:
<GameData>
     <Buildings>
          <Update>
               <Set Culture="4" />
               <Where Type="BUILDING_MONUMENT" />
          </Update>
     <Buildings>
</GameData>
 
I'm trying to get my very first testing mod working. It shows up in game mod database and I can launch it without any problems.

But when I try to play my mod, nothing happens. I'm thinking if I got something wrong in my XML file.

I'm, for the sake of testing, going to modify culture given from monument. I have following code in my mod:

Code:
<GameData>
<Buildings>
<Row>
<Type>BUILDING_MONUMENT</Type>
<BuildingClass>BUILDINGCLASS_MONUMENT</BuildingClass>
<FreeStartEra>ERA_MEDIEVAL</FreeStartEra>
<Cost>60<Cost>
<GoldMaintenance>1</GoldMaintenance>
<Help>TXT_KEY_BUILDING_MONUMENT_STRATEGY</Help>
<Description>TXT_KEY_BUILDING_MONUMENT_DESC</Description>
<Civilopedia>TXT_KEY_BUILDING_MONUMENT_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_MONUMENT_STRATEGY</Strategy>
<ArtDefineTag>MONUMENT</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<Culture>2</Culture>
<HurryCostModifier>40</HurryCostModifier>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<NeverCapture>true</NeverCature>
<PortraitIndex>21</PortraitIndex>
</Row>
<Update>
<Set Culture="4"/>
<Where BuildingClass="BUILDINGCLASS_MONUMENT"/>
</Update>

Is there something wrong with my code, or is it something else what I'm doing wrong?
Very much something wrong with your code.

<Row> is used to add new content; it is what you would use if you were making another building, instead of modifying an existing building.

To change something about an existing building (even if you are adding something it doesn't have a line for in the original XML, since there will just be a defaulted value for it), you would use <Update> instead.

Now, I've been having trouble getting things to work when I mod things, so take this for what it's worth: But from what I understand, the syntax for updating game data is:


Inside the <GameData> tags, you put the tags for whatever section you are modifying--in this case, <Buildings>. You can easily find this while looking up the original values.

Inside this tag, you put your <Update> tags.

Inside the <Update> tags, you must have two tags: <Set/> and <Where/>.

<Where/> is used to find the item you are updating, and you have to give it something to search for by by putting in the name of a tag from that item, then an equals sign, and the value that is given to that tag (inside quotation marks), like so:

Code:
<Where Type="BUILDING_MONUMENT"/>

You can also give multiple searches inside the <Where/> tag; if you do, then the values will only be changed where all of the items match.

<Set/> is used to do the actual value changes. In a similar fashion to the <Where/> tags, you give a tag name and the new value it should have. In this case:

Code:
<Set Culture="4"/>


Altogether, it should like something like:
Code:
<GameData>
     <Buildings>
          <Update>
               <Where Type="BUILDING_MONUMENT"/>
               <Set Culture="4"/>
          </Update>
     <Buildings>
<GameData>

Hope that helps. :goodjob:



(And yes, this is kind of confusing compared to just changing the values in the XML, but it makes it possible for two mods to make changes to the same file without necessarily interfering with each other. If the entire XML was replaced, then you wouldn't, for example, be able to use two mods that changed the Units.xml file.)
 
What a idiot I am!

I had read Kael's guide for many times, and I still confused civ 5 modding to civ 4 modding where you have to replace original files.

But now it works! :D

Thanks for help! Now I can finally get into a real modding!
 
Top Bottom