Available Objects in LUA

SoehnelS

Chieftain
Joined
May 22, 2018
Messages
6
Hello!

I started coding with LUA to get the possibility for more Statistics.
(In a far away future I want to create political maps.)

Thanks to the helpfull posts of different peoples here!

In a first step I want to save data in an external file, without success (only the Lua.log is possible).
First question: Is there a way to save data in an own file? (so it not get lost when restart the game, for example).

Actually I get it how to save data from the map (Map.GetPlotByIndex()).
I also get the turn number (Game.GetCurrentGameTurn()).
Not working is the Calendar-object (Calendar.MakeYearStr(TurnNumber)).
In FireTuner it is working, when I change to "InGame".
Second question: What I have todo, to get it working in my script too? (Something to include or different deffinition in modinfo?)

Thanks in advance!

Spoiler modinfo :

PHP:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="b70aa6c7-760a-43ce-a877-5535f1b05be7" version="1">
  <Properties>
    <Name>SoehnelS01</Name>
    <Description>First LUA-Test</Description>
    <Teaser>First LUA-Test</Teaser>
    <Authors>SoehnelS</Authors>
  </Properties>
  <Files>
     <File>SoehnelS01.lua</File>
  </Files>
  <InGameActions>
       <AddGameplayScripts id="SoehnelS01">
       <File>SoehnelS01.lua</File>
     </AddGameplayScripts>
  </InGameActions>
</Mod>


Spoiler lua :

PHP:
-- MainScript
-- Author: SoehnelS
-- DateCreated: 5/20/2018 7:35:33 PM
--------------------------------------------------------------

print ("Loaded SoehnelS01.lua")

--include( "InstanceManager" );
--include( "SupportFunctions" );
--include( "Civ6Common" );
--include( "LuaClass" );
--include("GameCapabilities");
--include "AssignStartingPlots"
--include( "ToolTipHelper_PlayerYields" );
--include("TabSupport");
--include("AnimSidePanelSupport");
--include("TeamSupport");

function PrintMap()
    local iPlotCount = Map.GetPlotCount();
    for iPlotLoop = 0, iPlotCount-1, 1 do
        local bData = false
        local plot = Map.GetPlotByIndex(iPlotLoop)
        local NEOfCliff = 0
        local WOfCliff = 0
        local NWOfCliff = 0
        if plot:IsNEOfCliff() then NEOfCliff = 1 end
        if plot:IsWOfCliff() then WOfCliff = 1 end
        if plot:IsNWOfCliff() then NWOfCliff = 1 end
        local NEOfRiver = 0
        local WOfRiver = 0
        local NWOfRiver = 0
        if plot:IsNEOfRiver() then NEOfRiver = 1 end -- GetRiverSWFlowDirection()
        if plot:IsWOfRiver() then WOfRiver = 1 end -- GetRiverEFlowDirection()
        if plot:IsNWOfRiver() then NWOfRiver = 1 end -- GetRiverSEFlowDirection()
        print("MapToConvert["..plot:GetX().."]["..plot:GetY().."]={"..plot:GetTerrainType()..","..plot:GetFeatureType()..","..plot:GetContinentType()..",{{"..NEOfRiver..","..plot:GetRiverSWFlowDirection().. "},{"..WOfRiver..","..plot:GetRiverEFlowDirection().."},{"..NWOfRiver..","..plot:GetRiverSEFlowDirection().."}},{"..plot:GetResourceType(-1)..","..tostring(1).."},{"..NEOfCliff..","..WOfCliff..","..NWOfCliff.."}}")
    end
end

function PrintPlayerInformations()
   -- Create list of Civilizations and leaders in game
   for iPlayer = 0, PlayerManager.GetWasEverAliveCount() - 1 do
       local CivilizationTypeName = PlayerConfigurations[iPlayer]:GetCivilizationTypeName()
       local LeaderTypeName = PlayerConfigurations[iPlayer]:GetLeaderTypeName()
       local IsInGame = PlayerConfigurations[iPlayer]:IsAlive()
--    IsInGame = "UNKNOWN"
       print("ID: " .. tostring(iPlayer) .. ": Civilization: " .. CivilizationTypeName .. ": Leader: " .. LeaderTypeName .. ": Active: " .. IsInGame)
   end
end

function ListPlayers()
   local listItems = {};
   local i = 1;
   local aPlayers = PlayerManager.GetAlive();
   for _, pPlayer in ipairs(aPlayers) do
       
           local pPlayerConfig = PlayerConfigurations[pPlayer:GetID()];
           local str = tostring(pPlayer:GetID()) .. ";";
           str = str .. pPlayerConfig:GetNickName();
               
           listItems[i] = str;
        i = i + 1;
   end
   
   return listItems;
end

function writetofile(Data)
       TurnNumber = Game.GetCurrentGameTurn();
       if TurnNumber == nil then
           TurnNumber = 0
       end;
--       strDate = Calendar.MakeYearStr(TurnNumber);
    strDate ="UNKNOWN"
    print( Data .. "------------------------------------------------------------");
    print("Year: " .. strDate .. ": Turn: " .. TurnNumber);
  --  PrintPlayerInformations()
    PrintMap()
     --file = io.open("SoehnelS01.txt", "a")
    -- file:write("hello", "\n")
    --file:write(TextLine, "\n")
    --file:close()
    print( Data .. "------------------------------------------------------------");
end

function SoehnelSUpdate()
   Data = os.date("%Y.%m.%d %H%M%S")
  print("Start update " .. Data);
  writetofile(Data)
   Data = os.date("%Y.%m.%d %H%M%S")
   print("End Update " .. Data);
end -- function Update
Events.TurnBegin.Add(SoehnelSUpdate);
 
First Answer : https://forums.civfanatics.com/threads/saving-loading-simple-tables-with-a-game.609397/ , I save my table with it

And I don't understand your second question but I put my scripts like that in the modinfo :
<Components>
<GameplayScripts id="id">
<Items>
<Properties>
<LoadOrder>1</LoadOrder>
</Properties>
<File>FolderName/MySCRIPT.lua</File>
</Items>
</GameplayScripts>
</Components>


and if what you search is to link UI context with script context you need to use LuaEvents
 
Many Thanks!
This table save is very interesting, I will try it later.

Any Idea, how to access the Calendar (like Calendar.MakeYearStr) from the LUA-Script?
 
What do you have in your lua.log?
I have "attempt to index a nil value" when I try to use Calendar.MakeYearStr(Game.GetCurrentGameTurn()); in script context

but it work with UI context so I guess you should try to get it with a UI context file and use a luaEvents or transform your file in an UI context if you don't use any script context function
 
Yes, exactly what you wrote is in the log.

I have not really much, at least not much enough knowledge to get both working together (my current script part and the Calendar).
I tried your sample modinfo, but like expected, my script didn't get the event then.

Maybe I will try to find out, how the MakeYearStr function is working and rebuild it in my script,
so I can start using the "Saving/Loading simple tables with a game" writen by Gedemon, usefully provided by you. :)

At least I have two ASCII-Art like maps (one for land and water, one for the owner) in the log with some extra information of the players.

Anyway, I have to learn a lot, but it starts working and make fun... :)

Thanks again for your help! :)
 
Finally I got what I wanted...and learned a lot of the database and lua in Civ6... :p

Just for Information:
Spoiler Result in Lua.log :

PHP:
SoehnelS01: Start update 2018.05.25 230357
SoehnelS01: ------------------------------------------------------------
SoehnelS01: Year: -3920: Turn: 3
SoehnelS01: ID: 00: Berber Empire (Dihya): Active: true: Units: 1: Money: 15: Income: 5: Color: -971182398
SoehnelS01: ID: 01: Indonesisches Reich (Gitarja): Active: true: Units: 1: Money: 10: Income: 6: Color: -1552319097
SoehnelS01: ID: 02: Reich der Cree (Poundmaker): Active: true: Units: 1: Money: 16: Income: 6: Color: -927759162
SoehnelS01: ID: 03: Pawnee Empire (Crooked Hand): Active: true: Units: 1: Money: 16: Income: 6: Color: 795375747
SoehnelS01: ID: 04: Stadtstaat Armagh: Active: true: Units: 2: Money: 17: Income: 7: Color: 1951711831
SoehnelS01: ID: 05: Stadtstaat La Venta: Active: true: Units: 2: Money: 15: Income: 5: Color: -1594541388
SoehnelS01: ID: 06: Salé city-state: Active: true: Units: 2: Money: 16: Income: 6: Color: -164559434
SoehnelS01: ID: 07: Stadtstaat Sansibar: Active: true: Units: 2: Money: 15: Income: 5: Color: -409149647
SoehnelS01: ID: 08: Stadtstaat Nan Madol: Active: true: Units: 2: Money: 15: Income: 5: Color: -1860127671
SoehnelS01: ID: 09: Stadtstaat Mohenjo-Daro: Active: true: Units: 2: Money: 15: Income: 5: Color: -1992743837
SoehnelS01: ID: 62: Freie Städte: Active: true: Units: 0: Money: 0: Income: 0: Color: -1907075578
SoehnelS01: ID: 63: Barbarenland: Active: true: Units: 4: Money: 0: Income: 0: Color: -1758762461
SoehnelS01: MapOwner:[37]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[36]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|  |-1|-1|-1|  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[35]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |  |-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[34]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[33]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[32]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[31]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |-1|  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[30]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|04|04|-1|-1|-1|-1|  |-1|-1|05|05|  |  |  |  |  |
SoehnelS01: MapOwner:[29]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|04|04|04|-1|-1|-1|-1|-1|-1|-1|05|05|-1|-1|  |  |  |
SoehnelS01: MapOwner:[28]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|04|04|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |
SoehnelS01: MapOwner:[27]  |  |  |  |  |  |  |-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |-1|-1|  |  |
SoehnelS01: MapOwner:[26]  |  |  |  |  |-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |-1|  |  |
SoehnelS01: MapOwner:[25]-1|  |  |-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |
SoehnelS01: MapOwner:[24]-1|  |  |-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[23]-1|  |  |-1|-1|-1|01|01|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |07|07|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[22]-1|  |  |-1|-1|-1|01|01|01|-1|-1|-1|  |  |  |  |  |  |-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |07|07|  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|02|02|-1|
SoehnelS01: MapOwner:[21]-1|  |  |  |-1|-1|01|01|-1|-1|-1|-1|-1|-1|  |-1|  |-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|02|02|02|-1|
SoehnelS01: MapOwner:[20]-1|  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|06|06|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|02|02|-1|
SoehnelS01: MapOwner:[19]-1|  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|06|06|06|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[18]-1|  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|06|06|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |-1|-1|-1|-1|
SoehnelS01: MapOwner:[17]-1|  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|  |-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[16]-1|  |  |  |  |08|08|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|03|03|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[15]-1|  |  |  |  |08|08|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|03|03|03|-1|-1|-1|-1|  |-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[14]-1|  |  |  |  |08|08|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|03|03|-1|-1|-1|-1|  |-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[13]-1|  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|  |-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[12]-1|  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|
SoehnelS01: MapOwner:[11]  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|  |-1|-1|
SoehnelS01: MapOwner:[10]  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|09|09|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|  |  |  |  |
SoehnelS01: MapOwner:[09]  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|00|00|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|09|09|09|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|  |  |  |  |  |
SoehnelS01: MapOwner:[08]  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|00|00|00|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|09|09|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|  |  |  |  |  |  |
SoehnelS01: MapOwner:[07]  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|00|00|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[06]  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[05]  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[04]  |  |  |  |  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[03]  |  |  |  |  |  |  |  |  |  |-1|-1|-1|  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[02]  |  |  |  |  |  |  |  |  |  |-1|-1|  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[01]  |  |  |  |  |  |  |  |  |  |-1|  |  |  |  |  |  |-1|-1|-1|-1|-1|-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: MapOwner:[00]  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |-1|-1|-1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
SoehnelS01: ------------------------------------------------------------
SoehnelS01: End Update 2018.05.25 230357


Spoiler function GetYearFromTurn :

PHP:
function GetYearFromTurn(TurnNumber)
    local SpeedType = GameInfo.GameSpeeds[GameConfiguration.GetGameSpeedType()].GameSpeedType -- GAMESPEED_STANDARD
    local StartYear = GameConfiguration.GetStartYear()
    local MonthIncrement = 0
    local TurnsPerIncrement = 0
    local TurnsToWork = TurnNumber
    local YearsGone = 0
    
    for xItem in GameInfo.GameSpeed_Turns() do
        if xItem.GameSpeedType == SpeedType then
            MonthIncrement = xItem.MonthIncrement
            TurnsPerIncrement = xItem.TurnsPerIncrement
            if TurnsToWork > 0 then
                if TurnsToWork <= TurnsPerIncrement then
                    YearsGone = YearsGone + (TurnsToWork * (MonthIncrement / 12))
                    TurnsToWork = TurnsToWork - TurnsToWork
                else
                    YearsGone = YearsGone + (TurnsPerIncrement * (MonthIncrement /12))
                    TurnsToWork = TurnsToWork - TurnsPerIncrement
                end
            else
                do return StartYear + YearsGone end
            end
        end
    end
    if TurnsToWork > 0 then
        YearsGone = YearsGone + (TurnsToWork * (MonthIncrement / 12))
    end
    return StartYear + YearsGone
end
 
Top Bottom