ruff_hi
Live 4ever! Or die trying
I am trying to determine if a unit is a Great General from within python - how do I do this?
iGreatGeneral = gc.getInfoTypeForString('PROMOTION_LEADER')
if (BugScreens.isShowGreatGeneral()
and pLoopUnit.getOwner() == gc.getGame().getActivePlayer()
and pLoopUnit.isHasPromotion(iGreatGeneral)):
szStringGreatGeneral = szString+"GreatGeneral"
screen.show( szStringGreatGeneral )
You could also do a check to see if the unit's class is UNITCLASS_GREAT_GENERAL. Might be simpler.![]()
But that will only work for the actual Great General unit. I think what he's talking about is a unit that has been merged with a great general.
I am looking for the unit that becomes the Great Leader - thus I needed that promotion. I'm using this code in BUG to put a little star Great General unit in the unit plot list - no more hunt and click for that GG!
Already includedGood idea! Should be included in the BUG mod.![]()
Already included![]()
ALL UNITS
Worker (10)
Spy (2)
Great Engineer (1)
GREAT GENERAL
Gunship (2)
Tank (1)
Great General (1) <-- not bound to a unit yet
RECON
Explorer (1)
...
Wait. I've been looking at expanding the sort criteria a lot and anything that you might do will tread on what I have been looking at. Do you want to discuss this in greater detail?I'm adding this now. Question: Should this new group be near the top (as above) or at the bottom after AIR units?