What results can you get from gc.getMap()?

Tholal

Emperor
Joined
May 19, 2009
Messages
1,676
I've seen this function referenced in a couple of places, but I cant seem to find a list of what values you can retrieve from it aside from world size. Mainly I'm interested in being able to tell what map type is currently being played (panagea, continents, etc).
 
Try getMapScriptName() (a function in CyMap). The API is your friend.

Most of the time, you'll use the map object as a stepping stone to the plots.
 
Why do I get a python error when trying to use the following statement?

if CyMap().getMapScriptName() == "Archipelago.py"

I've tried it with single quotes and that didn't help.
 
It may not give an error, but does it do what you want? I thought the file type was included in the map script name returned by that function (typically ".py" for scripts or ".CivBeyondSwordWBSave" for scenarios).

So you might want something more like:
Code:
if ('Archipelago' in CyMap().getMapScriptName()):
 
It may not give an error, but does it do what you want? I thought the file type was included in the map script name returned by that function (typically ".py" for scripts or ".CivBeyondSwordWBSave" for scenarios).

Yep. It does exactly what I want. When I print the results from the CyMap().getMapScriptName() query, it says 'Archipelago' (when I'm on an Archipelago map). No file extension included. And it works as expected when comparing against a string in my IF statement.
 
Interesting.

For scenarios this apparently returns the file name, including the extension (Final Frontier uses this to detect whether it is running a scenario or a newly generated map), but map scripts must return the defined name (in this case, TXT_KEY_MAP_SCRIPT_ARCHIPELAGO = "Archipelago"),
 
For scenarios this apparently returns the file name, including the extension (Final Frontier uses this to detect whether it is running a scenario or a newly generated map), but map scripts must return the defined name (in this case, TXT_KEY_MAP_SCRIPT_ARCHIPELAGO = "Archipelago"),

I would guess that scenarios don't have the MAP_SCRIPT key defined.
 
Top Bottom