Unit.IsGreatGeneral - does this exist?

ruff_hi

Live 4ever! Or die trying
Joined
Oct 24, 2005
Messages
9,135
Location
an Aussie in Boston
I am trying to determine if a unit is a Great General from within python - how do I do this?
 
Thx. I ended up using this code ...

Code:
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. :)
 
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!
 
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.

:o

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!

Good idea! Should be included in the BUG mod. :goodjob:
 
As a first step, how about adding another group to the Military Advisor unit list for units lead by a GG?

Code:
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)
...
Those units would still be listed under their appropriate combat type (Tank under ARMORED, etc). This way you can at least see where they are on the map.

I'm adding this now. Question: Should this new group be near the top (as above) or at the bottom after AIR units?
 
I'm adding this now. Question: Should this new group be near the top (as above) or at the bottom after AIR units?
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?
 
Shoot, sorry. When you mentioned the sorting options, I thought you were talking about the SIT REP tab. Yes, lemme know your thoughts on the DEPLOYMENT tab and maybe I can help out instead of interfering. :)

Feel free to continue this discussion in the BUG forum's MA thread.
 
Back
Top Bottom