I was very positively impressed to note that maps are set up in Python. That makes it easy to make at least some world designs, but I'd love some documentation.
Announcement
Collapse
No announcement yet.
Anyone done much with maps?
Collapse
X
-
Ah ok, good point...
Map scripts are rather complicated. They are well documented though, just open them and have a study the existing code. It requires some knowledge of OO programming and math to write completely new scripts though, so it's not exactly for the faint of heart. Modifying existing scripts may be easier, but I honesty haven't had time to try it yet. All this power comes at a price...
Comment
-
I don't think I'd call them well documented. There's some maps that provide a custom map option. Must I leave stub functions in for the menu options there if I want to remove the option?
And yes, I'm talking about the scripts. I didn't know there was anything else! I am more interested by the scripts; they look like a viable way to build custom-random maps.
One obvious question, is there a set of options to generate_map that eliminates ALL water? water_percent=0 isn't it.
Comment
-
I confess myself moderately stumped. I'm trying to do an "all-friendly-terrain" map (no ice, no desert) and I'm failing.
What I would like to do is inherit the default terrain generator, then simply modfy the resulting map, but I can't seem to figure out how to do this except by duplicating the code. But I don't want to do that; I want to use the standard terrain generator and then just tweak the output. Is this possible?
My idea was this:
Code:def generateTerrainTypes(): NiTextOut("Generating Terrain (Python Lakes2) ...") terraingen = TerrainGenerator() terrainTypes = terraingen.generateTerrain() map = CyMap(); for x in range(map.getGridWidth()): for y in range(map.getGridHeight()): p = map.plot(x, y); t = p.getTerrainType(); if (t == tPlains): p.setTerrainType(tGrass, false, false); if (t == tSnow or t == tDesert or t == tTundra): p.setTerrainType(tPlains, false, false); return terrainTypes
tSnow, etc, were set previously:
Code:gc = CyGlobalContext() tDesert = gc.getInfoTypeForString("TERRAIN_DESERT") tPlains = gc.getInfoTypeForString("TERRAIN_PLAINS") tTundra = gc.getInfoTypeForString("TERRAIN_TUNDRA") tGrass = gc.getInfoTypeForString("TERRAIN_GRASS") tSnow = gc.getInfoTypeForString("TERRAIN_SNOW")
Comment
-
I'm stumped as well.
I'm trying to get the bmp converter to work, but each time I save the file and load up the game, as soon as it starts it says I have been defeated and the game ends. I don't get it.
I followed the tutorial Rhye wrote and changed nothing at all except I used a basic bmp I made instead of the one he included, and his works, mine doesn't. It makes no sense.Captain of Team Apolyton - ISDG 2012
When I was younger I thought curfews were silly, but now as the daughter of a young woman, I appreciate them. - Rah
Comment
-
Ah-hah! Found the right tool for the job. afterGenerate().
I'm getting the hang of this a bit. I think.
Er. If someone from Firaxis will post and say they won't sue, I'd be happy to post some detailed discussion of how the map generator works. I don't have it all figured out, but I have a lot figured out.
Comment
-
Originally posted by seebs
Ah-hah! Found the right tool for the job. afterGenerate().
I'm getting the hang of this a bit. I think.
Er. If someone from Firaxis will post and say they won't sue, I'd be happy to post some detailed discussion of how the map generator works. I don't have it all figured out, but I have a lot figured out.
Comment
Comment