Why doesn't my mod appear to be taking effect?

BoogieMan

Chieftain
Joined
Dec 24, 2005
Messages
17
I thought I set it up right.

I have actions set to OnModActivated->UpdateDatabase on all my xml files and the folder structure is the same as the game (if it's even required) And the one LUA file I changed I added as a MapScript(Aliens.lua) - after that I went to Build/Build Mod and I see the file time stamps change.


When I load up the game with my mod enabled, I can't see any of the changes at all. I modded Alien combat strength, and they show default. For testing I also changed clinic health from 1 to 2, and it still shows 1. I have no clue what I am missing at this point.. Can someone please help me out?
 
Could be any number of reasons, you'll want to check your logs for errors, and post them here if they're not self-explanatory. Logs are pretty much always the first line of troubleshooting.

Logs can be found in:

C:\Users\<Your user name>\Documents\My Games\Sid Meier's Civilization Beyond Earth\logs

database.log will usually show if there are any errors parsing your XML.
lua.log does the same for your lua files, as well as any errors that occur during the course of the game.

If you restart BE, the log files are totally cleaned. If you're just quitting out to the main menu to reload your mods, anything new is appended to the end.
 
Thanks for the reply, this is what the Database.log says:

________________________________________
[26602.710]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 5451576 7951208
PageCache: 5 9
LookAside: 0 0
Scratch: 0 1
Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 4938024 4943904
Scratch: 0 0

Largest Allocations:
Malloc: 130560
PageCache: 1176
Scratch: 5056

Prepared Statements:
Current: 10
------------------------------
[26603.178]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 5452872 7951208
PageCache: 5 9
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 4939200 4943904
Scratch: 0 0

Largest Allocations:
Malloc: 130560
PageCache: 1176
Scratch: 5056

Prepared Statements:
Current: 10
------------------------------
[26621.383] table Buildings already exists
[26621.383] In XMLSerializer while building table Buildings from file assets/Gameplay/XML/Buildings/CivBEBuildings.xml.
[26621.383] table GameSpeeds already exists
[26621.383] In XMLSerializer while building table GameSpeeds from file assets/Gameplay/XML/GameInfo/CivBEGameSpeeds.xml.
[26621.383] UNIQUE constraint failed: Leaders.Type
[26621.383] While executing - 'insert into Leaders('Type', 'Description', 'Civilopedia', 'ArtDefineTag', 'VictoryCompetitiveness', 'WonderCompetitiveness', 'Boldness', 'DiploBalance', 'WarmongerHate', 'CoopWillingness', 'Loyalty', 'Neediness', 'Forgiveness', 'Chattiness', 'Meanness') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);'
[26621.383] In XMLSerializer while inserting row into table insert into Leaders('Type', 'Description', 'Civilopedia', 'ArtDefineTag', 'VictoryCompetitiveness', 'WonderCompetitiveness', 'Boldness', 'DiploBalance', 'WarmongerHate', 'CoopWillingness', 'Loyalty', 'Neediness', 'Forgiveness', 'Chattiness', 'Meanness') with values (LEADER_ALIEN, TXT_KEY_LEADER_ALIEN, TXT_KEY_LEADER_ALIEN_PEDIA, ART_DEF_LEADER_ALIEN, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, ).
[26621.383] In XMLSerializer while updating table Leaders from file assets/Gameplay/XML/Leaders/CivBELeader_Alien.xml.
[26621.383] UNIQUE constraint failed: Leaders.Type
[26621.383] UNIQUE constraint failed: Defines.Name
[26621.383] While executing - 'insert into Defines('Name', 'Value') values (?, ?);'
[26621.383] In XMLSerializer while inserting row into table insert into Defines('Name', 'Value') with values (AI_ATTEMPT_RUSH_OVER_X_TURNS_TO_BUILD, 15, ).
[26621.383] In XMLSerializer while updating table Defines from file assets/Gameplay/XML/AI/GlobalAIDefines.xml.
[26621.383] UNIQUE constraint failed: Defines.Name
[26621.399] UNIQUE constraint failed: Defines.Name
[26621.399] While executing - 'insert into Defines('Name', 'Value') values (?, ?);'
[26621.399] In XMLSerializer while inserting row into table insert into Defines('Name', 'Value') with values (MC_GIFT_WEIGHT_THRESHOLD, 100, ).
[26621.399] In XMLSerializer while updating table Defines from file assets/Gameplay/XML/AI/GlobalDiplomacyAIDefines.xml.
[26621.399] UNIQUE constraint failed: Defines.Name
[26621.399] table CivilianAttackPriorities already exists
[26621.399] In XMLSerializer while building table CivilianAttackPriorities from file assets/Gameplay/XML/Units/CivBEUnits.xml.
[26621.399] table Defines already exists
[26621.399] In XMLSerializer while building table Defines from file assets/Gameplay/XML/GlobalDefines.xml.
[26622.428]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 5489992 7951208
PageCache: 6 10
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 4942728 7290024
Scratch: 0 0

Largest Allocations:
Malloc: 130560
PageCache: 1176
Scratch: 5056

Prepared Statements:
Current: 17
------------------------------
[26642.599] no such column: RESOURCECLASS_ARTIFACT
[26642.599] In Query - select * from ResourceClasses where RESOURCECLASS_ARTIFACT
________________________________________




________________________________________
And the lua.log shows these lines which seem relevant:

Runtime Error: C:\Users\SMW\Documents\My Games\Sid Meier's Civilization Beyond Earth\MODS\BoogieMan's AI Mod (v 3)\assets\Gameplay\lua\Aliens.lua:22: attempt to index a nil value
stack traceback:
C:\Users\SMW\Documents\My Games\Sid Meier's Civilization Beyond Earth\MODS\BoogieMan's AI Mod (v 3)\assets\Gameplay\lua\Aliens.lua:22: in function '(main chunk)'
[C]: in function '(anonymous)'
Runtime Error: Error loading C:\Users\SMW\Documents\My Games\Sid Meier's Civilization Beyond Earth\MODS\BoogieMan's AI Mod (v 3)\assets\Gameplay\lua\Aliens.lua.
stack traceback:

I made vary minor changes to that file, just the unit type ratios of the overall percentage of population, and I ensured it still equals 100 as it did prior to my changes.. No idea what is wrong there.
________________________________________


If I make these changes directly to the game files (not with a mod) it all works fine.
 
Looks like two things:
1. Don't include the table definitions for tables that already exist. If you're just trying to update an existing building, for example, you don't need to tell the engine what the building table looks like. Which leads to...

2. It also looks like you're trying to insert rows that already exist. Try an update instead of adding a new row.

Don't sweat this too much, it's the exact same mistakes I made a few days ago.
 
I think I'm missing out on something fundamental. All my changes have been restricted to changing an existing variable to a different value. I think this might merge in with my other topic, I should perhaps look in to deleting that one.

For example, I made some changes to GlobalAIDefines.xml. Currently, the file in it's entirety exists within my mod. Something tells me that is not right. I'm not sure where to go from here.
 
Okay I think I've made progress. It looks like I need to make a file that has only my changes in it and then I need to reference the data I am changing with some tags, something like this:


<GameData>
<Units>
<Update>
<Where Type="UNIT_ALIEN_RAPTOR_BUG"/>
<Set>
<Combat>20</Combat>
</Set>
</Update>
</Units>
</GameData>


So many things for such a small change. By looking at some other mods, I notices some say "Created by ModBuddy on x time and date" in their update files. Is there a way to automate this process? That's kind of what it looks like. Some way to have it create the update file and all the fancy sytax on the information you specify or change?
 
Your conclusion is correct, though it doesn't seem like "so many things" to me.

If you like, you can use SQL instead of XML to accomplish the same thing:
Code:
UPDATE Units SET Combat=20 WHERE Type='UNIT_ALIEN_RAPTOR_BUG';

See this XML/SQL cheat sheet.

"Created by ModBuddy" just means the blank file was created by ModBuddy.
 
Is there a reason not to use ModBuddy? Maybe it's just natural to me since I'm familiar with Visual Studio already, but it seems like it would be a real hassle to set everything up by hand.
 
One reason that comes to mind is if you're on Mac or Linux.

EDIT: Somewhat less compelling excuses: Some people just want to dip their toes into modding initially, or have difficulty installing and/or running ModBuddy.
 
I think I got it figured out well enough to do what I set out to do. The mod appears to be working fine and there are no errors in the log and the changes seem to be working well. The next thing to figure out is how to properly import LUA changes so I can buff the aliens a bit more..

Thanks for the help everyone.

If you're curious/bored, check it out on the Steam workshop "BoogieMan's AI Mod".
 
Back
Top Bottom