avain
(key)
ShowMeAllDaUnitz mod
for 3.19
current version: v1.1
date: 2010.04.15
Aim of the mod: show all the units belonging to all the (alive) civilizations
Now this is one HUGE modcomp! Just kidding, it's like 8 lines of code, but it can save some manual labour if you are like me and make ethnic unit sets. (or anything similar)
So what does it do?
Try renaming a unit (click on it's name) and you'll get all the units of all alive civilizations spread out in rows and lines across the map! So you can compare them, check them, see if your modification to unit graphics worked, etc.
The real code is only this:
But I've uploaded here a modified CvEventManager.py for your pleasure!
(You can put it into your mods Python folder and it should work - unless you have python changes already but in this case you should already know what you are supposed to do )
Enjoy!
version history
v1.1
added code to change terrain to ocean below the unit
v1.0
initial version
for 3.19
current version: v1.1
date: 2010.04.15
Aim of the mod: show all the units belonging to all the (alive) civilizations
Now this is one HUGE modcomp! Just kidding, it's like 8 lines of code, but it can save some manual labour if you are like me and make ethnic unit sets. (or anything similar)
So what does it do?
Try renaming a unit (click on it's name) and you'll get all the units of all alive civilizations spread out in rows and lines across the map! So you can compare them, check them, see if your modification to unit graphics worked, etc.
The real code is only this:
Code:
# ShowMeAllDaUnitz, avain, 2010-04-15 BEGIN
for iPlayer in range(0,int(gc.getMAX_PLAYERS())):
if ((gc.getPlayer(iPlayer).isAlive()) and (gc.getPlayer(iPlayer).isBarbarian()!=true) ):
for j in range( CyGlobalContext().getNumUnitClassInfos() ):
eLoopUnit = CyGlobalContext().getCivilizationInfo(gc.getPlayer(iPlayer).getCivilizationType()).getCivilizationUnits(j)
if (eLoopUnit != -1):
x = j%10 + 1 + iPlayer*12
y = (j/10) + 5
gc.getMap().plot( x, y ).setTerrainType(CvUtil.findInfoTypeNum(gc.getTerrainInfo, gc.getNumTerrainInfos(), "TERRAIN_OCEAN"), 1, 1)
gc.getPlayer(iPlayer).initUnit( eLoopUnit, x, y, UnitAITypes.UNITAI_UNKNOWN, DirectionTypes.NO_DIRECTION )
# ShowMeAllDaUnitz, avain, 2010-04-15 END
But I've uploaded here a modified CvEventManager.py for your pleasure!
(You can put it into your mods Python folder and it should work - unless you have python changes already but in this case you should already know what you are supposed to do )
Enjoy!
version history
v1.1
added code to change terrain to ocean below the unit
v1.0
initial version