MagisterCultuum
Great Sage
Could you please use [code][/code] instead of [quote][/quote]? Indentation may not really matter in C++ like in Python, but it still makes things easier to read.
Just for curiosities sake, try your spell on a settler
Could you please use [code][/code] instead of ? Indentation may not really matter in C++ like in Python, but it still makes things easier to read.
Another small question: Which files do I have to edit in order to make a new UnitCombat?
Vermicious Knid: Art errors will almost ALWAYS cause a CtD, and it won't give you a chance to get any information on what the crash was. So I would check there first.
iAnimal = gc.getInfoTypeForString('UNITCOMBAT_ANIMAL')
if pPlayer.getNumUnits(iAnimal) < 20:
return False
Vermicious Knid: Art errors will almost ALWAYS cause a CtD, and it won't give you a chance to get any information on what the crash was. So I would check there first.
sylvain5477: Remove the python requirement from your spell. See if it still fails to work. If it starts to work then, put the python prereq back in there, but have it return true on the first line (so essentially doesn't do anything), if that still works, restore your full python from before, but instead of returning the check on the player for canFound, use it as an IF statement, return true if the IF passes, otherwise let it run to a return false statement.
def reqCanFound(caster):
pPlot = caster.plot()
pPlayer = gc.getPlayer(caster.getOwner())
if pPlayer.canFound(pPlot.getX(),pPlot.getY()) == false:
return false
return true
After all these tests and somemore, there is a working combinaison:
Strangely, returning directly does not work, as if the "true" is not returned when not false...Code:def reqCanFound(caster): pPlot = caster.plot() pPlayer = gc.getPlayer(caster.getOwner()) if pPlayer.canFound(pPlot.getX(),pPlot.getY()) == false: return false return true
Thank you for your suggestions.
Hi there!
I'm adding buildings that give extra yields to city plots, such as +1on plains with a unique smokehouse. Issue: the bonus is still there if the terrain becomes a grassland or a desert or anything else. I would like to check if the terrain changed and thus recalculate extra yields. I thought of check tiles every turn, seeing if their actual yields match their theoretical yields and acting consequently but it could cripple the loading time, I think, even though it only checks city workable tiles. Is there any other way to do this?
Does resistance affect the damage cap of a spell, as well as the damage done?
I've set my Breathe Fire spell to have a damage limit of 100, but I can't seem to kill Orcish warriors with it, presumably because of their resistance to fire.
Also, how much random variance is there around the supposed damage value? I'm seeing damage values varying widely on either side of (but mostly below) the 40% damage value I set for the spell.
Over 3 casts while attakcin a Khadi scout
74%
22%
1%
This seems strange. The damage for the spell is set at 40%, so the scout should be dead after 3 casts. How can a spell with no damage cap, be reduced so much as to do only 1% damage? This is a str2 scout against a str40 dragon
And also, do units in cities get extra magic resistance? Casting Breathe Fire on a city containing 5 enemies, I'm frequently getting all 5 of them resisting. The resist chance of the spell is 40% (20% resistance modifier)
Have you placed the unit on a mountain, next to (or in) another city or in the ocean to make sure that it returns false when it should?
iAnimal = gc.getInfoTypeForString('UNITCOMBAT_ANIMAL')
if pPlayer.getNumUnits(iAnimal) < 20:
return False
Thanks. I think I will have to thoroughly read your idiots' guide in order to mod the dll. It would make things much easierIf you set this up in the SDK, you want to modify CvPlot::setTerrainType or whatever it is called so that if the terrain changes, it updates the yield of the tile all over again. Ought to do that anyway, so I am guessing you set it up in python. I don't think there is a callback for when terrain type is set, so it'll be pretty tricky to fix.
How about something like this?So, any idea if this will work? Kind of hard to test, as it's for the AI only...![]()
animalunits=0
for pUnit in player.getUnitList():
if pUnit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_ANIMAL'):
animalunits+=1