SaveUtilities / Storing Plots through a Saved Game

turingmachine

Emperor
Joined
May 4, 2008
Messages
1,438
Hi, I've noticed several of the higher quality civ mods use a "SaveUtils" lua file to store information for when you save a game.

This would be extremely helpful. Sadly, I have no idea how to use it :(

My mod stores several plots throughout the game. I know how to store them and reference them for that current game, but all the info is lost if you save/reload.

I need to know how to save these plots to the save utilities and then at the start of a loaded game how to add these plots back to a table so that I can loop through them at a later time.

Any advice would be appreciated. Thanks!
 
Tutorials and Utilities for saving data across save & reload of games.
  1. Pazyrk's Table Saver/Loader
  2. The Modwiki's Persisting Data (CIV5) page
  3. Whys' SaveUtils.lua thread page
  • There is also a "NewSaveUtils.lua" floating around the forum somewhere, but I don't have the link reference handy.
  • Plus there is one other Reference thread related to saving data across save/load of games but I am not sure how 'old' it is terms of methods commonly used now as opposed to when the game was originally released: robk's [REFERENCE] Storing data across saved games from LUA
 
I've come across similar with something I've been playing around with on and off. In my case, I think it's the result of table IDs not actually being unique, so the result is information appears to not be saved correctly, when in fact it's being over-written (say, by the last set of values taken in a loop etc).

Might not be the same for you, but could be worth a check, especially if you're creating IDs through adding PlotX to PlotY, which I'd assume would potentially creat duplicated values at some point.
 
Top Bottom