Someone asked me about this topic in a PM since IGE provided me a good experience about map manipulation and I made this detailled answer. Unfortunately it won't be used but I thought it could interest some people, so I chose to make it public rather than go to waste, who knows...
EDIT: In the end I was wrong on one of my assumptions and such a feature was actually quite straightforward to achieve, see post #10.
So, the basic idea, would be to just recall the map generation script (seems possible) but it has a very difficult flaw: if you change the terrain to put water under a land unit (and vice-versa), the unit is destroyed. And if both the two units of a civ disappear, then it's dead. While it may be possible to resurrect a civ (there is a function for that I think, at least for city-states), if it's your civ, it's automatic game over. So basically it seems to not be a workable way. A few notes though:
Third solution: all standard map scripts, and many custom map scripts, rely on a common file full of functions dedicated to map generation. Maybe you can use that to mix the first two solutions : use standard map scripts and just modify the common file to make units embark/move/etc before the hex modification.
Anyway, the first thing you may want to check is whether you can get the map script and run it. Whether it is possible or not, the first and third solutions may not be achievable at all. The second one, however, is 100% doable, I guarantee it, but it imposes a map script on the user and may ignore his settings.
EDIT: In the end I was wrong on one of my assumptions and such a feature was actually quite straightforward to achieve, see post #10.
So, the basic idea, would be to just recall the map generation script (seems possible) but it has a very difficult flaw: if you change the terrain to put water under a land unit (and vice-versa), the unit is destroyed. And if both the two units of a civ disappear, then it's dead. While it may be possible to resurrect a civ (there is a function for that I think, at least for city-states), if it's your civ, it's automatic game over. So basically it seems to not be a workable way. A few notes though:
- The map script's filename can be gotten from PreGame.GetMapScript (not sure it works once the game has been started though - if it does not, this basic solution is hopeless). After that one may be able to use "include" or something like that to import it, then run it due to the interpreted nature of LUA.
- The insta gameover is what I see when I manually use IGE. Maybe, if you do everything in a row and do not leave civ5 the chance to run its algorithms, you can avoid it but I doubt that.
- You could add one warrior of every civ on every tile. Tow units of different civs can overlap, no problem. But units close to each other trigger diplomatic contact, you would reveal ruins (and trigger notifications, you would need to replace the standard notifications stack) and fog (but fog can be restored) and such, etc. See previous remark though: the triggers may not be event-driven but something civ5 only check once in a while, although I think it is unlikely. And you can also not put a warrior on *every* tile.
- You could bet on the first and last rows of tiles to be always oceans, embark your units and spread them on those rows (units can be teleported without consuming movements points). Some maps won't work with that, though and there would be a problem with crowded maps.
Third solution: all standard map scripts, and many custom map scripts, rely on a common file full of functions dedicated to map generation. Maybe you can use that to mix the first two solutions : use standard map scripts and just modify the common file to make units embark/move/etc before the hex modification.
Anyway, the first thing you may want to check is whether you can get the map script and run it. Whether it is possible or not, the first and third solutions may not be achievable at all. The second one, however, is 100% doable, I guarantee it, but it imposes a map script on the user and may ignore his settings.