Page 1 of 1

How to restore a table from a saved game? Is there a way?

Posted: Sat Jan 18, 2025 8:41 am
by leo.priori
I'm sorry if this is an old topic, but so far.
What can we know about this part? What are the items or variables that I could retrieve from a Load?

My idea is to create a global table from turn 1 and feed it with the IDs of some cities.
However, if I load a saved game, this table is reset.
Is there a way to restore it? How?
Thanks

Re: How to restore a table from a saved game? Is there a way?

Posted: Mon Jan 20, 2025 5:18 pm
by Molo_Parko
Don't use a table at all (they are broken for reloading), but rather pack the values into a string using a separator such as the pipe symbol ( "|" ), then extract the values by position in the string. Example in post at link.
https://forum.freeciv.org/f/viewtopic.p ... 07#p110007