1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Python Performance and Interface Overhaul

Discussion in 'C2C mod mods' started by Toffer90, Jul 7, 2017.

  1. Pit2015

    Pit2015 Chieftain

    Joined:
    Jun 28, 2015
    Messages:
    1,052
    Location:
    Germany
    Display bug in PPIO, sceenie...
     

    Attached Files:

  2. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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.
     
  3. MattCA

    MattCA Chieftain

    Joined:
    Jan 25, 2019
    Messages:
    91
    Gender:
    Male
    line 2617
     

    Attached Files:

  4. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    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: Jun 14, 2019
    raxo2222 likes this.
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,275
    Gender:
    Male
    Location:
    Las Vegas
    Ugh... ya can't do much when that's taking place.
     
  6. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    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.
     
    raxo2222 likes this.
  7. Harrier

    Harrier Chieftain

    Joined:
    Feb 19, 2002
    Messages:
    2,354
    Location:
    UK
    :sad: Are you saying we need to use steam to use PPIO? :confused: :mischief::D
     
  8. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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.
     
  9. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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: Jun 13, 2019
    Toffer90 likes this.
  10. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    PPIO v0.6.1.13 - Minor update
    SVN rev.10599
    • Adapted to latest SVN revision.
     
    raxo2222 likes this.
  11. Pit2015

    Pit2015 Chieftain

    Joined:
    Jun 28, 2015
    Messages:
    1,052
    Location:
    Germany
    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"?
     

    Attached Files:

  12. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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
     
  13. Pit2015

    Pit2015 Chieftain

    Joined:
    Jun 28, 2015
    Messages:
    1,052
    Location:
    Germany
    Worked! :thumbsup:
     
    raxo2222 likes this.
  14. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    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.
     
  15. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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: Jun 14, 2019
  16. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    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.
     
  17. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    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.
     
  18. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    5,499
    Location:
    Norway
    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: Jun 16, 2019
  19. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    Still no build actions shows in Great Farmer at all.
     
  20. raxo2222

    raxo2222 Warlord

    Joined:
    Jun 10, 2011
    Messages:
    5,215
    Location:
    Poland
    Still doesn't work - that is absolutely no build actions are in this unit.
     

Share This Page