1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Issue setting games speed

Discussion in 'Mod Creation Help' started by Catharz, Jan 2, 2017.

  1. Catharz

    Catharz Chieftain

    Joined:
    Jan 2, 2017
    Messages:
    2
    Gender:
    Male
    Hi,

    I'm trying to convert my Civilization 5 mod to Civilization 6.
    The logs say the DB has been updated, and the new game speed is selectable from the menu.
    But as soon as I start the game I get a Lua error saying that GameSpeeds is nil.

    The list of GameSpeeds and the selected GameSpeed seem to be empty when in game.

    The code for the mod is as follows:
    MoreSpeed.modinfo
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Mod id="6260e866-60bc-4314-a183-6be87f4d27b3" version="1">
      <Properties>
        <Name>Fast game</Name>
        <Teaser>10x the speed of a normal game</Teaser>
        <Description>10x the speed of a normal game</Description>
        <Authors>Catharz</Authors>
        <ShowInBrowser>DLC</ShowInBrowser>
        <EnabledByDefault>0</EnabledByDefault>
        <AffectsSavedGames>1</AffectsSavedGames>
        <SupportsSinglePlayer>1</SupportsSinglePlayer>
        <SupportsMultiplayer>1</SupportsMultiplayer>
        <SupportsHotSeat>1</SupportsHotSeat>
      </Properties>
    
      <Files>
        <File>Data/MoreSpeed_GameInfo.xml</File>
        <File>Data/MoreSpeed_GameData.xml</File>
      </Files>
    
      <!-- This is where the data is supposed to be loaded -->
      <Components>
        <UpdateDatabase>
          <Items>
            <File>Data/MoreSpeed_GameData.xml</File>
          </Items>
        </UpdateDatabase>
      </Components>
    
      <!-- This is where More Speed gets added to the menu -->
      <Settings>
        <Custom id="MoreSpeedGameSetup">
          <Items>
            <File>Data/MoreSpeed_GameInfo.xml</File>
          </Items>
        </Custom>
      </Settings>
    </Mod>
    MoreSpeed_GameInfo.xml
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <GameInfo>
        <GameSpeeds>
            <Row
            GameSpeedType="GAMESPEED_MORE"
            Name="More Speed"
            Description="10x speed of normal"
            SortIndex="5"
            />
        </GameSpeeds>
    </GameInfo>
    MoreSpeed_GameData.xml
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <GameData>
      <Types>
            <Row Type="GAMESPEED_MORE" Kind="KIND_GAMESPEED"/>
      </Types>
    
        <GameSpeeds>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <Name>More speed</Name>
                <Description>10x speed of normal</Description>
                <CostMultiplier>10</CostMultiplier>
                <CivicUnlockMaxCost>10</CivicUnlockMaxCost>
                <CivicUnlockPerTurnDrop>1</CivicUnlockPerTurnDrop>
                <CivicUnlockMinCost>2</CivicUnlockMinCost>
            </Row>
      </GameSpeeds>
    
        <GameSpeed_Turns>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>1920</MonthIncrement>
                <TurnsPerIncrement>18</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>1200</MonthIncrement>
                <TurnsPerIncrement>15</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>960</MonthIncrement>
                <TurnsPerIncrement>6</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>480</MonthIncrement>
                <TurnsPerIncrement>12</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>240</MonthIncrement>
                <TurnsPerIncrement>15</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>96</MonthIncrement>
                <TurnsPerIncrement>12</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>48</MonthIncrement>
                <TurnsPerIncrement>30</TurnsPerIncrement>
            </Row>
            <Row>
                <GameSpeedType>GAMESPEED_MORE</GameSpeedType>
                <MonthIncrement>24</MonthIncrement>
                <TurnsPerIncrement>15</TurnsPerIncrement>
            </Row>
      </GameSpeed_Turns>
    </GameData>
    Any help would is appreciated.
     
    Last edited: Jan 3, 2017
  2. Elucidus

    Elucidus King

    Joined:
    Mar 3, 2002
    Messages:
    983
    Location:
    USA
    Well all of the settings used in maps are also stored int eh configuration database. This controls the drop downs and such in the create game portion of the game.

    In order to modify the configuration settings, you need to load the files in the <settings> section of your modinfo file.

    I had to do this to add an era. And I know that Horem changed gamespeeds by doing this in his Test of Time mod. I recommend you check it out.
     
  3. Catharz

    Catharz Chieftain

    Joined:
    Jan 2, 2017
    Messages:
    2
    Gender:
    Male
    Thanks Elucidus.

    I was getting consistent XML import errors, and only managed to resolve them by switching from XML to SQL for the GameSpeed and GameSpeed_Turns setup (as per Horem's mod).
    It seems the XML parsing isn't working 100% for Civ VI (or has changed substantially).

    My mod is working now though. I hit the renaissance period at turn 32 on my first play through.
     

Share This Page