Own mod doesn't seem to load correctly (G&K)

[WTN]Manhattan

Chieftain
Joined
May 13, 2004
Messages
83
Location
Munich, Germany
I created a little mod and a sceanrio with WB. Unfortunately, it seems that nothing from my changes apply.

I added all actions in ModBuddy and implemented the map, too. The build of the mod worked without errors (the modinfo also seems to be ok). When I start the mod over the mod section, setup, load scenario, it seems that none of my changes applies (changed types of city states, soom building modifications). For example, the buildings does the same as usal, all city states have their default type, ...

The strange thing is that I cannot load the map in the mod sections if it is not saved in the standard map-folder (as I understand, I have to copy the map in ModBuddy and build the mod, so no map is needed in the standard maps-folder).

It seems that I'm doing something generally wrong. I already tried to delete the cache, but it didn't help. Has anybody any ideas?
 
In My Documents\My Games\Sid Meier's Civilization 5\config.ini, change
Code:
LoggingEnabled = 0
to
Code:
LoggingEnabled = 1

After trying to start a game with your mod, check the content of My Documents\My Games\Sid Meier's Civilization 5\Logs\database.log (you can post it here).
 
Thamls. It take a while becaus I hadn't time. This is the result:

[906.038] constraint failed
[906.038] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[926.349] Validating Foreign Key Constraints...
[926.349] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[926.349] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[926.349] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[927.878] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_HITTITE_WARCHARIOT" does not exist in Units
[927.878] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_SUMERIAN_PHALANX" does not exist in Units
[927.878] Failed Validation.
[928.455]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 383912 38429632
PageCache: 4359 4982
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 33808200
Scratch: 0 0

Largest Allocations:
Malloc: 131072
PageCache: 1160
Scratch: 6376

Prepared Statements:
Current: 10
------------------------------
[989.030] table MinorCivilizations already exists
[989.030] In XMLSerializer while building table MinorCivilizations from file XML/CIV5MinorCivilizations.xml.
[989.030] Database::XMLSerializer (XML/CIV5Buildings.xml): <Update> element requires a child <Set> element.
[1003.663] Validating Foreign Key Constraints...
[1003.663] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[1003.663] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[1003.663] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[1005.005] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_HITTITE_WARCHARIOT" does not exist in Units
[1005.005] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_SUMERIAN_PHALANX" does not exist in Units
[1005.005] Failed Validation.
[1005.629]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 502680 38429632
PageCache: 4402 4982
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 33808200
Scratch: 0 0

Largest Allocations:
Malloc: 131072
PageCache: 1160
Scratch: 6376

Prepared Statements:
Current: 23
------------------------------

Any ideas?
 
[989.030] table MinorCivilizations already exists
[989.030] In XMLSerializer while building table MinorCivilizations from file XML/CIV5MinorCivilizations.xml.
[989.030] Database::XMLSerializer (XML/CIV5Buildings.xml): <Update> element requires a child <Set> element.

This is the important part. It seems you try to create a table called MinorCivilizations that already exists, and use an XML <Update> element without a <Set> in it.

(The other things in the log aren't related to your mod.)
 
Thanks. It still doesn't work. I did the following:

What I tried to do first is to disable the free tech for the Oxford University. Now, I added the <set> as following:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 8/5/2012 1:46:31 PM -->
<GameData>
<Buildings>
<Update>
<Set FreeTechs>0</>
<Where Type="BUILDING_OXFORD_UNIVERSITY"/>
</Update>
</Buildings>
</GameData>

The idea for the MinorCivilizations was not to use the update but to replace the whole file, so I copied the original file and changed some things (the type of soom city states).

After the change the database.log looks like this:

[3694.914] constraint failed
[3694.914] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[3702.668] Validating Foreign Key Constraints...
[3702.668] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3702.668] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3702.668] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3704.399] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_HITTITE_WARCHARIOT" does not exist in Units
[3704.399] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_SUMERIAN_PHALANX" does not exist in Units
[3704.399] Failed Validation.
[3705.008]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 383864 38416696
PageCache: 4365 4982
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 33807040
Scratch: 0 0

Largest Allocations:
Malloc: 131072
PageCache: 1160
Scratch: 6376

Prepared Statements:
Current: 10
------------------------------
[3777.439] Validating Foreign Key Constraints...
[3777.439] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3777.439] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3777.439] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3778.890] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_HITTITE_WARCHARIOT" does not exist in Units
[3778.890] Invalid Reference on UnitGameplay2DScripts.UnitType - "UNIT_SUMERIAN_PHALANX" does not exist in Units
[3778.890] Failed Validation.
[3779.467]
-- SQLite Memory Statistics --
Memory Usage:
[Cur] [Max]
Malloc: 505616 38416696
PageCache: 4396 4982
LookAside: 0 0
Scratch: 0 1

Static Buffer Overflows:
[TooLarge] [NoSpace]
PageCache: 0 33807040
Scratch: 0 0

Largest Allocations:
Malloc: 131072
PageCache: 1160
Scratch: 6376

Prepared Statements:
Current: 24
------------------------------

So the two errors doesn't occure anymore. I didn't change anything wit the minor civs.... strange that it doesn't post the error anymore...

Another strange things is that my test-map can't be selected if it is only in the mod directory. It has to be in the primary map folder.

According to the modinfo it should be okay:

?xml version="1.0" encoding="utf-8"?>
<Mod id="b52b80c6-7140-436c-b56a-f65e8d05a21b" version="1">
<Properties>
<Name>WW3 (1979)</Name>
<Stability>Alpha</Stability>
<Teaser>This is a Cold War mod</Teaser>
<Description>This is a Cold War mod</Description>
<Authors>Tobias Krystufek</Authors>
<HideSetupGame>0</HideSetupGame>
<AffectsSavedGames>1</AffectsSavedGames>
<MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
<SupportsSinglePlayer>1</SupportsSinglePlayer>
<SupportsMultiplayer>1</SupportsMultiplayer>
<SupportsHotSeat>1</SupportsHotSeat>
<SupportsMac>1</SupportsMac>
<ReloadLandmarkSystem>0</ReloadLandmarkSystem>
<ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
<ReloadUnitSystem>0</ReloadUnitSystem>
</Properties>
<Dependencies />
<References />
<Blocks />
<Files>
<File md5="974546A18DF87DC804B3C3FCE2CC4EA6" import="0">Map/Oxford.Civ5Map</File>
<File md5="6D6EB74FE168DE2A971D0E630D507266" import="0">XML/CIV5MinorCivilizations.xml</File>
<File md5="0F8E147B0E1E6CD78116886C51552F6B" import="0">XML/CIV5Buildings.xml</File>
</Files>
<Actions>
<OnModActivated>
<UpdateDatabase>XML/CIV5MinorCivilizations.xml</UpdateDatabase>
<UpdateDatabase>XML/CIV5Buildings.xml</UpdateDatabase>
</OnModActivated>
</Actions>
</Mod>
 
<Set FreeTechs>0</>

It should be <Set FreeTechs="0"/>

The idea for the MinorCivilizations was not to use the update but to replace the whole file, so I copied the original file and changed some things (the type of soom city states).

This won't work properly if you don't delete the original tables. It will give you a message about creating tables that already exist, and even if you delete the table definitions at the beginning of the file, you'll create minor civs that already exist.

Replacing the original files is not as easy as it seems. You need to do 3 things to make it work properly:

1. Delete the existing table content. It should be possible to do in XML, but I don't know how. I use SQL for such purposes:

Code:
DELETE FROM MinorCivilizations;
DELETE FROM MinorCivilization_CityNames;
DELETE FROM MinorCivilization_Flavors;

You should make the mod execute this SQL code (use OnModActivated -> UpdateDatabase, just like for XML files) before your XML file with minor civs (the order of files that update the database is important, use the "Move Up" and "Move Down" buttons in the ModBuddy to change the order).

2. Remove the table definitions at the beginning of the XML file (everything between the "table definition" and "table data" comments).

3. Use the following SQL code that is executed after your XML file:

Code:
CREATE TABLE IDRemapper ( id INTEGER PRIMARY KEY AUTOINCREMENT, Type TEXT );
INSERT INTO IDRemapper (Type) SELECT Type FROM MinorCivilizations;
UPDATE MinorCivilizations SET ID = ( SELECT IDRemapper.id-1 FROM IDRemapper WHERE MinorCivilizations.Type = IDRemapper.Type);
DROP TABLE IDRemapper;

(See this thread for details about deleting stuff in mods.)

Another strange things is that my test-map can't be selected if it is only in the mod directory. It has to be in the primary map folder.

Set "Import into VFS" to true for the map file (in the file properties in ModBuddy).
 
Thanks a lot!

Everything worked except the map issue. I still can't select the map if it's not under \My Games\Sid Meier's Civilization 5\Maps

Actually it's just a minor problem because I just have to put the file there, but I still like to know what's my mistake in order to improve my modding-skills.
 
About the map issue: I think you should add it to the "Content" tab of the mod properties (Type should be Map), I forgot about it when writing my previous post. But, IIRC, it should still have VFS set to true.
 
Top Bottom