Platy's Peculiar Pleasant Posh Python

Hi, platyping. Ihave test finished. I would like to ask you, if you can make one editation into code for me. Code unfortunatelly placed improvement into city, because city is on hill :(
Is possible add into code Improvement_xyz it is not possible to build in city
and
can not be built on the hill where it is another improvement

If is it possible, can you edit code for me, please?
 
Hi, platyping. Ihave test finished. I would like to ask you, if you can make one editation into code for me. Code unfortunatelly placed improvement into city, because city is on hill :(
Is possible add into code Improvement_xyz it is not possible to build in city
and
can not be built on the hill where it is another improvement

If is it possible, can you edit code for me, please?

I would suggest the following
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if iBuildingType == gc.getInfoTypeForString("BUILDING_TSUKIJI"):
			lHills= []
			for i in xrange(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isNone(): continue
				if pPlot.getBonusType(-1) > -1: continue
				if pPlot.getTeam() != pCity.getTeam(): continue
[B]				if pPlot.isCity(): continue
				if pPlot.getImprovementType(-1) > -1: continue
[/B]				if pPlot.isHills():
					lHills.append(pPlot)
			if lHills:
				pSelectedPlot = lHills[CyGame().getSorenRandNum(len(lHills), "Freebie")]
				pSelectedPlot.setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_TSUKIJI"))

Although I am not totally sure about the getImprovementType because 0 means land worked, 1 means sea worked and 2 means city ruins. So
Code:
				if pPlot.getImprovementType(-1) > [B]2[/B]: continue
if you don't mind city ruins being replaced.
 
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if iBuildingType == gc.getInfoTypeForString("BUILDING_TSUKIJI"):
			lHills= []
			for i in xrange(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isNone(): continue
				if pPlot.getBonusType(-1) > -1: continue
				if pPlot.getTeam() != pCity.getTeam(): continue
				[B]if pPlot.isCity(): continue
				iImprovement = pPlot.getImprovementType()
				if iImprovement > -1 and gc.getImprovementInfo(iImprovement).isPermanent(): continue[/B]
				if pPlot.isHills():
					lHills.append(pPlot)
			if lHills:
				pSelectedPlot = lHills[CyGame().getSorenRandNum(len(lHills), "Freebie")]
				pSelectedPlot.setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_TSUKIJI"))

I wouldn't bother to check for whether there is just an improvement, since chances are by the time a wonder is built, hills would have mines or windmills, then 99% nothing will happen.
 
Hi Platy--
I'd love to integrate your Senile Soldier code with the stipulation that the button only becomes available when units are in cities that have Barracks (and Ikhandas). I wouldn't know what to put in for that or where to put it. Is that a fairly simple bit of code that you can show us?
Thanks!
 
Just add a if check somewhere suitable.
If there are only 2 of those buildings, hardcore method will do.

if pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_XXX")) + pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_YYY")) > 0:

Else, it will be more troublesome.
 
Hey Platy, do you think it would be possible to modify your Auto Avoid Growth component so that instead of the universal setting, the button on each city screen has 3 states: off, on, and automatic?
 
Platyping, quick question; Do you have a version of your mods designed to work with your ultrapack/Platy UI, or a gigantic pack with all your mods or something? I'm trying to make a merge of a number of modcomps, but I don't have enough python experience to merge your mods designed for the standard BTS UI with Platy UI (unless there's some simple trick I'm missing).

Any help would be greatly appreciated.
 
Platy,
I'm noticing an issue with the barbarian hunter promotion. It seems that, when a unit with that promotion and 10+ XP is upgraded (e.g. maceman -> rifleman), its total number of earned experience points resets down to 10. I've tested this with a couple of different units and it seems to be a consistent issue.

Hoping you know of a fix, or are able to implement one :cool:
 
@8Bit
Any python mod can be merged easily with the UI, since most of them don't contain any UI edits.
There are of course some exceptions such as Bad People Mod, which requires addition of a Join City Button, which then requires some copy & paste skills.

@Hero
It has always been that way in BTS...
 
Well, about that, how would I go about getting the Advanced Settlers interface - the icons (and text pop-ups relating to them) that would show up on the appropriate technologies - to work? Because it doesn't for me.
 

Attachments

  • Files.rar
    26.9 KB · Views: 98
If it doesnt work on standalone, then i will look into it.
If it is merged, depends on what you did. 99% due to hover text deactivated by BUG.
 
It works on vanilla Beyond the Sword. What is this hover text deactivation, if you know? Because I can still see text when hovering over technologies, just like I see the text in vanilla Beyond the Sword. Would you know if - and how - one could manually add an icon to technologies, perhaps? Thank you though. :)
 
CvTechChooser
BUG disables the way hover text is added for custom made icons and forces users to implement it via their way. Naturally, vanilla icons will still have hover text.
 
Mhm, I see the differences, but I have no idea how to add something like this, as there isn't a nicely defined 'category' for this, such as, say, civics, bonuses, processes (which is what seems to be used).

I saw something about adding new widgets, but eh, I know nothing about this, and considering I know which technologies give me what when it comes to Settlers, I suppose I can do without icons on the tech tree in this case.

Thank you anyway, though!
 
Probably a daft question but I can't find a link - where's the download link?

Clicking Wonders and Projects Traits and Promotions takes me to the 4 Platyping's Python wonders and movies packs
 
@Orbimobius
The download links are in those pages. Though those are early works and I didn't bother to check again.

@alberts
There is an updated version in Ultrapack for Forgetful which displays the respective text tags as well. Reuploaded standalone for your convenience.
 
Top Bottom