Steam.GetCloudSaves (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Steam.

This is a static method, invoke it with a dot.


Obtains information about all Steam Cloud saved games


Usage

table(SpecialistType => FileHeader) Steam.GetCloudSaves()


Returned Value

Returns an list of tables where each table is information about a specific save.
The table is indexed by the save slot number.
NOTE: Empty save slots are nil in the table and thus you should not iterate using ipairs.
Each save in the list has the following fields:
PlayerCivilization - The current player's Civilizations type.
GameSpeed - The GameSpeeds type.
StartEra - The starting Eras type.
CurrentEra - The current Eras type.
TurnNumber - The current turn number.
Difficulty - The HandicapInfos type currently in use.
WorldSize - The Worlds type currently in use.
MapScript- The name of the map script or Worldbuilder map used.
CivilizationName - The user-supplied Civilization Name.
LeaderName - The user-supplied Leader Name.
PlayerColor - The PlayerColor Type.
ActivatedMods - This is an array of tables.
Each activated mod entry has the following fields:
ModID - The GUID of the Mod.
Version - The Version of the Mod.


Examples

for i, save in pairs(Steam.GetCloudSaves()) do
local civ_description = GameInfo.Civilizations[saves.PlayerCivilization].Description;
local localized_civ = Locale.ConvertTextKey(civ_description);
print(string.format("Slot %i: %s - Turn %i", i, localized_civ, save.TurnNumber));
end


Source code samples

LoadMenu.lua

UI/FrontEnd/LoadMenu.lua
0707
g_CloudSaves = Steam.GetCloudSaves();


SaveMenu.lua

UI/InGame/Menus/SaveMenu.lua
0502
local cloudSaveData = Steam.GetCloudSaves();



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.