ToTPP Map Functions

ThichN

Chieftain
Joined
Aug 15, 2022
Messages
31
Hi all,

I have a few questions about what is possible with ToTPP, lua, and map functions, and how I register this. @JPetroski helped me with adding the new terrain types to a scenario (thank you!), so this is building off that, and some other questions. I am not 100% sure on any of this yet, but that is part of the adventure: figuring out what is possible!

1. How are you all making your maps with the new terrain types? Is there a handy editor aside from the Civ2 map editor that I've missed somewhere, or is it all about editing the terrain in-game through cheat mode?

2. I am able to get the game to register the new extended terrain types, but cannot necessarily place them all in game. Am I missing something?

3. I am considering 3 overland maps, with 1 map for detailed gameplay in certain zones. The 3 overland maps should connect through adjacency, which I read somewhere is possible (NOTE: this is only for the human player, and I do not need the AI to traverse the maps). I realize before lua, these were stacked like an elevator; but, could the 1 map for detailed gameplay zones connect to all 3 maps somehow, without units needing to teleport to the same coordinates read on all maps? So imagine the 3 maps being read right to left (east to west), but another 4th map that connects to certain parts of all of them.

4. On that note (#3 above), I may want the player to be unable to return to the previous map (cannot move back eastward) -- and furthermore, I want settlements in the detailed zone map (Map 4) to be "given" to another civ. I know that's possible with lua, but is it possible to cover those zones with fog of war again, as well, so that the player is not distracted by them or cannot reference them?

Happy to explain more if any of these goals are unclear. Thank you as usual!
 

Prof. Garfield

Deity
Supporter
Joined
Mar 6, 2004
Messages
3,939
Location
Ontario
1. How are you all making your maps with the new terrain types? Is there a handy editor aside from the Civ2 map editor that I've missed somewhere, or is it all about editing the terrain in-game through cheat mode?

2. I am able to get the game to register the new extended terrain types, but cannot necessarily place them all in game. Am I missing something?
I don't think there is a map editor available that uses the extra terrain tiles. (But I could be mistaken.) However, when cheat mode is active in TOTPP, you can place terrain with a key press. 1-9 and 0 do the standard terrains (except ocean). Ctrl+3 through Ctrl+8 does ocean and extra terrain. Ctrl+1 and Ctrl+2 place special tiles, and Ctrl+0 removes them. Ctrl+9 toggles rivers. Letter keys place terrain improvements (e-airbase, r-road, i-irrigation, o-railroad, p-pollution, f-fortress, l-farmland, m-mine).

3. I am considering 3 overland maps, with 1 map for detailed gameplay in certain zones. The 3 overland maps should connect through adjacency, which I read somewhere is possible (NOTE: this is only for the human player, and I do not need the AI to traverse the maps). I realize before lua, these were stacked like an elevator; but, could the 1 map for detailed gameplay zones connect to all 3 maps somehow, without units needing to teleport to the same coordinates read on all maps? So imagine the 3 maps being read right to left (east to west), but another 4th map that connects to certain parts of all of them.
To do this, you will have to use Lua to teleport units by events

teleportUnit
civ.teleportUnit(unit, tile) -> void

Teleports (i.e. moves at no cost) unit `unit` to tile `tile`. The unit is moved regardless of whether it is a valid location for the unit. To check this, see `civ.canEnter` and `civlua.isValidUnitLocation`.

teleport
unit:teleport(tile) -> void

Alias for `civ.teleportUnit(unit, tile)`.

If only the human player has to move between maps, the easiest way to do it is with a key press event. When a particular key is pressed, you check if the active unit is in the part of the map where it can move to the next map, and, if so, teleport it there.

4. On that note (#3 above), I may want the player to be unable to return to the previous map (cannot move back eastward) -- and furthermore, I want settlements in the detailed zone map (Map 4) to be "given" to another civ. I know that's possible with lua, but is it possible to cover those zones with fog of war again, as well, so that the player is not distracted by them or cannot reference them?
For one way travel, you just don't write the event that lets them travel in the other direction.

It is possible to cover map tiles. The General Library even has functions to facilitate the process.
 

ThichN

Chieftain
Joined
Aug 15, 2022
Messages
31
This is great, @Prof. Garfield , thank you as usual!

One quirk I am having is that 3, 4, and 5 on my keyboard return the Terrain2.bmp tiles. Is this because those tiles in Terrain1.bmp serve as under-layers?
 

Prof. Garfield

Deity
Supporter
Joined
Mar 6, 2004
Messages
3,939
Location
Ontario
One quirk I am having is that 3, 4, and 5 on my keyboard return the Terrain2.bmp tiles. Is this because those tiles in Terrain1.bmp serve as under-layers?
If I understand what you are saying, then yes. In the base game, hills, forests, and mountains change their appearance based on whether adjacent tiles are of the same terrain type. That is why they get data from Terrain2.bmp to overlay on Terrain1.bmp. I suppose you could make the relevant Terrain2 transparent if you only want Terrain1. (I haven't done this myself, so there is a chance I am wrong.)
 
Joined
Feb 11, 2012
Messages
828
I don't think there is a map editor available that uses the extra terrain tiles. (But I could be mistaken.) However, when cheat mode is active in TOTPP, you can place terrain with a key press. 1-9 and 0 do the standard terrains (except ocean). Ctrl+3 through Ctrl+8 does ocean and extra terrain. Ctrl+1 and Ctrl+2 place special tiles, and Ctrl+0 removes them. Ctrl+9 toggles rivers. Letter keys place terrain improvements (e-airbase, r-road, i-irrigation, o-railroad, p-pollution, f-fortress, l-farmland, m-mine).
Hi ThichN,

These are items #35 and #56 in the ToTPP v0.18 reference guide.

Hi all,

I have a few questions about what is possible with ToTPP, lua, and map functions, and how I register this. @JPetroski helped me with adding the new terrain types to a scenario (thank you!), so this is building off that, and some other questions. I am not 100% sure on any of this yet, but that is part of the adventure: figuring out what is possible!

As the Prof. said there is no Civ2 game editor that handles the extra terrain types but they are very easy to add in using the Cheat mode when in ToTPP. Here's a quick cheat sheet:


Terrain cheats.png
 
Last edited:

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
I suppose you could make the relevant Terrain2 transparent if you only want Terrain1. (I haven't done this myself, so there is a chance I am wrong.)
I have done it and I confirm it works perfectly fine, just make the tiles in terrain2 transparent.
 
Top Bottom