Doing something with an X turn delay

Aldollin

Chieftain
Joined
Mar 7, 2017
Messages
87
So i was thinking about an (unique) improvement that would spawn a resource on the tile it is build on.
Got that to work with some lua code.

To make it somewhat more intresting i wanted the resource spawn to happen x turns later. I found a way to do that, making a list with the locations where resources should spawn and the time it should take, counting down that time at the end of every turn then spawning the resource when it hits 0

This has one rather annoying problem: saving/loading the game

Since i dont know how to "save" the list i dont have a better way than to simply have the countdown start fresh from reloading (using the ImprovementAddedToMap event)

Does anyone have an idea to get around this? Any way to save the list of remaining countdowns going on?
 
Back
Top Bottom