Making a civ. Colour files do NOT apply

Discussion in 'Mod Creation Help' started by SlySlySly, Apr 3, 2017.

  1. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    Hallo. I need some help with my mod. Something is not working with it. I created custom colours, but they don't appear in game. What am I missing? I feel super lost. I checked everywhere and I don't know how it works...

    Colors
    Code:
    <GameInfo>
      <Colors>
        <Row>
          <Type>COLOR_PLAYER_RAITOROZU_PRIMARY</Type>
    
          <Red>0.255</Red>
    
          <Green>0.003</Green>
    
          <Blue>0.045</Blue>
    
          <Alpha>1</Alpha>
        </Row>
    
        <Row>
          <Type>COLOR_PLAYER_RAITOROZU_SECONDARY</Type>
    
          <Red>0</Red>
    
          <Green>0</Green>
    
          <Blue>0</Blue>
    
          <Alpha>1</Alpha>
        </Row>
      </Colors>
    </GameInfo>
    
    Color Defines
    Code:
    <GameInfo>
      <PlayerColors>
        <Row>
          <Type>LEADER_AKANE</Type>
    
          <Usage>Unique</Usage>
    
          <PrimaryColor>COLOR_PLAYER_RAITOROZU_PRIMARY</PrimaryColor>
    
          <SecondaryColor>COLOR_PLAYER_RAITOROZU_SECONDARY</SecondaryColor>
    
          <TextColor>COLOR_PLAYER_WHITE_TEXT</TextColor>
        </Row>
      </PlayerColors>
    </GameInfo>
    
    Leader Code
    Code:
    <GameInfo>
      <Types>
        <Row Kind="KIND_LEADER" Type="LEADER_AKANE"/>
    
        <Row Kind="KIND_TRAIT" Type="TRAIT_LEADER_KAGAKU"/>
      </Types>
    
      <Leaders>
        <Row InheritFrom="LEADER_DEFAULT" LeaderType="LEADER_AKANE"
             Name="LOC_LEADER_AKANE_NAME" SceneLayers="4"/>
      </Leaders>
    
      <LeaderTraits>
        <Row LeaderType="LEADER_AKANE" TraitType="TRAIT_LEADER_KAGAKU"/>
      </LeaderTraits>
    
      <Traits>
        <Row Description="LOC_TRAIT_LEADER_KAGAKU_DESCRIPTION"
             Name="LOC_TRAIT_LEADER_KAGAKU_NAME" TraitType="TRAIT_LEADER_KAGAKU"/>
      </Traits>
    
      <TraitModifiers>
        <Row ModifierId="TRAIT_BOOST_SCIENCE" TraitType="TRAIT_LEADER_KAGAKU"/>
    
        <Row ModifierId="TRAIT_TRADE_SCIENCE" TraitType="TRAIT_LEADER_KAGAKU"/>
      </TraitModifiers>
    
      <Modifiers>
        <Row>
          <ModifierId>TRAIT_BOOST_SCIENCE</ModifierId>
    
          <ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_PRODUCTION</ModifierType>
        </Row>
    
        <Row>
          <ModifierId>TRAIT_TRADE_SCIENCE</ModifierId>
    
          <ModifierType>MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD</ModifierType>
        </Row>
      </Modifiers>
    
      <ModifierArguments>
        <Row>
          <ModifierId>TRAIT_BOOST_SCIENCE</ModifierId>
    
          <Name>DistrictType</Name>
    
          <Value>DISTRICT_CAMPUS</Value>
        </Row>
    
        <Row>
          <ModifierId>TRAIT_BOOST_SCIENCE</ModifierId>
    
          <Name>Amount</Name>
    
          <Value>150</Value>
        </Row>
    
        <Row>
          <ModifierId>TRAIT_TRADE_SCIENCE</ModifierId>
    
          <Name>YieldType</Name>
    
          <Value>YIELD_SCIENCE</Value>
        </Row>
    
        <Row>
          <ModifierId>TRAIT_TRADE_SCIENCE</ModifierId>
    
          <Name>Amount</Name>
    
          <Value>2</Value>
        </Row>
      </ModifierArguments>
    
      <DiplomacyInfo>
        <Row BackgroundImage="LEADER_AKANE_BACKGROUND" Type="LEADER_AKANE"/>
      </DiplomacyInfo>
    
      <HistoricalAgendas>
        <Row AgendaType="AGENDA_TECHNOPHILE" LeaderType="LEADER_AKANE"/>
      </HistoricalAgendas>
    
      <AiListTypes>
        <Row ListType="AkaCivics"/>
    
        <Row ListType="AkaTechs"/>
    
        <Row ListType="AkaWonders"/>
      </AiListTypes>
    
      <AiLists>
        <Row LeaderType="TRAIT_LEADER_KAGAKU" ListType="AkaWonders"
             System="Buildings"/>
    
        <Row LeaderType="TRAIT_LEADER_KAGAKU" ListType="AkaCivics" System="Civics"/>
    
        <Row LeaderType="TRAIT_LEADER_KAGAKU" ListType="AkaTechs"
             System="Technologies"/>
      </AiLists>
    
      <AiFavoredItems>
        <Row Item="BUILDING_EIFFEL_TOWER" ListType="AkaWonders"/>
    
        <Row Item="BUILDING_GREAT_LIBRARY" ListType="AkaWonders"/>
    
        <Row Item="BUILDING_OXFORD_UNIVERSITY" ListType="AkaWonders"/>
    
        <Row Item="BUILDING_FORBIDDEN_CITY" ListType="AkaWonders"/>
    
        <Row Item="BUILDING_ESADIO_DO_MARACANA" ListType="AkaWonders"/>
    
        <Row Item="CIVIC_GAMES_AND_RECREATION" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_GUILDS" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_EXPLORATION" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_ENLIGHTENMENT" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_URBANIZATION" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_SUFFRAGE" ListType="AkaCivics"/>
    
        <Row Item="CIVIC_GLOBALIZATION" ListType="AkaCivics"/>
    
        <Row Item="TECH_SAILING" ListType="AkaTechs"/>
    
        <Row Item="TECH_SHIPBUILDING" ListType="AkaTechs"/>
    
        <Row Item="TECH_EDUCATION" ListType="AkaTechs"/>
    
        <Row Item="TECH_PRINTING" ListType="AkaTechs"/>
    
        <Row Item="TECH_SCIENTIFIC_THEORY" ListType="AkaTechs"/>
    
        <Row Item="TECH_WRITING" ListType="AkaTechs"/>
      </AiFavoredItems>
    </GameInfo>
    
     

    Attached Files:

    Last edited: Apr 3, 2017
  2. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I pasted the code in for ease.
     
  3. HandyVac

    HandyVac Gentleman

    Joined:
    Apr 24, 2014
    Messages:
    270
    Gender:
    Male
    Location:
    The shire where the oxen cross the river. UK.
    You forgot to add the files to the UpdateDatabase section of your modinfo. ;)
     
  4. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    Like this? Because it doesn't work
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Mod id="f19fe136-ff88-460f-950c-3bb65b157465">
      <!-- Basic Mod info -->
    
      <Properties>
        <Name>Raitorozu</Name>
    
        <Stability>Alpha</Stability>
    
        <Teaser>Raitorozu civilization</Teaser>
    
        <Description>LOC_MOD_DESCRIPTION</Description>
    
        <Authors>LOC_MOD_AUTHORS</Authors>
    
        <SpecialThanks>LOC_MOD_SPECIAL_THANKS</SpecialThanks>
      </Properties>
    
      <!--List of all files used in the mod-->
    
      <Files>
        <File>Raitorozu_Buildings.xml</File>
    
        <File>Raitorozu_Civilizations.xml</File>
    
        <File>Raitorozu_Config.xml</File>
    
        <File>Raitorozu_DiplomacyText.xml</File>
    
        <File>Raitorozu_Leaders.xml</File>
    
        <File>Raitorozu_PediaText.xml</File>
    
        <File>Raitorozu_text.xml</File>
    
        <File>Raitorozu_Units.xml</File>
    
        <File>Raitorozu_PlayerColours.xml</File>
    
        <File>Raitorozu_Colours.xml</File>
      </Files>
    
      <!--Objects loaded on game set up-->
    
      <Settings>
        <!--Updates to Configuration database (DebugConfiguration.sqlite)-->
    
        <Custom id="Raitorozu_Custom">
          <Items>
            <File>Raitorozu_Config.xml</File>
          </Items>
        </Custom>
    
        <!-- Localized Text for configuration screens -->
    
        <LocalizedText id="Raitorozu_LocalizedText2">
          <Items>
            <File>Raitorozu_text.xml</File>
          </Items>
        </LocalizedText>
      </Settings>
    
      <!--Objects loaded after the game starts-->
    
      <Components>
        <UpdateDatabase id="Raitorozu_UpdateDatabase">
          <!-- ones that start with GameInfo (DebugGameplay.sqlite)-->
    
          <Items>
            <File>Raitorozu_Buildings.xml</File>
    
            <File>Raitorozu_Civilizations.xml</File>
    
            <File>Raitorozu_Leaders.xml</File>
    
            <File>Raitorozu_Units.xml</File>
    
        <File>Raitorozu_PlayerColours.xml</File>
          </Items>
        </UpdateDatabase>
    
        <LocalizedText id="Raitorozu_LocalizedText">
          <!-- ones that start with GameData (DebugLocalization.sqlite)-->
    
          <Items>
            <File>Raitorozu_DiplomacyText.xml</File>
    
            <File>Raitorozu_PediaText.xml</File>
    
            <File>Raitorozu_text.xml</File>
    
        <File>Raitorozu_Colours.xml</File>
          </Items>
        </LocalizedText>
      </Components>
    
      <!--
        LocalizedText again but this time used only for modinfo.
        More aestethic alternative for direct text insert as we did for name, stability and teaser.
        -->
    
      <LocalizedText>
        <Text id="LOC_MOD_AUTHORS">
          <en_US>SlySlySly</en_US>
        </Text>
    
        <Text id="LOC_MOD_SPECIAL_THANKS">
          <en_US>NameArleadyUsed, [insert others who helped here]</en_US>
        </Text>
    
        <Text id="LOC_MOD_DESCRIPTION">
          <en_US>Raitorozu civilization [newline] Play as Akane Yuuka, President
          of Raitorozu [newline] more description [newline] [icon_production] fun
          stuff</en_US>
        </Text>
      </LocalizedText>
    </Mod>
    
     
  5. HandyVac

    HandyVac Gentleman

    Joined:
    Apr 24, 2014
    Messages:
    270
    Gender:
    Male
    Location:
    The shire where the oxen cross the river. UK.
    Yes, like that, but both files need to be in updatedatabase
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Mod id="f19fe136-ff88-460f-950c-3bb65b157465">
      <!-- Basic Mod info -->
      <Properties>
        <Name>Raitorozu</Name>
        <Stability>Alpha</Stability>
        <Teaser>Raitorozu civilization</Teaser>
        <Description>LOC_MOD_DESCRIPTION</Description>
        <Authors>LOC_MOD_AUTHORS</Authors>
        <SpecialThanks>LOC_MOD_SPECIAL_THANKS</SpecialThanks>
      </Properties>
      <!--List of all files used in the mod-->
      <Files>
        <File>Raitorozu_Buildings.xml</File>
        <File>Raitorozu_Civilizations.xml</File>
        <File>Raitorozu_Config.xml</File>
        <File>Raitorozu_DiplomacyText.xml</File>
        <File>Raitorozu_Leaders.xml</File>
        <File>Raitorozu_PediaText.xml</File>
        <File>Raitorozu_text.xml</File>
        <File>Raitorozu_Units.xml</File>
        <File>Raitorozu_PlayerColours.xml</File>
        <File>Raitorozu_Colours.xml</File>
      </Files>
      <!--Objects loaded on game set up-->
      <Settings>
        <!--Updates to Configuration database (DebugConfiguration.sqlite)-->
        <Custom id="Raitorozu_Custom">
          <Items>
            <File>Raitorozu_Config.xml</File>
          </Items>
        </Custom>
        <!-- Localized Text for configuration screens -->
        <LocalizedText id="Raitorozu_LocalizedText2">
          <Items>
            <File>Raitorozu_text.xml</File>
          </Items>
        </LocalizedText>
      </Settings>
      <!--Objects loaded after the game starts-->
      <Components>
        <UpdateDatabase id="Raitorozu_UpdateDatabase">
          <!-- ones that start with GameInfo (DebugGameplay.sqlite)-->
          <Items>
            <File>Raitorozu_Buildings.xml</File>
            <File>Raitorozu_Civilizations.xml</File>
            <File>Raitorozu_Leaders.xml</File>
            <File>Raitorozu_Units.xml</File>
            <File>Raitorozu_PlayerColours.xml</File>
            <File>Raitorozu_Colours.xml</File>
          </Items>
        </UpdateDatabase>
        <LocalizedText id="Raitorozu_LocalizedText">
          <!-- ones that start with GameData (DebugLocalization.sqlite)-->
          <Items>
            <File>Raitorozu_DiplomacyText.xml</File>
            <File>Raitorozu_PediaText.xml</File>
            <File>Raitorozu_text.xml</File>
          </Items>
        </LocalizedText>
      </Components>
      <!--
     LocalizedText again but this time used only for modinfo.
     More aestethic alternative for direct text insert as we did for name, stability and teaser.
     -->
      <LocalizedText>
        <Text id="LOC_MOD_AUTHORS">
          <en_US>SlySlySly</en_US>
        </Text>
        <Text id="LOC_MOD_SPECIAL_THANKS">
          <en_US>NameArleadyUsed, [insert others who helped here]</en_US>
        </Text>
        <Text id="LOC_MOD_DESCRIPTION">
          <en_US>Raitorozu civilization [newline] Play as Akane Yuuka, President
          of Raitorozu [newline] more description [newline] [icon_production] fun
          stuff</en_US>
        </Text>
      </LocalizedText>
    </Mod>
    
     
  6. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I think there's an error somewhere. The mod doesn't start. I click start game and it goes to home screen. Is there an error in the colors section? Cause it is the only thing added and the mod won't work now.
     
  7. HandyVac

    HandyVac Gentleman

    Joined:
    Apr 24, 2014
    Messages:
    270
    Gender:
    Male
    Location:
    The shire where the oxen cross the river. UK.
    Odd. It works for me.

    Here is your mod back with those two lines added to the modinfo file. That's the only change I made.

    I see the custom colours appearing as black on a dark red background.
     

    Attached Files:

  8. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I edited the files and got the same error again?...

    Is it just a glitch where when I edit files the game won't work? I mean, idk can you at least try it just to check?
     

    Attached Files:

  9. HandyVac

    HandyVac Gentleman

    Joined:
    Apr 24, 2014
    Messages:
    270
    Gender:
    Male
    Location:
    The shire where the oxen cross the river. UK.
    So I downloaded the new version and played it, and the game crashes back to the main menu when clicking start game.

    Log files are very useful for figuring out what's causing problems like this, and in Database.log I found the following error messages:
    Taking those one at a time, the first:
    Code:
    [949175.394] [Gameplay] ERROR: table StartBiasTerrains has no column named FeatureType
    [949175.394] [Gameplay]: In Query - insert into StartBiasTerrains('CivilizationType', 'FeatureType', 'Tier') values (?, ?, ?);
    [949175.394] [Gameplay]: In XMLSerializer while updating table StartBiasTerrains from file Raitorozu_Civilizations.xml.
    
    is saying that, in the file Raitorozu_Civilizations.xml, you're trying to add an entry to a column called FeatureType in the StartBiasTerrains table, but there is no such column.

    Looking at your code we see
    Code:
    <StartBiasTerrains>
        <Row CivilizationType="CIVILIZATION_RAITOROZU" FeatureType="TERRAIN_COAST"
             Tier="1"/>
      </StartBiasTerrains>
    
    but when we look at the same table in the base game file we can see that column should actually be called TerrainType. An easy mistake to make, because there's a similarly named StartBiasFeatures table that has a FeatureType column, and easily fixed:
    Code:
    <StartBiasTerrains>
     <Row CivilizationType="CIVILIZATION_RAITOROZU" TerrainType="TERRAIN_COAST"
             Tier="1"/>
      </StartBiasTerrains>
    
    and next time I run the game that error disappears from the log. Fixed.

    on to the next error:
    Code:
    ...
    [949175.400] [Gameplay] ERROR: Invalid Reference on CivilizationTraits.TraitType - "TRAIT_JIZEN" does not exist in Traits
    ...
    [949175.407] [Gameplay] ERROR: Invalid Reference on TraitModifiers.TraitType - "TRAIT_JIZEN" does not exist in Traits
    
    This is telling you that your code is referencing a trait called TRAIT_JIZEN, but no trait with that name exists in the Traits table.

    looking in your code, you've got the trait written as TRAIT_JIZEN in some places, but as TRAIT_CIVILIZATION_JIZEN in other places.

    If we change them all to TRAIT_CIVILIZATION_JIZEN, like so:
    Code:
    <CivilizationTraits>
        <Row CivilizationType="CIVILIZATION_RAITOROZU" TraitType="TRAIT_CIVILIZATION_JIZEN"/>
      </CivilizationTraits>
      <TraitModifiers>
        <Row>
          <TraitType>TRAIT_CIVILIZATION_JIZEN</TraitType>
          <ModifierId>GRANT_EXTRA_STARTING_AMENITIES_MODIFIER</ModifierId>
        </Row>
      </TraitModifiers>
    
    then that error disappears as well. Fixed.

    which leaves us with:
    Code:
    [949175.406] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_KAGAKU" does not exist in Types
    
    looking in your code, this is much the same problem as above, you have TRAIT_KAGAKU in some places and TRAIT_LEADER_KAGAKU in others.

    In this case, you're defining and using TRAIT_LEADER_KAGAKU properly in Raitorozu_Leaders.xml, but you also have a row defining TRAIT_KAGAKU in Raitorozu_Civilizations.xml, without using it anywhere:
    Code:
    <Traits>
        ...
        <Row Description="LOC_TRAIT_LEADER_KAGAKU_DESCRIPTION"
             Name="LOC_TRAIT_LEADER_KAGAKU_NAME" TraitType="TRAIT_KAGAKU"/>
      </Traits>
    
    If we just delete that row from Raitorozu_Civilizations.xml then the last error disappears, and the mod works. Working version attached.


    On windows, the log files are in "Documents\My Games\Sid Meier's Civilization VI\Logs". Not sure what the file path would be on mac, but it's probably the same place your mods and save files are. Database.log is a text file, so you should be able to open it in any text editor.
     

    Attached Files:

  10. Antagonise

    Antagonise Warlord

    Joined:
    May 4, 2014
    Messages:
    186
    Gender:
    Male
    Location:
    England
    Hi, I'm not sure if this is actually the solution but I was having the same problem as you using the same style of code, so I copied the code they used in the Macedon/Persia DLC instead and that worked. Maybe try this instead:

    Code:
    <Colors>
           <Row>
               <Type>COLOR_PLAYER_RAITOROZU_PRIMARY</Type>
               <Color>65,1,11,255</Color>
           </Row>
           <Row>
               <Type>COLOR_PLAYER_RAITOROZU_SECONDARY</Type>
               <Color>0,0,0,255</Color>
           </Row>
       </Colors>
    
       <PlayerColors>
           <Row>
               <Type>LEADER_AKANE</Type>
               <Usage>Unique</Usage>
               <PrimaryColor>COLOR_PLAYER_RAITOROZU_PRIMARY</PrimaryColor>
               <SecondaryColor>COLOR_PLAYER_RAITOROZU_SECONDARY</SecondaryColor>
               <TextColor>COLOR_PLAYER_WHITE_TEXT</TextColor>
           </Row>
       </PlayerColors>
     
  11. SlySlySly

    SlySlySly Warlord

    Joined:
    Feb 8, 2017
    Messages:
    293
    Gender:
    Female
    Location:
    Denver
    I did find the logs and I just didn't know where to look before. Thanks for that, I feel slightly silly.
     

Share This Page