Platy's Peculiar Pleasant Posh Python

Does water units appear in ALL UNITS filter?
Also, show one water unit which actually upgrade in unit info page.

As for Buildings, just use Platypedia on its own and you should see how it looks like using BTS data.
 
Did you enable python exceptions? There is obviously some error with the water units. Which stop the rest from loading too in ALL
 
Reuploaded Ultrapack.

1) Fixed Victory Screen with DH's
2) Fixed duplicated improvements in Tech bars for Pedia and Tech Screen

As for the other issues, Upgrade Tree bug is not so straight forward. That screen is a chore to look into, not written by me.

Didn't bother to reupload Platypedia. Will bother only after all issues gone.
 
As for the other issues, Upgrade Tree bug is not so straight forward. That screen is a chore to look into, not written by me.
Yes it is a very clever bit of coding but they did not explain their methodology. I think I have used the same method at work to parse problem areas in n-dimentional arrays but being old I can't remember the name of the method. I think it is from graph theory, but as I said I am getting old. :lol:
 
Hi Platyping, i have a request for you. I'm using your "true prophet" mod component and i added more religions available in my personal mod. But, there is not yet a limitation for the number of religion in game. Consequently, you can found maybe 10 or more religions and that's ridiculous. I tried to use another mod comp called "limited religions", but after the merge, it seems that it doesn't work. After a quick check on the python code, it seems that it works with religions found by tech. Maybe that's why it doesn't work with "true prophet". The idea of the mod comp "Limited religion" was 'a civ can found only one religion". Can you do something please?
 
Nope, i will only bothered to fix bugs. No longer doing any modifications
 
@Chaos

See if this fix the upgrade graph key errors.
 

Attachments

  • Upgrade Graph.rar
    4.9 KB · Views: 224
There is a minor bug in your, and many other's, version of the Civics screen. In the BtS default one the help text connects to the pedia; ie clicking on linked text brings up the correct pedia entry. In yours, and others, it does not.

After testing I have determined that there is a bit of exe "magic" that is the cause. If a panel only contains the text (multi_line...) then the link works. If not it does not.

If I get a chance I will see if I can fix it in a visually pleasant way. However at the moment I can't post files or images to these forums.
 
Hi Platy, I think I have found a minor bug in PlatyPediaMain. I believe that line 1480 references the incorrect range and that:
PHP:
iItemEra = max(iItemEra, self.getBonusEra(ItemInfo.getPrereqAndBonus()))
for i in xrange(gc.getNUM_UNIT_AND_TECH_PREREQS()):
    iItemEra = max(iItemEra, self.getBonusEra(ItemInfo.getPrereqOrBonuses(i)))
should be:
PHP:
iItemEra = max(iItemEra, self.getBonusEra(ItemInfo.getPrereqAndBonus()))
for i in xrange(gc.getNUM_UNIT_PREREQ_OR_BONUSES()):
    iItemEra = max(iItemEra, self.getBonusEra(ItemInfo.getPrereqOrBonuses(i)))

BTS 3.19 global defines have NUM_UNIT_AND_TECH_PREREQS = 3 and NUM_UNIT_PREREQ_OR_BONUSES = 4. However, none of the BTS units have more than 2 OR bonuses so the final screen will be correct unless someone has a custom unit that has 4 prereq OR bonues. For the vast majority of people it will will work fine the way it is, but I thought I would point it out anyway. I believe that I am using the latest PlatyUI code.
 
There is a speed problem with World Tech if you have more than a few techs in the list. The biggest step is to fix the problem in CvEventManager py.

In Platyping's version
Code:
def onTechAcquired(argsList):
    'Tech Acquired'
    iTechType, iTeam, iPlayer, bAnnounce = argsList
    # Note that iPlayer may be NULL (-1) and not a refer to a player object
## World Tech ##
    WorldTech.WorldTech().sendMessage(iTechType, iTeam)
## World Tech ##
the problem lies in the line
WorldTech.WorldTech().sendMessage(iTechType, iTeam)​
This recreates the list of world techs every time it is called. This is because WorldTech is an object, WorldTech() creates the object and creating the object runs the __init__.

Something faster is needed when you have a lot of World Tech like the Russian Civil War mod by @ramzay1945. With the help of @Toffer90 a better place for this was found. (In my first try I put it before the XML was read. Didn't work :lol:)

All in CvEventManager.py

Step 1. create a place to hold the object and initialize it
Code:
    def onWindowActivation(self, argsList):
        'Called when the game window activates or deactivates'
        bActive = argsList[0]
        if bActive:
    ## World Tech ##
            if self.bNotReady:[/INDENT]
                global oWorldTech
                oWorldTech = WorldTech.WorldTech()
                # Only needs to be done once.
                self.bNotReady = False
    ## World Tech ##

Step 2. use this created object in onTechRequired
Code:
    def onTechAcquired(argsList):
        'Tech Acquired'
        iTechType, iTeam, iPlayer, bAnnounce = argsList
        # Note that iPlayer may be NULL (-1) and not a refer to a player object
    ## World Tech ##
            oWorldTech.sendMessage(iTechType, iTeam)
    ## World Tech ##

There are a number of other things that can be done to speed things up but this is the major one. Perhaps someday I will tidy things up and post a full fix.
 
@Chaos

See if this fix the upgrade graph key errors.

Its a few years too late, but yes, it works ;)
Thank You!

RE: some improvement shown twice - I am pretty sure it has to do with improvements getting + to 2 different bonuses, like +1hammer and +1 food.
Those improvements that only get a single + with a tech shown normally.
 
Top Bottom