Platy's Peculiar Pleasant Posh Python

Didn't bother to check.
Already stated, Banks in all cities. If you only have one city, naturally you only need one bank.
 
As in build stuff, heal units, grant culture etc? Nope

Let's relax requirements. I hope you are familiar with Mongol Camp unit from Warlord's Fraxis scenario. It "spawns" units based on terrain and turns of rest. Suppose we just want it generate culture only. Is that doable?
 
Generates Culture, yes.
But it will not retain ownership of the plots.
 
Ultrapack

Religions Advisor
No longer display founded info if no respective founding tech.


P.S.
Out of boredom, I tried implementing the Great General Bar back, then realize it is a bad idea. For it to be "up to date", it has to be refreshed every now and then (250ms), but it becomes a "give away" sign that the battle is won before the animations are concluded, which is why XP text in Unit Panel displays "?" instead.

So the only way it is not a "give away" sign, is either
1) By not updating it frequently
2) Looping through all units and checking if any is in the midst of a fight.
 
Could it be updated at the end of the turn instead of by ms? I don't know if that is even possible to code in there.

Dear platy, do you think you could turn your illustrious python brain to perhaps writing a religion screen founding code that would work with this founidng code?

It works with onbuildingbuilt.
You can probably see how it works just by looking at it. It basically looks to see if it is the religion founding building that has been built, then founds the builder civs corresponding religion.

Spoiler :
Code:
	#Religion
		iCapitol =gc.getInfoTypeForString("BUILDING_CAPITOL")
		if iBuildingType != iCapitol: return
		iPlay = pCity.getOwner()
		pPlay = gc.getPlayer(iPlay)
      # Perform string operation to get corresponding religion name, eg
      # "TXT_KEY_CIV_HOPEVLLE_DESC" => "RELIGION_HOPEVILLE"
      # For v11, fix bug found by Dresden, v10 feedback thread, post 5
      # Was: sCivdesc = pPlay.getCivilizationDescriptionKey()
		pCiv = gc.getCivilizationInfo(pPlay.getCivilizationType())
		sCivdesc = pCiv.getTextKey()
		sReldesc = sCivdesc.replace("TXT_KEY_CIV_", "RELIGION_")
		sReldesc = str(sReldesc.replace("_DESC", ""))
		iRel = gc.getInfoTypeForString(sReldesc)
		if iRel != -1:
			CyGame().setHolyCity(iRel, pCity, 1)
			pPlay.convert(iRel)
			Logger.writeLog(gc.getReligionInfo(iRel).getText() + " founded\n")
		else:
			Logger.writeLog("Unable to convert " + sCivdesc + " to religion\n")
 
If it is at end of turn or whatever, then it is definitely not up to date, since obviously i can fight 10 battles before end of turn.

So either it is up to date but waste of performance for constant looping, or it is up to date but leaks info.
 
Hey :D
Just turned python exceptions on and...

Donno if its my setup but if I add CvMapGeneratorUtil.py to python folder (original or modded version) it come up with error on all mapscripts that : "Import Error: cannot import name BonusBalancer".

So I tried to put original CvMapGeneratorUtil.py (from civ4 folder not the Warlords one as it seems older) into your latest PlatyUI and error still come up. Any clues what might be wrong?

Strange thing is, that without python exceptions on, game runs fine, but as soon as turning them on, game wont start???

Cheers
Vincentz :D
 
I would take the file from Warlords, even if the date seems older. It contains the class BonusBalancer, the vanilla one doesn't.
 
Yup, that works. Thanks :D

Sometimes you just gotta love the easy solutions ;)

Strange thing is, I've been using the Marsh CvMapGeneratorUtil.py since beginning of times, and havent seen any python errors before.

Well, stuff is working, case is closed :D
 
Hey platy, I am having trouble getting the city screen filters to work properly, some don't seem to work at all, like the prereq filter and the food filter, others seem to do strange things like the culture filter removes things that produce no culture..

I am just wondering how these work, and where the code for them is located, I have found one section but I am not sure if this is all the code, or if there is more somewhere else.

I have seem them work in the base mod, so I am not sure why they don't work properly for me, just trying to work out how they look for things and make deicisions, incase something is missing or relabelled or what!?!
 
Based on advisor types. If XML is screwed, naturally it filters wrong stuff.
Prereq will work unless dll is messed, sorts by canTrain function.
 
Right yeah, so I have to go through and set the right advisor types in the building xmls, that is something I haven't done in the past, but fine that one makes sense and is an easy fix :)

Can you elaborate a bit more on the prereq one. I have a custom .dll so that is obviously playing some part, what do you mean by messed?

Also does the cantrain function work with buildings or just units?

Basically I have a lot of buildings that have prereq buildings, using the standard xml tag in the buildinginfo. Would this work with a cantrain filter?

Also, I have found how to move up the specialists section in the city screen to give me some room underneath it, but I cannot find where to move up the great specialist icons and the GP Bar in that section. Where is that placement specified?
 
Ultrapack

Revamped the Platy Options system.
No longer "Graphic Options". Look for icon, top left to play around.
To prevent clashing with merging.

@Lib
AFAIK, some mods changed the way canTrain and canConstruct functions. Rev is one of them.
Great Specialists are coded in same section as normal Specialists.

The bar's location is somewhere in interfaceScreen section.
Look for "GreatPeopleBar".
 
I found an iY= reference in the specialist section of the code, changing that moved all the specialists, but I cannot find any other references like that in that section, to move the GS icons up..is it coded in a different way, like a relative statement or something? Like screen res Y -200 or whatever..

same for the GP bar in the city screen, I have looked through those marked sections in the code, but I am struggling to find a reference for it's height placement in that screen, I am presuming it is written in some fancy manner that I don't recognise..
 
Ultrapack

Revamped the Platy Options system.
No longer "Graphic Options". Look for icon, top left to play around.
To prevent clashing with merging.

:) :goodjob: :cool:
 
I have a request (or assistance with old pythoncode :))
I used to have a intromovie for my mod, but lately I just updated Platy UI by overwriting pythonfiles.
I recently made a new intromovie (Link), but when I used the original way to add the movie (Tutorial), i get some python errors.

attachment.php
attachment.php


I'm a bit clueless (totally clueless) to what is the error, so any help/assistance is greatly appreciated.

btw. the movie plays ok, so its just to get rid of the annoying errors ;)

Cheers
Vincentz :D
 
The short answer:
Don't bother. Platy UI comes with inbuilt function to display intro movie.
Check the sample document.
 
Ultrapack

Specialist and Resource Tables
Add a variable in ini section, which will shift Resource Table, Specialist Table, Free Specialist section and City GP Bar together.
Simply put, it determines Y location of City GP Bar, and everything else adjusts automatically.
 
Back
Top Bottom