xyx
Chieftain
- Joined
- Aug 7, 2013
- Messages
- 48
I needed this myself and was somewhat perplexed that noone seems to have created this in a way in needed this, sooo....
This script creates a (deterministic) mapscript from the currently displayed map, so you get an exact copy of a map and can use it as a regular mapscript. Everything on the map is preserved, including goody huts, but excluding other improvements, cities, and units.
This allows you to convert any predefined map (aka worldbuilder save aka scenario) or any other map for that matter to a mapscript and thus select the leaders and civilizations you like, use, partly use, or ignore the starting locations, leave or randomize bonuses and/or goody huts. If you always wanted to play a premade earth map (or wanted to replay a random map) with different leaders, different civs, a different number of civs, or different bonus distributions, this may be for you.
The script should work with any mod (though I did only limited testing). There's limited crossmod support, but don't expect this to work when trying to convert a map made with a mod that changes terrain, bonuses, features, or civilizations to another mod.
Usage
If you play with a mod, copy the created mapscript to the "private maps" folder in your mod directory, it won't work otherwise. You may rename the mapscript to your liking.
To play, just start a regular or custom game (do not open a scenario) and choose the created map. Pick the civs and leaders to your liking. You have the following options:
Starting Positions
As a teaser, see the saveMap_AccurateEarth script, which is a mapscript (for BTS) created from the Accurate Earth Map (132 x 64). If you pick the same 12 civs as defined in the Accurate Earth premade map (American, Aztec, Chinese, Egyptian, English (in South Africa), French (in Southeast Asia), Greek, Incan, Indian, Malinese, Mongolian, Persian), these will appear at their appropriate starting locations ("Fixed Starting") or randomly distributed across starting positions ("Fixed Starting with Random Assignment") or placed entirely at random ("Ignore Fixed"). If you swap one Civ (say, America) with another one (say, Spain), the latter will appear at the location of the first one (if using "Fixed Starting"). If you add additional civs, they will be placed wherever they fit. Bonuses will either appear as defined in the Accurate Earth map ("Fixed Bonuses") or are placed randomly ("Randomize Bonuses").
Finally a note on starting locations:
When run at gamestart, the script attempts to determine starting locations by obtaining the plot coordinates of the first settler of each civ. If there's no settler or when the script is run after the first game turn, the script resorts to the predefined starting locations. Always using the predefined starting location won't work reliably when civs are moved through the world builder. Unfortunately, the settler method is also somewhat unreliable in this case. The script prints the found settler (or starting location) of each civ to the console, so it makes sense to check whether all civs have been found. If something goes wrong, it might help to save and reload the wb file.
This is a modification of tywiggins save map script: https://apolyton.net/forum/civilization-iv/civilization-iv-creation/165900-python-save-map which somehow seems to have been forgotten.
This script creates a (deterministic) mapscript from the currently displayed map, so you get an exact copy of a map and can use it as a regular mapscript. Everything on the map is preserved, including goody huts, but excluding other improvements, cities, and units.
This allows you to convert any predefined map (aka worldbuilder save aka scenario) or any other map for that matter to a mapscript and thus select the leaders and civilizations you like, use, partly use, or ignore the starting locations, leave or randomize bonuses and/or goody huts. If you always wanted to play a premade earth map (or wanted to replay a random map) with different leaders, different civs, a different number of civs, or different bonus distributions, this may be for you.
The script should work with any mod (though I did only limited testing). There's limited crossmod support, but don't expect this to work when trying to convert a map made with a mod that changes terrain, bonuses, features, or civilizations to another mod.
Usage
- Put savemap.py file into Assets\Python
- Start a game or open a worlbuilder save
- open the python console (in cheatmode)
- enter: "import savemap"
- enter: "savemap.savemap()" or "savemap.savemap(x)" where x a number.
If you play with a mod, copy the created mapscript to the "private maps" folder in your mod directory, it won't work otherwise. You may rename the mapscript to your liking.
To play, just start a regular or custom game (do not open a scenario) and choose the created map. Pick the civs and leaders to your liking. You have the following options:
Starting Positions
- "Use Fixed Starting Locations": Assigns each civ to its defined starting position. If there is no starting position defined for particular civ, place it at another predefined location (if available). If there are more civs than starting position, place the unassigned civ somewhere else. So, if you play with Rome and England (but without Mali) on a map with starting positions for Rome and Mali (but none for England): Rome gets placed on Rome, England gets placed (a) on an unused defined starting location (such as Mali) or, if no location is left, (b) somewhere else.
- "Use Fixed Starting Locations, but assign Civs at Random": Assigns each civ at random to a predefined starting position. If there are more civs than starting position, place the unassigned civ somewhere else. So Greece might get the position of Zulu and Zulu might get the position of France and so on.
- "Ignore Fixed Locations": Civs get placed wherever they fit, predefined starting locations are ignored.
- "Use fixed Bonuses": Places bonuses as defined in the map
- "Randomize Bonuses": Bonuses are placed at random, predefined bonus locations are ignored.
- "Use fixed Goody Huts": Places Goody Huts as defined in the map
- "Randomize Goody Huts": Goody Huts are placed at random, predefined Goody Huts are ignored.
As a teaser, see the saveMap_AccurateEarth script, which is a mapscript (for BTS) created from the Accurate Earth Map (132 x 64). If you pick the same 12 civs as defined in the Accurate Earth premade map (American, Aztec, Chinese, Egyptian, English (in South Africa), French (in Southeast Asia), Greek, Incan, Indian, Malinese, Mongolian, Persian), these will appear at their appropriate starting locations ("Fixed Starting") or randomly distributed across starting positions ("Fixed Starting with Random Assignment") or placed entirely at random ("Ignore Fixed"). If you swap one Civ (say, America) with another one (say, Spain), the latter will appear at the location of the first one (if using "Fixed Starting"). If you add additional civs, they will be placed wherever they fit. Bonuses will either appear as defined in the Accurate Earth map ("Fixed Bonuses") or are placed randomly ("Randomize Bonuses").
Finally a note on starting locations:
When run at gamestart, the script attempts to determine starting locations by obtaining the plot coordinates of the first settler of each civ. If there's no settler or when the script is run after the first game turn, the script resorts to the predefined starting locations. Always using the predefined starting location won't work reliably when civs are moved through the world builder. Unfortunately, the settler method is also somewhat unreliable in this case. The script prints the found settler (or starting location) of each civ to the console, so it makes sense to check whether all civs have been found. If something goes wrong, it might help to save and reload the wb file.
This is a modification of tywiggins save map script: https://apolyton.net/forum/civilization-iv/civilization-iv-creation/165900-python-save-map which somehow seems to have been forgotten.
Attachments
Last edited: