What am I doing wrong NOW?

Joined
Dec 11, 2022
Messages
2,494
So I managed to add multiple city-states without causing the game to crash on load-up. However, the city-states end up looking extremely odd, not to mention some of them are visible before being discovered, amongst other oddities. However, they seem to be functioning as city-states, they have quests and other civs do interact with them, but I can't open their city-state screens. See images below:
as.png


aaa.png
 
If you don't attach the actual mod, it is very hard to see what's wrong!
 
I tried adding my own custom colours for the city-sates. This is what the XML file for the colours looks like:
Code:
<GameData>
    <Colors>
        <Row>
            <ID>0</ID>
            <Type>PLAYERCOLOR_MINOR_GOLD1</Type>
            <Red>0.847</Red>
            <Green>0.753</Green>
            <Blue>0.157</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_LIGHT_RED2</Type>
            <Red>0.816</Red>
            <Green>0.439</Green>
            <Blue>0.376</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_G1</Type>
            <Red>0.941</Red>
            <Green>0.722</Green>
            <Blue>0.188</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_GREEN1</Type>
            <Red>0</Red>
            <Green>0.608</Green>
            <Blue>0.467</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_B1</Type>
            <Red>0.345</Red>
            <Green>0.471</Green>
            <Blue>0.565</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_GNG</Type>
            <Red>0.784</Red>
            <Green>0.753</Green>
            <Blue>0.816</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_RED2</Type>
            <Red>0.722</Red>
            <Green>0</Green>
            <Blue>0.188</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_LNKR</Type>
            <Red>0.973</Red>
            <Green>0.784</Green>
            <Blue>0.627</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_115</Type>
            <Red>0.847</Red>
            <Green>0.973</Green>
            <Blue>0.565</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_112</Type>
            <Red>0.565</Red>
            <Green>0.565</Green>
            <Blue>0.690</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_113</Type>
            <Red>0.941</Red>
            <Green>0.973</Green>
            <Blue>0.753</Blue>
            <Alpha>1</Alpha>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_111</Type>
            <Red>0.972</Red>
            <Green>0.878</Green>
            <Blue>0.596</Blue>
            <Alpha>1</Alpha>
        </Row>
    </Colors>
</GameData>

And the PlayerColors XML:
Code:
<GameData>
    <PlayerColors>
        <Row>
            <ID>0</ID>
            <Type>PLAYERCOLOR_MINOR_ABU_DHABI</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_GOLD1</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_AMMAN</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_LIGHT_RED2</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_CALABAR</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_G1</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_DERBENT</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_GREEN1</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_DUNBAR</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_B1</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_GANGTOK</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_GNG</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_IRQATA</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_RED2</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_LANKARAN</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_LNKR</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_MASSAWA</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_113</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_PUSHKALAVATI</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_111</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_SAGALA</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_115</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        <Row>
            <Type>PLAYERCOLOR_MINOR_TAMRALIPTA</Type>
            <PrimaryColor>COLOR_PLAYER_MINOR_ICON</PrimaryColor>
            <SecondaryColor>PLAYERCOLOR_MINOR_112</SecondaryColor>
            <TextColor>COLOR_PLAYER_PEACH_TEXT</TextColor>
        </Row>
        </PlayerColors>
</GameData>
 
Attach the complete mod. Dumping the xml into your posts is not helpful, as it means we have to create a mod to put them in, also you may not have the file attributes set correctly.
 
The mod, not the ModBuddy project. Hint: the link you need is in my sig!!!
 
You have errors in database.log
Code:
[541.125] PRIMARY KEY must be unique
[541.125] While executing - 'insert into Colors('ID', 'Type', 'Red', 'Green', 'Blue', 'Alpha') values (?, ?, ?, ?, ?, ?);'
[541.125] In XMLSerializer while inserting row into table insert into Colors('ID', 'Type', 'Red', 'Green', 'Blue', 'Alpha') with  values (0, PLAYERCOLOR_MINOR_GOLD1, 0.847, 0.753, 0.157, 1, ).
[541.125] In XMLSerializer while updating table Colors from file Colours.xml.
[541.125] PRIMARY KEY must be unique
[541.171] PRIMARY KEY must be unique
[541.171] While executing - 'insert into PlayerColors('ID', 'Type', 'PrimaryColor', 'SecondaryColor', 'TextColor') values (?, ?, ?, ?, ?);'
[541.171] In XMLSerializer while inserting row into table insert into PlayerColors('ID', 'Type', 'PrimaryColor', 'SecondaryColor', 'TextColor') with  values (0, PLAYERCOLOR_MINOR_ABU_DHABI, COLOR_PLAYER_MINOR_ICON, PLAYERCOLOR_MINOR_GOLD1, COLOR_PLAYER_PEACH_TEXT, ).
[541.171] In XMLSerializer while updating table PlayerColors from file PlayerColours.xml.
[541.171] PRIMARY KEY must be unique
being cause by specifying
Code:
<ID>0</ID>
The database auto-increments the ID column, so mods shouldn't (unless you have a very specific set of circumstances) give a value for it

There may be other errors, you need to check the log files
 
Running into issues with my city-state mod again. The mod does two things: it adds new city-states, and replaces some old ones. To replace old city-states I'm using the ReplaceKiev XML code as reference from Sas' Ukraine mod. So far it was running fine, but now Language_en_US names won't show up. The logs give me the following:
Code:
Prepared Statements:
Current:        12
------------------------------
[892661.156] no such column: Type
[892661.156] In Query - select * from Natural_Wonder_Placement where Type = ? LIMIT 1
[892785.750] columns StrategicViewType, TileType are not unique
[892785.750] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[892786.390] no such table: ContentPackage.LocalizedText
[892786.390] no such table: ContentPackage.LocalizedText
[892786.390] no such table: ContentPackage.LocalizedText
[892789.828] Validating Foreign Key Constraints...
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892789.828] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892791.921] Failed Validation.
[892792.359]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        8566848        78106568
PageCache:    7        14
LookAside:    0        0
Scratch:    0        1

Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    8140272        65212728
Scratch:    0        0

Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6664

Prepared Statements:
Current:        8
------------------------------
[892804.437] no such table: Language_zh_CN
[892804.437] In Query - insert into Language_zh_CN('Tag', 'Text') values (?, ?);
[892804.437] In XMLSerializer while updating table Language_zh_CN from file Localization/IGE_ZH_CN.xml.
[892806.671] Validating Foreign Key Constraints...
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892806.671] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[892807.078] Invalid Reference on MinorCivilizations.Adjective - "TXT_KEY_CITYSTATE_ZLATOGRAD_ADJ" does not exist in Language_en_US
[892807.078] Invalid Reference on MinorCivilizations.Adjective - "TXT_KEY_CITYSTATE_SINGUDUNUM_ADJ" does not exist in Language_en_US
[892807.078] Invalid Reference on MinorCivilizations.Adjective - "TXT_KEY_CITYSTATE_MRAUK_U_ADJ" does not exist in Language_en_US
[892807.078] Invalid Reference on MinorCivilizations.Adjective - "TXT_KEY_CITYSTATE_ARSAMOSATA_ADJ" does not exist in Language_en_US
[892807.078] Invalid Reference on MinorCivilizations.Adjective - "TXT_KEY_CITYSTATE_KALAT_ADJ" does not exist in Language_en_US
[892807.109] Invalid Reference on MinorCivilizations.ShortDescription - "TXT_KEY_CITYSTATE_ZLATOGRAD" does not exist in Language_en_US
[892807.109] Invalid Reference on MinorCivilizations.ShortDescription - "TXT_KEY_CITYSTATE_SINGUDUNUM" does not exist in Language_en_US
[892807.109] Invalid Reference on MinorCivilizations.ShortDescription - "TXT_KEY_CITYSTATE_MRAUK_U" does not exist in Language_en_US
[892807.109] Invalid Reference on MinorCivilizations.ShortDescription - "TXT_KEY_CITYSTATE_ARSAMOSATA" does not exist in Language_en_US
[892807.109] Invalid Reference on MinorCivilizations.ShortDescription - "TXT_KEY_CITYSTATE_KALAT" does not exist in Language_en_US
[892807.140] Invalid Reference on MinorCivilizations.Civilopedia - "TXT_KEY_CITYSTATE_ZLATOGRAD_PEDIA" does not exist in Language_en_US
[892807.140] Invalid Reference on MinorCivilizations.Civilopedia - "TXT_KEY_CITYSTATE_SINGUDUNUM_PEDIA" does not exist in Language_en_US
[892807.140] Invalid Reference on MinorCivilizations.Civilopedia - "TXT_KEY_CITYSTATE_MRAUK_U_PEDIA" does not exist in Language_en_US
[892807.140] Invalid Reference on MinorCivilizations.Civilopedia - "TXT_KEY_CITYSTATE_ARSAMOSATA_PEDIA" does not exist in Language_en_US
[892807.140] Invalid Reference on MinorCivilizations.Civilopedia - "TXT_KEY_CITYSTATE_KALAT_PEDIA" does not exist in Language_en_US
[892807.187] Invalid Reference on MinorCivilizations.Description - "TXT_KEY_CITYSTATE_ZLATOGRAD" does not exist in Language_en_US
[892807.187] Invalid Reference on MinorCivilizations.Description - "TXT_KEY_CITYSTATE_SINGUDUNUM" does not exist in Language_en_US
[892807.187] Invalid Reference on MinorCivilizations.Description - "TXT_KEY_CITYSTATE_MRAUK_U" does not exist in Language_en_US
[892807.187] Invalid Reference on MinorCivilizations.Description - "TXT_KEY_CITYSTATE_ARSAMOSATA" does not exist in Language_en_US
[892807.187] Invalid Reference on MinorCivilizations.Description - "TXT_KEY_CITYSTATE_KALAT" does not exist in Language_en_US
[892808.265] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_433" does not exist in Language_en_US
[892808.781] Failed Validation.
[892809.218]
. I've determined the the ReplaceCS.xml (which references TXT_KEY_CITYSTATE_XXX) and the Text.xml (which contains the Language_en_US entries) files are themselves fine, because I made a test mod that contains only those files, and it worked perfectly fine. However, the original mod is still giving the same errors. The logs previously mentioned the files for three (add not replace) city-states (Lankaran, Korla and a third) were throwing up errors. I disabled those files in Properties, but the issue remains unsolved, and I can't tell which file is causing it, and what error.
 
You need to read (and fix) the logs in the order
  1. stopwatch.log - did my mod's files get processed?
  2. xml.log - did my xml generate any errors?
  3. database.log - did my xml/sql execute correctly?
  4. lua.log - does my code work?
If you look at stopwatch.log, your text.xml file is never processed
 
Top Bottom