Python Performance and Interface Overhaul (PPIO)

Display bug in PPIO, sceenie...
 

Attachments

  • Civ4ScreenShot0430.JPG
    Civ4ScreenShot0430.JPG
    502.3 KB · Views: 302
Christian wonder - Crusaders have broken Python code.

Code:
Traceback (most recent call last):
  File "BugEventManager", line 308, in _handleDefaultEvent
  File "CvEventManager", line 2614, in onCityDoTurn
AttributeError: 'CyPlayer' object has no attribute 'getInfoTypeForString'

It spawns crusaders once but that is all.
 
Christian wonder - Crusaders have broken Python code.

Code:
Traceback (most recent call last):
  File "BugEventManager", line 308, in _handleDefaultEvent
  File "CvEventManager", line 2614, in onCityDoTurn
AttributeError: 'CyPlayer' object has no attribute 'getInfoTypeForString'

It spawns crusaders once but that is all.
line 2617
Yeah, that was quite a code error, must have been real tired when writing that nonsense.. ^^

Here's the error:
iUnit = GC.getPlayer(iPlayer).getInfoTypeForString("UNIT_CRUSADER") // CyPlayer does not have a getInfoTypeForString method.
CyUnit = CyPlayer.initUnit(iUnit, ...) // CyPlayer is not defined at this point...

Here's what it should have been:
CyPlayer = GC.getPlayer(iPlayer)
iUnit = GC.getInfoTypeForString("UNIT_CRUSADER")
CyUnit = CyPlayer.initUnit(iUnit, ...)

I think I'll mod today, been a while now.
 
Last edited:
Our code repository is under maintenance, so I can't update to latest revision, that puts a stop to my will to mod today, sorry.
I'm currently at rev. 10584, I understand some bugs were introduced to PPIO in later SVN revisions.

I'll play crusader kings II today instead. ^^
Ugh... ya can't do much when that's taking place.
 
PPIO v0.6.1.12
SVN rev.10597
  • Adapted to latest SVN revision.
  • Fixed project icons showing up as animal units in the city build selection list.
  • Fixed crusader units not spawning from the crusade wonder.
  • SVN revision 10591 or newer is now required.
 
Do you use the steam beta version of BtS?
If not, then that is the reason you have that display bug.

:sad: Are you saying we need to use steam to use PPIO? :confused: :mischief::D
 
It seems like nanite diffuser has wrong icon, in game it was pure pink, when game displayed it being built as if art for it (building icon) never existed.
Code:
        # NANITE DEFUSER - destroyes all nukes from all players
        elif iBuilding == mapBuildingType["NANITE_DEFUSER"]:
            CyPlayer = GC.getPlayer(iPlayer)
            X = CyCity.getX()
            Y = CyCity.getY()
            szText = TRNSLTR.getText("TXT_KEY_NANITE_DEFUSER_PYTHON",())
            for iPlayerX in xrange(self.MAX_PLAYERS):
                CyUnit, i = CyPlayer.firstUnit(False)
                while CyUnit:
                    if CyUnit.isDead() or CyUnit.isNone():
                        print "CvEventManager\onBuildingBuilt", ("CyUnit.isDead()", CyUnit.isDead()), ("CyUnit.isNone()", CyUnit.isNone())
                    elif CyUnit.getUnitCombatType() == GC.getInfoTypeForString("UNITCOMBAT_DOOM") or CyUnit.nukeRange() > 0 or CyUnit.getUnitAIType() == UnitAITypes.UNITAI_ICBM:
                        CyUnit.kill(0, -1)
                    CyUnit, i = CyPlayer.nextUnit(i, False)
                if CyPlayer.isHuman() and CyPlayer.isAlive():
                    CyInterface().addMessage(iPlayerX, False, 15, szText, "", 0, 'Art/Interface/Buttons/Buildings/Ascension_Gate.dds', ColorTypes(44), X, Y, True, True)
It should be something else here, not Art/Interface/Buttons/Buildings/Ascension_Gate.dds.
 
That button has been moved to \art\interface\buttons\great_wonders\ascension_gate.dds, but I think it would be more appropriate with \art\interface\buttons\great_wonders\nanite_defuser.dds in this case.

This is not exactly a PPIO issue, as the same code for the message is used by core C2C.
Code:
        if (iBuildingType == self.iBUILDING_NANITE_DEFUSER):
            pPlayer = gc.getPlayer(pCity.plot().getOwner())
            iX = pCity.getX()
            iY = pCity.getY()
            for player in PlayerUtil.players(alive=True):
                pPID = player.getID()
                for unit in PlayerUtil.playerUnits(player):
                    if (unit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_DOOM") or unit.nukeRange() > 0 or unit.getUnitAIType() == UnitAITypes.UNITAI_ICBM and not unit.isNone()):
                        unit.kill( 0, -1 )
                CyInterface().addMessage(pPID,False,15,CyTranslator().getText("TXT_KEY_NANITE_DEFUSER_PYTHON",()),'',0,'Art/Interface/Buttons/Buildings/Ascension_Gate.dds',ColorTypes(44), iX, iY, True,True)
I updated path in Python file and committed it now.

Blame tool shows, that it was unchanged since first revision.

I guess some nth graphic repackage broke that.
By the way that thing always pointed to Ascension Gate :p

That is someone back in ROM forgot to switch placeholder.
 
Last edited:
Do you use steam without having the beta version of BtS activated?
If so, then that is the reason you have that display bug.

Turning in steam "original release" under BETA's on in BtS fixed it but how to disable that error message now? "You have selected an unsusable voice capture device"?
 

Attachments

  • Civ4ScreenShot0433.JPG
    Civ4ScreenShot0433.JPG
    334.4 KB · Views: 284
Turning in steam "original release" under BETA's on in BtS fixed it but how to disable that error message now? "You have selected an unsusable voice capture device"?
Set this to 0 in vanilla BTS INI.
Its here: C:\Users\<USERNAME>\Documents\My Games\Beyond the Sword

; Enable voice over IP capture and playback
EnableVoice = 0
 
There is an issue with the Civics screen, I can not select Mercenaries. According my civic screen, I have no military civic at all now. Sorry for the bad image, but print screen is busted on my computer. Don't ask.
Spoiler Screenshot :
I would need a save file where this is happening to be able to debug it, I couldn't find any obvious problems in the code.
 
I would need a save file where this is happening to be able to debug it, I couldn't find any obvious problems in the code.
This happens if civics in same category are researchable in same or very close columns but are in different techs.

Then this graphical bug happens and you have to choose other civic window to actually choose civic.

For example (A, B, C are in same category for example matriarchy/patriarchy/junta):
Civic A - x40
Civic B - x41
Civic C - x41
Civics A and C are unlocked, and player didn't research tech unlocking civic B.
This will mean C is unselectable in general window as there is gap here.
In original civic window - with vertical list you can select C normally.
 
Last edited:
This happens if civics in same category are researchable in same column but are in different techs.

Then this graphical bug happens and you have to choose other civic window to actually choose civic.
Well, that is strange as the code doesn't check the tech req of civics, it just asks the dll if the civic is unlocked for this player. I'll have to look at the dll code, perhaps the canDoCivic call is not the right one to use, or that I need another call for specific cases.
 
Well, that is strange as the code doesn't check the tech req of civics, it just asks the dll if the civic is unlocked for this player. I'll have to look at the dll code, perhaps the canDoCivic call is not the right one to use, or that I need another call for specific cases.
Civics are listed as are ordered in civic infos.
Notice that you can select civics in vertical list window normally as always you could.
So bug is in that new window, that shows only civic icons.
 
Notice that you can select civics in vertical list window normally as always you could.
So bug is in that new window, that shows only civic icons.
Which is strange as they use pretty much the same code for displaying the icons.

Spoiler Simple civic screen :
Code:
            for CvCivicInfoX, iCivicX in civicList:
                Img = "WID|CIVIC%d" % iCivicX

                if bDebug or CyPlayer.canDoCivics(iCivicX):
                    BTN = CvCivicInfoX.getButton()
                else: BTN = CANCEL
                screen.setImageButtonAt(Img, ScPnl, BTN, x, y, iSize, iSize, eWidGen, 1, 1)

                x += dx
Spoiler Advanced civic screen :
Code:
            for CvCivicInfoX, iCivicX in civicList:

                if bDebug or CyPlayer.canDoCivics(iCivicX):
                    BTN = CvCivicInfoX.getButton()
                else: BTN = CANCEL
                screen.addDDSGFCAt("", ScPnl, BTN, 8, y, iSize, iSize, eWidGen, 1, 1, False)

                y += dy
 
Last edited:
Could someone please check if the great farmer unit works as it should on this test version of PPIO?

Would be great if you had enabled python logging and error messages just in case.

Test version number 2 includes the restrictions that you need to have the bonus available to your capital city to be able to place it.
Still no build actions shows in Great Farmer at all.
 
Lol, I probably found the reason in PythonCallbackDefines.xml:

<Define>
<DefineName>USE_CAN_BUILD_CALLBACK</DefineName>
<iDefineIntVal>0</iDefineIntVal>​
</Define>

Change that to 1
Still doesn't work - that is absolutely no build actions are in this unit.
 
Top Bottom