MapScriptTools.py v1.02
------------------------------
------------------------------
AUTHOR:
MapScriptTools.py provides functions and classes to:
- easily adapt maps for Planetfall or Mars Now!
- produce maps with special features for Fall from Heaven 2
- add Marsh terrain
- add Deep Ocean terrain
- make the map looking prettier/more realistic
- add special regions to the map
- replace and expand BonusBalancer (from Warlords)
- manipulate river creation: (starting from lakes, on islands)
- handle starting-positions for teams
- print various sorts of maps to the log file for testing
- print stats about mod and map
- find the path for Civ4, Mod or Log files
Also included are several maps using these new features.
Temudjin (2009-11)
PURPOSE: Provide tools to facilitate map-making and adapting/enhancing existing maps.
Make maps compatible for 'Normal', 'Fall from Heaven 2', 'Planetfall' and 'Mars Now!' mods.
Make maps compatible for 'Normal', 'Fall from Heaven 2', 'Planetfall' and 'Mars Now!' mods.
MapScriptTools.py provides functions and classes to:
- easily adapt maps for Planetfall or Mars Now!
- produce maps with special features for Fall from Heaven 2
- add Marsh terrain
- add Deep Ocean terrain
- make the map looking prettier/more realistic
- add special regions to the map
- replace and expand BonusBalancer (from Warlords)
- manipulate river creation: (starting from lakes, on islands)
- handle starting-positions for teams
- print various sorts of maps to the log file for testing
- print stats about mod and map
- find the path for Civ4, Mod or Log files
Also included are several maps using these new features.
NOTES:
- Not really intended for 'Final Frontier' based maps.
- Compatible with BtS 3.19.
I've run a short test with Warlords 2.13 and that worked fine too. The above statement seems to imply compatibility to BtS 3.13/3.17, but this isn't tested.Actually the question of compatibility arises mostly with respect of recognizing and showing the right mod-versions in the log. Unless recognition of 'Planetfall', 'Mars Now!' and 'Fall from Heaven 2' fails, there shouldn't be any problems beyond logging false identifications.
- Multiplayer compatibility is unknown.
Seems probable though as all randomizations are centralized within the choose..() functions. Please tell me.
- MAC compatibility is unknown as the MAC uses Python 2.3. Now it seems likely though.
Sets are not built-in in Python 2.3. I believe I used them only in adjustShelfTrenches() & rimRivers() though.
! I think this is fixed. - Thanks EmperorFoolAlso new in Python 2.4 was the use of the keyword parameter 'key' within the sort() method of lists. I used the key parameter name in makeMapLegend() & showContinents() only.
! I think this is fixed. - Thanks Xyth & EmperorFoolI've tried to fix all those MAC issues, both here and with the associated maps. Maybe now it's compatible? Please tell me.
To show how MapScriptTools are working I've included several adjusted Mapscripts:
Earth3_163_mst.py
by jkp1187 --> http://forums.civfanatics.com/showthread.php?t=253927
Erebus_107c_mst.py
by Cephalo --> http://forums.civfanatics.com/showthread.php?t=261688
Inland_Sea_131_mst.py
by Sirian (Civ4 original)
Medium_and_Small_111_mst.py
by Sirian (Civ4 original)
PerfectMongoose_3101_mst.py
by LunarMongoose --> http://forums.civfanatics.com/showthread.php?t=402816
PerfectWorld_206f1_mst.py
by Cephalo --> http://forums.civfanatics.com/showthread.php?t=310891
Planetfall_101_mst.py (**NEW**)
by Maniac --> http://forums.civfanatics.com/showthread.php?t=252829
Sea_Highlands_121_mst.py
by Sirian (Civ4 original)
SmartMap_922_mst.py (changed)
by surt --> http://forums.civfanatics.com/showthread.php?t=154989
Tectonics_316a_mst.py
by Laurent Di Cesare --> http://forums.civfanatics.com/showthread.php?t=149278
Ringworld3_102_mst.py (changed)
by Temudjin --> http://forums.civfanatics.com/showthread.php?t=371831
FracturedWorld_102_mst.py (changed)
by Temudjin --> http://forums.civfanatics.com/showthread.php?t=371842
All maps can be used with 'Fall from Heaven', 'Planetfall' or 'Mars Now!'.
All maps can (and will) produce Marsh terrain, if the mod supports it.
All maps can (and will) produce Deep Ocean terrain, if the mod supports it.
All maps allow for at least two more map sizes beyond 'Huge', if the mod supports them.
All maps support Coastal Waters options. (Allow expanded coast like Civ5)
All maps may add Map Regions ( BigDent, BigBog (not Mars), ElementalQuarter (FFH only), LostIsle ).
All maps may add Map Features ( Kelp, HauntedLands, CrystalPlains ), if supported by mod (FFH only).
All maps may add some rivers on small islands and from lakes.
All maps support Mars Theme options, if 'Mars Now!' is the active mod.
All maps support Team Start options.
All maps support any number of players, depending on the mod.
All maps produce printed maps in "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log"
All maps produce printed statistics in "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log"
If 'Planetfall' is the active mod, usually the planetfall-default starting plot finder will be used.
If 'Mars Now!' is the active mod, the 'Team Start' option will be suppressed.
If 'Mars Now!' is the active mod, oceans and lakes are converted to desert (Sands of Mars), except if Terraformed Mars is choosen in the Mars Theme options.
Most maps use balanced resources, add missing boni and try to move some minerals to nearby hills.
Most maps give names to their Special Regions.
by jkp1187 --> http://forums.civfanatics.com/showthread.php?t=253927
Erebus_107c_mst.py
by Cephalo --> http://forums.civfanatics.com/showthread.php?t=261688
Inland_Sea_131_mst.py
by Sirian (Civ4 original)
Medium_and_Small_111_mst.py
by Sirian (Civ4 original)
PerfectMongoose_3101_mst.py
by LunarMongoose --> http://forums.civfanatics.com/showthread.php?t=402816
PerfectWorld_206f1_mst.py
by Cephalo --> http://forums.civfanatics.com/showthread.php?t=310891
Planetfall_101_mst.py (**NEW**)
by Maniac --> http://forums.civfanatics.com/showthread.php?t=252829
Sea_Highlands_121_mst.py
by Sirian (Civ4 original)
SmartMap_922_mst.py (changed)
by surt --> http://forums.civfanatics.com/showthread.php?t=154989
Tectonics_316a_mst.py
by Laurent Di Cesare --> http://forums.civfanatics.com/showthread.php?t=149278
Ringworld3_102_mst.py (changed)
by Temudjin --> http://forums.civfanatics.com/showthread.php?t=371831
FracturedWorld_102_mst.py (changed)
by Temudjin --> http://forums.civfanatics.com/showthread.php?t=371842
All maps can be used with 'Fall from Heaven', 'Planetfall' or 'Mars Now!'.
All maps can (and will) produce Marsh terrain, if the mod supports it.
All maps can (and will) produce Deep Ocean terrain, if the mod supports it.
All maps allow for at least two more map sizes beyond 'Huge', if the mod supports them.
All maps support Coastal Waters options. (Allow expanded coast like Civ5)
All maps may add Map Regions ( BigDent, BigBog (not Mars), ElementalQuarter (FFH only), LostIsle ).
All maps may add Map Features ( Kelp, HauntedLands, CrystalPlains ), if supported by mod (FFH only).
All maps may add some rivers on small islands and from lakes.
All maps support Mars Theme options, if 'Mars Now!' is the active mod.
All maps support Team Start options.
All maps support any number of players, depending on the mod.
All maps produce printed maps in "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log"
All maps produce printed statistics in "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log"
If 'Planetfall' is the active mod, usually the planetfall-default starting plot finder will be used.
If 'Mars Now!' is the active mod, the 'Team Start' option will be suppressed.
If 'Mars Now!' is the active mod, oceans and lakes are converted to desert (Sands of Mars), except if Terraformed Mars is choosen in the Mars Theme options.
Most maps use balanced resources, add missing boni and try to move some minerals to nearby hills.
Most maps give names to their Special Regions.
************************************************
** Thanks:
** ---------
** I've looked into a lot of map-scripts and mod-code and learned much from the authors. I also
** stole ideas and sometimes even parts of code, which I found useful. I'm sorry to say that
** I don't remember all of my sources - my apologies and thank you all for your efforts.
** Specifically I'd like to thank:
**
** Ruff_Hi
** - Your 'Ring World' induced me into a deeper investigation of maps.
**
** The CivFanatics Community
** - For making all those wonderful maps and mods and
** for providing the opportunity to have a look at how it's done.
**
** The Civ4 Design Team
** - By opening your game-engine, you really opend the world(s).
**
************************************************
** Thanks:
** ---------
** I've looked into a lot of map-scripts and mod-code and learned much from the authors. I also
** stole ideas and sometimes even parts of code, which I found useful. I'm sorry to say that
** I don't remember all of my sources - my apologies and thank you all for your efforts.
** Specifically I'd like to thank:
**
** Ruff_Hi
** - Your 'Ring World' induced me into a deeper investigation of maps.
**
** The CivFanatics Community
** - For making all those wonderful maps and mods and
** for providing the opportunity to have a look at how it's done.
**
** The Civ4 Design Team
** - By opening your game-engine, you really opend the world(s).
**
************************************************
Installation:
Put the file MapScriptTools.py into the ...\Beyond the Sword\Assets\Python folder. (NOT CustomAssets!)
If you don't mind to see it as an option in the map selection of 'Custom Game', you can put it
into the ...\Beyond the Sword\PublicMaps folder, but that's the second best solution, as it won't work
if the mod disallows public maps in its ini-file (it may have other quirks - this isn't well tested).
'Planetfall' uses the PrivateMaps folder, here you whould either have to put it into the Python folder, or change the ini-file to allow 'Planetfall' to use the PublicMaps folder.
All reports go to the Python log normally at "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log".
You may have to enable logging by making sure the following option is set to 1 in "...\My Documents\My Games\Beyond the Sword\civilization.ini":
Spoiler :
Put the file MapScriptTools.py into the ...\Beyond the Sword\Assets\Python folder. (NOT CustomAssets!)
If you don't mind to see it as an option in the map selection of 'Custom Game', you can put it
into the ...\Beyond the Sword\PublicMaps folder, but that's the second best solution, as it won't work
if the mod disallows public maps in its ini-file (it may have other quirks - this isn't well tested).
'Planetfall' uses the PrivateMaps folder, here you whould either have to put it into the Python folder, or change the ini-file to allow 'Planetfall' to use the PublicMaps folder.
All reports go to the Python log normally at "...\My Documents\My Games\Beyond the Sword\Logs\PythonDbg.log".
You may have to enable logging by making sure the following option is set to 1 in "...\My Documents\My Games\Beyond the Sword\civilization.ini":
Code:
; Enable the logging system
LoggingEnabled = 1
Changelog:
1.02___29.Jul.11
- Fixed, path identification for MAC in getCivPaths()
- Fixed ??, MAC compatibility with key parameter in sort() method
- Fixed, Bonus-list now gives the correct mana-type for FFH type mods
- Changed, new optional parameter for printList() & sprintList()
- Changed, new optional parameter for featurePlacer.placeReefs() ! changes parameter order
- Changed, now two ways to recognize mana types automatically,
- as defined by the prerequisites for the Towers of Alteration/Divination/Necromancy/Elements; all other mana types are considered mana for meta-magics
- as defined by the mana type tech, that is the prerequisite of building the appropiate node on the mana boni
- Changed, in buildTerrainMap(), buildFeatureMap(),buildBonusMap() the showPlots parameter now defaults to False
- Improved, recognize 'Master of Mana', 'History Rewritten' mods
- Improved, put addGoodies() into the template
- Improved, whenever a reef is build in the ocean, there is now a chance that it expands into a somewhat longish chain of reefs
- Added, world shape to map description log
- Added, Planetfall_101_mst script
1.01___15.Mar.11
- Fixed ??, MAC compatibility with sets and in CivFolders.getCivPaths() - can't test this myself
- Fixed, incompatibility with 'History in the Making', 'Quod Capita', and possibly some other mods using newer BUG versions
- Fixed, proper initialization of 'Lost Isle' region upon regeneration of map
- Fixed, potential problem with region signs falling off the unwrapped map
- Fixed, now correct coast terrain with special regions
- Fixed, now Volcanos stand on Land/Hills plots - looks better than floating above peaks
- Fixed [Planetfall], 'Lost Isle' now produce proper marine boni
- Fixed [Mars Now!], 'Lost Isle' region now also on Mars
- Fixed [Mars Now!], no more rivers from 'BigBog' or 'BigDent'
- Fixed [Mars Now!], printed terrain/feature/bonus maps now show proper resource names
- Fixed [Mars Now!], no volcanos on marsian deserts anymore, if MST_FeatureGenerator is used
- Changed, new 'class MST_Terraingenerator_Mars' for use with 'Mars Now!', was split from 'class MST_Terraingenerator' which should be used otherwise
- Changed, minor changes producing special regions: 'BigDent' and 'BigBog'
- Changed [Planetfall], normal Trenches and Shelves on biggest ocean and a few more elsewhere
- Changed [Planetfall], BonusBalancer ignores options for balancing and finding boni
- Changed [Planetfall], Tundra conversion in planetFallMap.mapPfallTerrain() now: Tundra -> 33% FlatPolar, 16% RockyPolar, 33% FlatMoist, 16% RockyMoist
- Changed [Planetfall], Highland generation in planetFallMap.buildPfallHighlands() now gives more hills/peaks, which are more clustered together - like Planetfall
- Changed [Mars Now!], converting ocean to desert: some few hills are created and at higher latitudes tundra or even some ice may be created
- Changed, some default parameters within various methods - still balancing things
- Improved, streamlined num...Neighbors() mapping functions
- check number of plot-neighbors for lists of plots, terrain, features, boni or improvements
- killed obsolete bWrap parameter
- Improved, less chance for 'BigBog' and 'BigDent' to start on small island and better chance to start inside bigger continent
- Improved, print version to log
- Added, new class variable 'riverMaker.maxRiverLength' to cap length of river
- Added, feature generator for Mars Now! (included in class MST_FeatureGenerator)
- Added to 'featurePlacer', methods to place Reefs and Scrub on the map, if allowed by mod
- Added to 'mapPrettifier', method lumpifyFeature()
- Added, parameter to getModInfo(), to allow suppression of region-names
- Added, parameter to mapRegions.buildBigBog() and mapRegions.buildBigDent() to control chances for each special region to exist; slightly lowered default chance (now 66%).
- Added, parameter to printDict() and printList(), to format floating-point output
- Added, parameter to mapStats.statPlotCount() to enable use before plots are generated
- Added [Planetfall], parameter and result to planetFallMap.buildPfallHighlands() to enable use before plots are generated
- Added [Planetfall], name signs for already known Planetfall regions: 'Mount Planet', 'Garland Crater', 'Manifold Nexus', 'The Great Dunes', 'Pholus Ridge', 'The Ruins', 'Borehole Cluster'
- Added [Mars Now!], new global variable: bSandsOfMars, denoting a map on Mars, where all surface water is converted to desert.
- Added Info, included 'How To Guide' and updated the 'MapScriptTools Interface Template' ---> see the end of MapScriptTools.py file!
1.00___15.Jul.10
Initial release
Spoiler :
1.02___29.Jul.11
- Fixed, path identification for MAC in getCivPaths()
- Fixed ??, MAC compatibility with key parameter in sort() method
- Fixed, Bonus-list now gives the correct mana-type for FFH type mods
- Changed, new optional parameter for printList() & sprintList()
- Changed, new optional parameter for featurePlacer.placeReefs() ! changes parameter order
- Changed, now two ways to recognize mana types automatically,
- as defined by the prerequisites for the Towers of Alteration/Divination/Necromancy/Elements; all other mana types are considered mana for meta-magics
- as defined by the mana type tech, that is the prerequisite of building the appropiate node on the mana boni
- Changed, in buildTerrainMap(), buildFeatureMap(),buildBonusMap() the showPlots parameter now defaults to False
- Improved, recognize 'Master of Mana', 'History Rewritten' mods
- Improved, put addGoodies() into the template
- Improved, whenever a reef is build in the ocean, there is now a chance that it expands into a somewhat longish chain of reefs
- Added, world shape to map description log
- Added, Planetfall_101_mst script
1.01___15.Mar.11
- Fixed ??, MAC compatibility with sets and in CivFolders.getCivPaths() - can't test this myself
- Fixed, incompatibility with 'History in the Making', 'Quod Capita', and possibly some other mods using newer BUG versions
- Fixed, proper initialization of 'Lost Isle' region upon regeneration of map
- Fixed, potential problem with region signs falling off the unwrapped map
- Fixed, now correct coast terrain with special regions
- Fixed, now Volcanos stand on Land/Hills plots - looks better than floating above peaks
- Fixed [Planetfall], 'Lost Isle' now produce proper marine boni
- Fixed [Mars Now!], 'Lost Isle' region now also on Mars
- Fixed [Mars Now!], no more rivers from 'BigBog' or 'BigDent'
- Fixed [Mars Now!], printed terrain/feature/bonus maps now show proper resource names
- Fixed [Mars Now!], no volcanos on marsian deserts anymore, if MST_FeatureGenerator is used
- Changed, new 'class MST_Terraingenerator_Mars' for use with 'Mars Now!', was split from 'class MST_Terraingenerator' which should be used otherwise
- Changed, minor changes producing special regions: 'BigDent' and 'BigBog'
- Changed [Planetfall], normal Trenches and Shelves on biggest ocean and a few more elsewhere
- Changed [Planetfall], BonusBalancer ignores options for balancing and finding boni
- Changed [Planetfall], Tundra conversion in planetFallMap.mapPfallTerrain() now: Tundra -> 33% FlatPolar, 16% RockyPolar, 33% FlatMoist, 16% RockyMoist
- Changed [Planetfall], Highland generation in planetFallMap.buildPfallHighlands() now gives more hills/peaks, which are more clustered together - like Planetfall
- Changed [Mars Now!], converting ocean to desert: some few hills are created and at higher latitudes tundra or even some ice may be created
- Changed, some default parameters within various methods - still balancing things
- Improved, streamlined num...Neighbors() mapping functions
- check number of plot-neighbors for lists of plots, terrain, features, boni or improvements
- killed obsolete bWrap parameter
- Improved, less chance for 'BigBog' and 'BigDent' to start on small island and better chance to start inside bigger continent
- Improved, print version to log
- Added, new class variable 'riverMaker.maxRiverLength' to cap length of river
- Added, feature generator for Mars Now! (included in class MST_FeatureGenerator)
- Added to 'featurePlacer', methods to place Reefs and Scrub on the map, if allowed by mod
- Added to 'mapPrettifier', method lumpifyFeature()
- Added, parameter to getModInfo(), to allow suppression of region-names
- Added, parameter to mapRegions.buildBigBog() and mapRegions.buildBigDent() to control chances for each special region to exist; slightly lowered default chance (now 66%).
- Added, parameter to printDict() and printList(), to format floating-point output
- Added, parameter to mapStats.statPlotCount() to enable use before plots are generated
- Added [Planetfall], parameter and result to planetFallMap.buildPfallHighlands() to enable use before plots are generated
- Added [Planetfall], name signs for already known Planetfall regions: 'Mount Planet', 'Garland Crater', 'Manifold Nexus', 'The Great Dunes', 'Pholus Ridge', 'The Ruins', 'Borehole Cluster'
- Added [Mars Now!], new global variable: bSandsOfMars, denoting a map on Mars, where all surface water is converted to desert.
- Added Info, included 'How To Guide' and updated the 'MapScriptTools Interface Template' ---> see the end of MapScriptTools.py file!
1.00___15.Jul.10
Initial release
Known Errors:
-
-