Lua dump map to text script?

primordial stew

Emperor
Joined
Sep 1, 2005
Messages
1,219
Location
a puddle
Does anyone happen to have something which dumps the contents of the map to a text file?

I need to dump improvements (mines, roads, etc..), units, and cities along with their contents (buildings, culture). I have a bunch of cities, etc on the map currently, but the future of this approach is too much work. So I want to dump it to text, clear it off, and then create the scenario specific elements during initialization. The base map will only have the terrain and resources. This map will support 4 different scenarios.

civIII + civIV had text maps, so using a text editor one could make substantial changes very quickly. Now in civ5 it's binary. The map is slow to load, and has no "search + replace" functions. With text I can quickly change the unit type (or delete all units), or civID to be appropriate, but with binary it's a major rework each time.

I've got the lua to load different code depending on the scenario name, just need stuff to load! Dumping the existing contents will be a great start.
 
I wrote something for units (see post #17 of http://forums.civfanatics.com/showthread.php?p=12219187). dapting that for roads/rails, improvements and buildings in cities wouldn't be too hard. City placement is slightly more complicated as you have to deal with tile ownership/working - IGE is a good place to look for the complexities of such code
 
I wrote something for units (see post #17 of http://forums.civfanatics.com/showthread.php?p=12219187). dapting that for roads/rails, improvements and buildings in cities wouldn't be too hard. City placement is slightly more complicated as you have to deal with tile ownership/working - IGE is a good place to look for the complexities of such code

It's a start!

What/where is IGE?


Actually, I think I'll just write a perl script to convert the civ4 scenario data (units, cities, improvements) to civ5 lua format. I hope that method will work :/ It did for the tech tree.
 
Back
Top Bottom