Mod-Modders Guide to Fall Further

Couldn't figure out what you were talking about till I checked the first page and didn't find it, then remembered that Jean has added a bit and I forgot to document it here. Now I have to figure out precisely which tags are missing from the first posts :(

As I recall the approach used by Jean for these fields though, it should automatically be considered, as it changes what the plot itself is worth, instead of what the improvement is worth. But I haven't specifically checked out how the improvement changes were written, so I could be mistaken, in which case you are correct that the AI knows nothing about them.
 
Edit: Here's a block that actually DOES force peace with Animals, but it comes up with some python errors as well... From CvMainInterface? Can't think of what would cause a problem there, as I'm editing CvEventManager...

Edit: Wait, looks like it's only happening with Charadon. Maybe the fact that he is at peace with both Barbs and Animals is causing issues with the display?

Edited again: And now it's not coming up with the exception at all. No idea why, but I'm going with it lol.

Code:
def onGameStart(self, argsList):
	'Called at the start of the game'

	for iPlayer in range(gc.getMAX_PLAYERS()):
		player = gc.getPlayer(iPlayer)
		if player.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_DOVIELLO'): #Doviello start
			iAnimalTeam = gc.getANIMAL_TEAM()
			eTeam = gc.getTeam(player.getTeam())
			eTeam.makePeace(iAnimalTeam) #Doviello end
		if (player.isAlive() and player.isHuman()):
			if player.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_ELOHIM'):
				cf.showUniqueImprovements(iPlayer)
 
Couldn't figure out what you were talking about till I checked the first page and didn't find it, then remembered that Jean has added a bit and I forgot to document it here. Now I have to figure out precisely which tags are missing from the first posts :(

As I recall the approach used by Jean for these fields though, it should automatically be considered, as it changes what the plot itself is worth, instead of what the improvement is worth. But I haven't specifically checked out how the improvement changes were written, so I could be mistaken, in which case you are correct that the AI knows nothing about them.

After some more tests it seems that the AI considers the value of the most upgraded improvement chain to decide whether or not to use the tile, not the current improvement value (which is logical for cottage).
In my case the improvement was decaying with time, and so never chosen it seems as the last value (after a chain of 5 stages) was 0.

I'm looking for a way to go around this.
 
Just add another improvement which DOES give good results at the end of the chain, but make the time to upgrade to it REALLY long. AI won't be smart enough to self-pillage and rebuild anyway, so it would work well for them to have a permanent-first level improvement after about 500 turns (unless you script for them to self-pillage in AI lands upon reaching your current last level of course)
 
Just add another improvement which DOES give good results at the end of the chain, but make the time to upgrade to it REALLY long. AI won't be smart enough to self-pillage and rebuild anyway, so it would work well for them to have a permanent-first level improvement after about 500 turns (unless you script for them to self-pillage in AI lands upon reaching your current last level of course)

So simple and yet so fullfilling my needs :)
I'll just do that and have a nice attractive name for the 10000 turns final improvement.

I was wondering if improvements could be made to cycle though, hence never having a final improvement :) (1 => 2 => 3 => 1)
I'll try it also for curiosity.

Thank you for your help.

Now at last back to auto growing improvement.
 
I think it may end in an infinite loop :)
Will try when back from work.
 
Now I have to figure out precisely which tags are missing from the first posts :(

Those are the changes I know about:

Added tags:

CIV4CivilizationInfos.xml:
  • <FeatureHealthPercentChanges>
  • <FeatureYieldChanges>
  • <ImprovementYieldChanges/>
  • <TerrainYieldChanges/>
CIV4StateNameInfos.xml:
  • <iMinNumCitiesConquered>
  • <iMinNumVassals>
  • <bFullCiv>
  • <bMinorCiv>
  • <bSovereign>
  • <bVassal>
  • <bColony>
  • <bFemaleLeader>
  • <PrereqLeader>

Removed tags:

CIV4TerrainInfos.xml:
  • <CivilizationYieldType>
  • <CivilizationYieldChange>
CIV4StateNameInfos.xml:
  • <bNoMinor>
  • <bNoVassal>
 
Hmm... Autoupgrade does not seem to work for any improvements but forts/citadels... I had it work perfectly when I put in the Citadel of Light, but now it's not allowing me to upgrade an animal den.

Edit: Wait, looks like I need to enable <bOutsideBorders> for the upgrade, as well as the original. Thought that would cause them all to upgrade, but since it requires Doviello it only upgrades in their territory. :goodjob:
 
So simple and yet so fullfilling my needs :)
I'll just do that and have a nice attractive name for the 10000 turns final improvement.

I was wondering if improvements could be made to cycle though, hence never having a final improvement :) (1 => 2 => 3 => 1)
I'll try it also for curiosity.

Thank you for your help.

Now at last back to auto growing improvement.

Base BtS (and FfH): If it enters into an infinite loop (identified by checking the upgrade of the upgrade more times than there are improvements in your XML) it claims that it doesn't upgrade at all (and thus the city considers the current improvement only). Current FF release: Instead of claiming it doesn't upgrade at all, it claims that it upgrades to whatever improvement it is currently checking on (so a nearly random choice from the loop), future releases (I just tweaked it again), it will consider the next upgrade to the current improvement.


I had also thought once of making cycling improvements. Like a farm which is REALLY fertile for 10 turns, then pretty much sucks for 30 turns (but the one you can actually build is the one that sucks, otherwise you'd just pillage it when it goes bad and rebuild).


Just checked up on how to let something upgrade automatically: It isn't tied to the CURRENT improvement being marked bOutsideBorders at all. It is tied to the UPGRADE being bOutsideBorders only (absolutely nothing else is required, other than actually being upgradeable)
 
Just checked up on how to let something upgrade automatically: It isn't tied to the CURRENT improvement being marked bOutsideBorders at all. It is tied to the UPGRADE being bOutsideBorders only (absolutely nothing else is required, other than actually being upgradeable)

Which is why I'm glad the PrereqCivilization tag requires it to be in the civs borders in order to upgrade. :lol:
 
Just checked up on how to let something upgrade automatically: It isn't tied to the CURRENT improvement being marked bOutsideBorders at all. It is tied to the UPGRADE being bOutsideBorders only (absolutely nothing else is required, other than actually being upgradeable)

Thank you for taking the time to check it out.
I'll try it out right away now that it seems everything is clear :)
 
Just checked up on how to let something upgrade automatically: It isn't tied to the CURRENT improvement being marked bOutsideBorders at all. It is tied to the UPGRADE being bOutsideBorders only (absolutely nothing else is required, other than actually being upgradeable)

Everything works fine now.
Thanks again :D
 
Hmm... Can't figure out why this isn't working.
Code:
def onCombatResult(self, argsList):
	'Combat Result'
	pWinner,pLoser = argsList
	playerX = PyPlayer(pWinner.getOwner())
	unitX = PyInfo.UnitInfo(pWinner.getUnitType())
	playerY = PyPlayer(pLoser.getOwner())
	unitY = PyInfo.UnitInfo(pLoser.getUnitType())
	pUnit = pWinner
	if playerX.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_DOVIELLO'):
		if pLoser.isAlive():
			pWinner.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SCAVENGER'))
 
Hmm... Can't figure out why this isn't working.
Code:
def onCombatResult(self, argsList):
	'Combat Result'
	pWinner,pLoser = argsList
	playerX = PyPlayer(pWinner.getOwner())
	unitX = PyInfo.UnitInfo(pWinner.getUnitType())
	playerY = PyPlayer(pLoser.getOwner())
	unitY = PyInfo.UnitInfo(pLoser.getUnitType())
	pUnit = pWinner
	if playerX.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_DOVIELLO'):
		if pLoser.isAlive():
			pWinner.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SCAVENGER'))

You're missing a "true" from setHasPromotion...

Code:
void setHasPromotion (PromotionType eIndex, bool bNewValue)

Also - why not use <PromotionFromCombat>? Most of the Doviello Melee line is unique, so it could be added to them trivially (it's a UnitInfo field, so not sure it'd work well for non-unique units, but does it need to be for *every* Doviello unit?).
 
You're missing a "true" from setHasPromotion...

Code:
void setHasPromotion (PromotionType eIndex, bool bNewValue)

Also - why not use <PromotionFromCombat>? Most of the Doviello Melee line is unique, so it could be added to them trivially (it's a UnitInfo field, so not sure it'd work well for non-unique units, but does it need to be for *every* Doviello unit?).

D'oh. Knew it would be something simple... That's what I get for thinking I know the function well enough to not have to use a reference. :lol:

About the <PromotionFromCombat>... Really, I could, but I want it for at least Melee and Recon. Maybe I could use a <PromotionCombatApply> from an effect promo....
 
Back
Top Bottom