Results 1 to 5 of 5

Thread: Trying to change the happiness amounts on resources but...

Hybrid View

  1. #1

    Trying to change the happiness amounts on resources but...

    Hi,
    I'm trying to create a mod that will change the amount of happiness I get for each luxury resource.

    I've created a new mod, and added an existing item (the Civ5Resources.xml file) to the mod, and then altered each luxury item in the xml file so that it shows something like this:
    <Row>
    <Type>RESOURCE_IVORY</Type>
    <Happiness>1</Happiness>

    I then save the mod, and then build the mod, and then go into the game.

    I go into the mod browser and activate my mod, then create a new mod single player game.

    However, in the game the resources are still all showing +5 Happiness

    So it's apparently not working the way I would think it should by altering that file and including it in my mod.

    Can somebody tell me where I've gone wrong, maybe what step I left out of this.

    Thank you,

  2. #2
    Join Date
    Sep 2010
    Posts
    128
    Try this;
    Code:
    <GameData>
      <Resources>
        <Update>
          <Where Type="RESOURCE_IVORY" />
          <Set Happiness="1" />
        </Update>
      </Resources>
    </GameData>
    You need to tell the game you are UPDATING a data entry that has already been set elsewhere, and you need to ensure you are using the correct table name that needs updating (in this case, "Resources" table). Using "<row>" is only for adding a whole new data set (or row) to a table.

    Don't forget you also need to edit the "Actions" of your project. You need action set "OnModActivated", type "UpdateDatabase", and value needs to match the name and relative path of whatever xml file you created (eg "mynewresources.xml" if your mod's XML is in the root of the mod folder), which if done correctly will cause ModdBuddy to "build" the .modinfo file (a plain text file in the same folder as your mod) to have something looking like this at the end of the file;
    Code:
      <Actions>
        <OnModActivated>
          <UpdateDatabase>mynewresources.xml</UpdateDatabase>
        </OnModActivated>
      </Actions>
    Last edited by Azzer007; 09-29-2010 at 11:09 PM.

  3. #3
    Ok

    So can it be added like this in the one container or would there need to be seperate <Update> </Update> containers for each command? I've tried it exactly as it's shown below and did do the Action, however it still shows every luxury item at +5 happiness in the game still.
    Code:
    <GameData>
      <Resources>
        <Update>
           <Where Type="RESOURCE_IVORY" />
               <Set Happiness="1" />
    
    		<Where Type="RESOURCE_WHALE" />
    	  	    <Set Happiness="3" />
    
    		<Where Type="RESOURCE_PEARLS" />
    		    <Set Happiness="2" />
    
       </Update>
      </Resources>
    </GameData>

  4. #4
    Join Date
    Sep 2010
    Posts
    128
    You'll need an <Update></Update> for each Row/Entity you are updating, eg for your example it should look like this;

    Code:
    <GameData>
      <Resources>
        <Update>
           <Where Type="RESOURCE_IVORY" />
           <Set Happiness="1" />
        </Update>
        <Update>
           <Where Type="RESOURCE_WHALE" />
           <Set Happiness="3" />
        </Update>
        <Update>
           <Where Type="RESOURCE_PEARLS" />
           <Set Happiness="2" />
        </Update>
      </Resources>
    </GameData>

  5. #5
    Join Date
    Aug 2010
    Posts
    15
    I understand how to modify integer and string values in an existing object but I don't understand how to update an existing object to add more items to a list.

    For example, how do I add 2 free technologies to an existing civilization (as an update, rather than by creating a new object)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •