Me again!
So on continues my quest of many headaches, but I am currnetly getting this error message from a bit of code that the J made for me once upon a time to display the 'ranged combat strength' of my units (as range combat is a big part of the mod).
Any idea why this wouldn't be happy in your code?
The file is CvMainInterface
name error
name 'pHeadSelectedUnit' is not defined
So on continues my quest of many headaches, but I am currnetly getting this error message from a bit of code that the J made for me once upon a time to display the 'ranged combat strength' of my units (as range combat is a big part of the mod).
Any idea why this wouldn't be happy in your code?
The file is CvMainInterface
name error
name 'pHeadSelectedUnit' is not defined
Spoiler :
Code:
###combat-aircombat - start
szLeftBuffer = u""
szRightBuffer = u""
[COLOR="Red"]if (pHeadSelectedUnit.getDomainType() != DomainTypes.DOMAIN_AIR) and (pHeadSelectedUnit.airBaseCombatStr()>0):[/COLOR]
if (pHeadSelectedUnit.canFight()):
szLeftBuffer = localText.getText("INTERFACE_PANE_RANGED_STRENGTH", ())
if (pHeadSelectedUnit.isFighting()):
szRightBuffer = u"?/%d%c" %(pHeadSelectedUnit.airBaseCombatStr(), CyGame().getSymbolID(FontSymbols.STRENGTH_CHAR))
elif (pHeadSelectedUnit.isHurt()):
szRightBuffer = u"%.1f/%d%c" %(((float(pHeadSelectedUnit.airBaseCombatStr() * pHeadSelectedUnit.currHitPoints())) / (float(pHeadSelectedUnit.maxHitPoints()))), pHeadSelectedUnit.airBaseCombatStr(), CyGame().getSymbolID(FontSymbols.STRENGTH_CHAR))
else:
szRightBuffer = u"%d%c" %(pHeadSelectedUnit.airBaseCombatStr(), CyGame().getSymbolID(FontSymbols.STRENGTH_CHAR))
szBuffer = szLeftBuffer + szRightBuffer
if ( szBuffer ) and (pHeadSelectedUnit.getDomainType() != DomainTypes.DOMAIN_AIR) and (pHeadSelectedUnit.airBaseCombatStr()>0):
screen.appendTableRow( "SelectedUnitText" )
screen.setTableText( "SelectedUnitText", 0, iRow, szLeftBuffer, "", WidgetTypes.WIDGET_HELP_SELECTED, -1, -1, CvUtil.FONT_LEFT_JUSTIFY )
screen.setTableText( "SelectedUnitText", 1, iRow, szRightBuffer, "", WidgetTypes.WIDGET_HELP_SELECTED, -1, -1, CvUtil.FONT_RIGHT_JUSTIFY )
screen.show( "SelectedUnitText" )
screen.show( "SelectedUnitPanel" )
iRow += 1
###combat-aircombat - end