Can't get my simple mod to work

Markolainen

Chieftain
Joined
Sep 29, 2010
Messages
15
I tried making a mod so the automated workers leave old improvments as well as forests alone. This is pretty simple since there is already an option for this in the Civ5PlayerOptions.xml.
But the mod won't work when I use it.

Here is the info of the files:
Spoiler Civ5PlayerOptions.xml :

<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 9/29/2010 9:32:25 PM -->
<GameData>
<PlayerOptions>
<Update>
<Set Value="true"/>
<Where Type="PLAYEROPTION_SAFE_AUTOMATION"/>
</Update>
<Update>
<Set Value="true"/>
<Where Type="PLAYEROPTION_LEAVE_FORESTS"/>
</Update>
</PlayerOptions>
</GameData>

Spoiler Workers Automated Leave Improvments (v 1).modinfo :

<?xml version="1.0" encoding="utf-8"?>
<Mod id="47dbd368-a19a-44be-9185-ef00872559d0" version="1">
<Properties>
<Name>Workers Automated Leave Improvments</Name>
<Stability>Alpha</Stability>
<Description>This mod makes the automated workers leve old improvments as well as forests alone.</Description>
<Authors>Marko</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="339533E8673A260885BC874DADA84BB7">XML/GameInfo/Civ5PlayerOptions.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>XML/GameInfo/Civ5PlayerOptions.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>

As well as the civ5mod file itself under attached files.

Why won't the mod work? I tried chaning the values to true in the XML in the game directory and it works then but I want to be able to change it quickly.

Thanks in advance,
 

Attachments

what do you mean when you set it to true it works, but then you want to be able to change it quickly?

If you want to be able to change it in game, your probably gonna need to add a button in the options menu.

oh and welcome to the forums :)
 
what do you mean when you set it to true it works, but then you want to be able to change it quickly?

If you want to be able to change it in game, your probably gonna need to add a button in the options menu.

oh and welcome to the forums :)
I meant that I want to be able to apply or not apply the mod to make it work or not and not have to change the XML files manually.

Maybe I was a little unclear. I don't want any button, I just want the workers to leave improvments and forests alone when the mod is active.

Thanksa!:)
 
You might try setting the reload checkboxes in the mod info. My guess would be you need to set ReloadUnitSystem to 1, which you can do via the checkbox in modbuddy, or by directly editing your modinfo file.

If that doesn't work, you'll likely need to use the mod events system. There's some info in the modding guide by Kael that tells you how to tell civ5 to load specific mod data at specific times (such as at game start). I haven't played with that side of things yet myself though, so I'm no help there.
 
yes, I concur, set ReloadUnitSystem to 1 and it should work.
 
Actually, now I've been digging around more, I just noticed something. The tool-tip for the reload units checkbox in modbuddy says it causes civ5 to reload unit art - use this for when you change unit art. So now I'm not so sure. The name - "Reload Unit System" implies to refreshes the unit data and art, but the tool tip suggests only art.

Verdict: Needs more testing.

As good as Kael's guide is, I really wish Firaxis themselves had taken the time to write up detailed guides to the mod tools/lua system. There's so many areas where we're just fumbling around in the dark.
 
yes, I feel like a noob again, its like my advanced VB class all over again. I get a document (Read: Bible) that vaguely explains how I need to do what I need to do, they give they absolute minimum syntax examples, never once showing a working example in its entirety and then we have to figure it out all on our own.
 
I tried the changing Reload Unit Data and it didn't help at all. I've read in Kael's guide and as far as I can see I've done right in how the file is loaded.

Hopefully someone can help me out since I really don't have any idea on how to fix this right now.

Thanks for the help anyways!:)
 
Have you tried checking the debug database after running the mod?

If you don't know what I'm talking about, it's discussed in Kael's guide. Basically, get an sql database reader (also mentioned in the guide) and check the civ5debugdatabase.db file in the docs/sid's civ5/cache folder - this is a copy of the normal database that gets updated with your mod changes. If the changes are not showing up, then at least we know the file is not being executed properly, which narrows down the search.

If they are showing up, then the problem is not in your files, but in how the mod gets incorporated into the gameplay.

Of course, it may all be for nothing. There's always the possibility that ini changes are only possible via the game options screen. Although that would not fit with you getting it working by modifying the game's original xml files.

Oh, and one last thing to try - empty your cache folder. Some people have been saying mods aren't working for them until they delete the database files in the cache folder.
 
Spoiler :
Have you tried checking the debug database after running the mod?

If you don't know what I'm talking about, it's discussed in Kael's guide. Basically, get an sql database reader (also mentioned in the guide) and check the civ5debugdatabase.db file in the docs/sid's civ5/cache folder - this is a copy of the normal database that gets updated with your mod changes. If the changes are not showing up, then at least we know the file is not being executed properly, which narrows down the search.

If they are showing up, then the problem is not in your files, but in how the mod gets incorporated into the gameplay.

Of course, it may all be for nothing. There's always the possibility that ini changes are only possible via the game options screen. Although that would not fit with you getting it working by modifying the game's original xml files.

Oh, and one last thing to try - empty your cache folder. Some people have been saying mods aren't working for them until they delete the database files in the cache folder.

Thanks I'll definitively try that.

Are you good at Civ IV modding?
 
Are you good at Civ IV modding?

Nope, never tried it - looked to complicated :)

I am a web developer who knows SQL though, so I'm liking the new sql database approach civ5 uses :)
 
Back
Top Bottom