• Civilization 7 has been announced. For more info please check the forum here .

FfH2 0.20 Bug Thread

You mean all my work is already obsolete? :sad:

Your initiative was great, your idea was great. But I probably won't implement like you did. My advantage is that I have access to Talchas ;)

I want human players to be able to pick their targets and AI players to use a function similar to yours, this is what I did so far:

Code:
def findTargetBanish(caster):
	iHiddenNationality = gc.getInfoTypeForString('PROMOTION_HIDDEN_NATIONALITY')
	iMagicImmune = gc.getInfoTypeForString('PROMOTION_MAGIC_IMMUNE')
	pPlayer = gc.getPlayer(caster.getOwner())
	eTeam = gc.getTeam(pPlayer.getTeam())
	iRange = 1
	iBestUnit = -1
	pBestUnit = -1
	iX = caster.getX()
	iY = caster.getY()
	if caster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_EXTENSION1')):
		iRange = iRange + 1
	if caster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_EXTENSION2')):
		iRange = iRange + 1
	for iiX in range(iX-iRange, iX+iRange+1, 1):
		for iiY in range(iY-iRange, iY+iRange+1, 1):
			if not (iiX == iX and iiY == iY):
				pPlot = CyMap().plot(iiX,iiY)
				for i in range(pPlot.getNumUnits()):
					pUnit = pPlot.getUnit(i)
					p2Player = gc.getPlayer(pUnit.getOwner())
					e2Team = p2Player.getTeam()
					if (eTeam.isAtWar(e2Team) or pUnit.isHasPromotion(iHiddenNationality)):
						if (caster.getOwner() != pUnit.getOwner() and pUnit.isHasPromotion(iMagicImmune) == False):
							iUnit = 5 * pUnit.baseCombatStr(true)
							iUnit += pUnit.getExperience()
							if iUnit > iBestUnit:
								pBestUnit = pUnit
	return pBestUnit

def reqBanish(caster):
	if canCast(caster) == False:
		return False
	if findTargetBanish(caster) == -1:
		return False
	return True

def spellBanish(caster,target):
	doCast(caster)
	pPlayer = gc.getPlayer(caster.getOwner())
	if pPlayer.isHuman():
		target = target[0]
	else:
		target = findTargetBanish(caster)
	if isResisted(target,caster,20) == False:
		CyInterface().addMessage(target.getOwner(),True,25,'Unit Banished.','AS2D_LOSS_LATE',1,'Art/Interface/Buttons/Spells/Banish.dds',ColorTypes(8),target.getX(),target.getY(),True,True)
		CyInterface().addMessage(caster.getOwner(),True,25,'Enemy Unit Banished.','AS2D_LOSS_LATE',1,'Art/Interface/Buttons/Spells/Banish.dds',ColorTypes(7),target.getX(),target.getY(),True,True)
		target.kill(True,0)

def validBanish(caster,pPlot):
	iHiddenNationality = gc.getInfoTypeForString('PROMOTION_HIDDEN_NATIONALITY')
	iMagicImmune = gc.getInfoTypeForString('PROMOTION_MAGIC_IMMUNE')
	pPlayer = gc.getPlayer(caster.getOwner())
	eTeam = gc.getTeam(pPlayer.getTeam())
	list = []
	if pPlayer.isHuman() == False:
		list.append(findTargetBanish(caster))
		return list
	if inRange(caster,pPlot,1) == False:
		return list
	for i in range(pPlot.getNumUnits()):
		pUnit = pPlot.getUnit(i)
		p2Player = gc.getPlayer(pUnit.getOwner())
		e2Team = p2Player.getTeam()
		if (eTeam.isAtWar(e2Team) or pUnit.isHasPromotion(iHiddenNationality)):
			if (caster.getOwner() != pUnit.getOwner() and pUnit.isHasPromotion(iMagicImmune) == False):
				list.append(pUnit)
	return list

Similar to yours with the inclusion of the findtargets function to get the AI to pick a good target. Im trying to keep the ability to have humans pick a target and the ai use the findtarget function to do it. Having the base spell system work 2 ways depending on if the player is human or not was why Talchas was asked to look into it.

Anyway, there are a couple isHasRealBuilding left in CustomFunctions.py and FfHSpells.py

Cool, thanks I'll check it out.
 
You need to install the full mod, you just have the patch installed. All of the art is in the full mod.

Thanks,

Hopefully my future questions won't be as dumb.

Thanks again for all you do, this Mod has eaten a ton of my life already.
 
Your initiative was great, your idea was great. But I probably won't implement like you did. My advantage is that I have access to Talchas ;)

I want human players to be able to pick their targets and AI players to use a function similar to yours, this is what I did so far:

It's looking great. I just wish I knew this earlier so I could have used my time more productively. :cry: Now woodelf is pissed off at me because I'm not busy thinking up SMAC techs.

Another kind of spells the AI don't use well right now is terraforming spells. I was wondering, how about for the moment just increasing the area which an AI spellcaster affects, so that it would be less necessary to teach casters to walk all over the place? Eg something like this?

Code:
def spellSpring(caster):
	doCast(caster)
	pPlot = caster.plot()
	if (pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_DESERT') and pPlot.getFeatureType() != gc.getInfoTypeForString('FEATURE_FLOOD_PLAINS')):
		pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
	iX = pPlot.getX()
	iY = pPlot.getY()
	for iiX in range(iX-1, iX+2, 1):
		for iiY in range(iY-1, iY+2, 1):
			pPlot2 = CyMap().plot(iiX,iiY)
			if pPlot2.getFeatureType() == gc.getInfoTypeForString('FEATURE_FLAMES'):
				pPlot2.setFeatureType(-1, -1)
			if pPlot2.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_SMOKE'):
				pPlot2.setImprovementType(-1)
	pPlayer = gc.getPlayer(caster.getOwner())
	if pPlayer.isHuman() == False:
		for iiX in range(iX-2, iX+3, 1):
			for iiY in range(iY-2, iY+3, 1):
				pPlot3 = CyMap().plot(iiX,iiY)
				if (pPlot3.getTerrainType() == gc.getInfoTypeForString('TERRAIN_DESERT') and pPlot3.getFeatureType() != gc.getInfoTypeForString('FEATURE_FLOOD_PLAINS')):
					pPlot3.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
				if pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_FELLOWSHIP_OF_LEAVES'):
					if pPlot3.getFeatureType() == gc.getInfoTypeForString('FEATURE_FLAMES'):
						pPlot3.setFeatureType(-1, -1)
					if pPlot3.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_SMOKE'):
						pPlot3.setImprovementType(-1)

def spellVitalize(caster):
	doCast(caster)
	pPlot = caster.plot()
	if(pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_SNOW')):
		pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_TUNDRA'),True,True)
	elif(pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_TUNDRA')):
		pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
	elif(pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_DESERT')):
		pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
	elif(pPlot.getTerrainType()==gc.getInfoTypeForString('TERRAIN_PLAINS')):
		pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_GRASS'),True,True)
	iX = pPlot.getX()
	iY = pPlot.getY()
	pPlayer = gc.getPlayer(caster.getOwner())
	if pPlayer.isHuman() == False:
		for iiX in range(iX-2, iX+3, 1):
			for iiY in range(iY-2, iY+3, 1):
				pPlot2 = CyMap().plot(iiX,iiY)
				if(pPlot2.getTerrainType()==gc.getInfoTypeForString('TERRAIN_SNOW')):
					pPlot2.setTerrainType(gc.getInfoTypeForString('TERRAIN_TUNDRA'),True,True)
				elif(pPlot2.getTerrainType()==gc.getInfoTypeForString('TERRAIN_TUNDRA')):
					pPlot2.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
				elif(pPlot2.getTerrainType()==gc.getInfoTypeForString('TERRAIN_DESERT')):
					pPlot2.setTerrainType(gc.getInfoTypeForString('TERRAIN_PLAINS'),True,True)
 
I got this screen the turn Acheron was built. Still on patch e.

Civ4ScreenShot0072.JPG

darn, you beat me before I could check what it was again that patch f fixed. ;) Sorry, thanks.
 
It's looking great. I just wish I knew this earlier so I could have used my time more productively. :cry: Now woodelf is pissed off at me because I'm not busy thinking up SMAC techs.

Well, your code does have an advantage over mine, it works.

As for woodelf, don't worry he's just a <edited by moderator>marvelous handsome hunk of a man who inspires everything I do<end edit>. And trust be you wouldn't want to be that goat.
 
Don't know if this has been mentioned but...

Loading the "AutoSave_Initial" save file or using the Regenerate Map option available on turn 1 means that all the startup map changes don't get done. No Sentry Towers, no barrows/etc, and no barbarian skeleton ship. My first game I didn't notice this and the early game was strangely low-key.

Also, what is the intended density of mana nodes? Playing on Fractal Huge maps, I'm getting about 1 per player - over the entire world. Basically the same effects with SmartMap. Apparently because you replaced an existing resource (Oil?) it also pretty much only exists in desert and plains. Huge swaths of jungle have no nodes. Perhaps a custom map generator might be required.

Very nice mod btw, I never played the previous version but got linked to this version and have spent (too) much time playing recently. A definite reawakening of Civ4 for me.

A documentation issue: From the wiki I was under the impression that arcane units would gain the free spellcasting promotions at any time the player got appropriate mana. Playing quickly pointed out this error, they only gain free promotions based on the mana at their creation. This could be because the wiki is still mostly on the previous version, or just not being clear enough.
 
I killed the Sidar hero and got some promotions with my revellers unit (including a movement +1 promotion). As you can see he has 3 movement but can only move 2 squares!




EDIT: Whoops!!! He has 3 movement but graphically it wasn't showing it before he moved.
 
I have 1 eater of dreams and I can't upgrade any more conjurers to eaters of dreams!!!:cry: You can see in the picture I have reagents.


They have to be at least 6th level.
 
started a game and switched to infernal when I discovered ashen veil game went fine untill I reached the armageddon clock went over 100... it was at 99 and I razed an order city putting it at 101 the first time it went right to the desktop as soon as I razed the city so I loaded an autosave a few turns back razed it again and got something like 20 manes then as soon as I ended my turn it crashed again. is this a normal problem or should I post the saved game?
 
How do barbarian melee units get the bronze weapons upgrade?

I opened the World Builder and didn't see any of the barb cities with a copper mine.

Thanks.
 
OK, the Counter hits 40 and I lose my pastures, farms, plantations, etc. Catastrophic to be sure as I quickly lost 1/3 of my population.

But, what really hurt, and I didn't expect is that I lost the resources themselves: Cows, Pigs, Rice, and the one that hurt the most Regents all disappeared from the map. I would say about 1/4 of my resources were eliminated.

Is this correct?
 
OK, the Counter hits 40 and I lose my pastures, farms, plantations, etc. Catastrophic to be sure as I quickly lost 1/3 of my population.

But, what really hurt, and I didn't expect is that I lost the resources themselves: Cows, Pigs, Rice, and the one that hurt the most Regents all disappeared from the map. I would say about 1/4 of my resources were eliminated.

Is this correct?

i think the civilodia said it will destroy some resorces
 
Blight should destroy food ressources, not reagents AFAIK!
 
Is this correct?

Yup, that is suppose to happen. Yesterday when Blight hit my Vampires had a great feast on those who could not survive on the lowered food production ]:->

@crazy_cowboy: What patch are you using? Do you have the pyton error popups switched on? Can you post a save?

PPL! Think, they cant help you if you wont tell them the circumstances when the error occurred. Normally I would ask for logs but in this case you have to:
- post the version number - patch letter
- try to reproduce it
- reproduce it with the error popups turned on [see first post]
- atach a save game file
 
Top Bottom