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

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

Posted: Sat Jul 04, 2026 4:55 am
by leo.priori
Hi Molo_Parko! First of all, I would like to apologize for the delay in
getting back to you. I want to say a HUGE thank you for that
sensational piece of information! It was a real game-changer that
brought me so much joy and allowed me to revive an old project that
had been shelved for a long time.

See you around, and thanks again!