Are the text strings part of the main interface file the only things that need to be changed, or are other adjustments needed as well?
Okay, I have another question about spells to change units. I have created a spell for a unit to change into another unit. That new unit has a spell to change back to the previous unit. It's the mechanism I am using for a Transformers-based mod so the units may transform.
Anyway the problem as follows: I notice the AI uses it, but in tests I give them one unit in the World Builder, but when it's their turn, there are multiple instances of the spell's audio effect (almost stuttering-like and louder because it is happening several times at once) and then the AI has multiple versions of that unit.
I have only only filled in the ConvertUnitType, Unit Prereq and the Booleans: HaveCasted and IgnoreHaveCasted (plus AllowAI) are 1.
I cannot replicate it as a player. It's just the AI. Any ideas on what could be causing this effect?
def postCombatTreant(pCaster, pOpponent):
pPlot = pCaster.plot()
if pPlot.getFeatureType() == -1:
if pPlot.canHaveFeature(gc.getInfoTypeForString('FEATURE_FOREST_NEW')):
pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST_NEW'), 0)
def onUnitLost(self, argsList):
'Unit Lost'
unit = argsList[0]
player = PyPlayer(unit.getOwner())
# pPlot = unit.plot()
iX = unit.getX()
iY = unit.getY()
pPlot = CyMap().plot(iX,iY)
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_TREANT'):
CvUtil.pyPrint('Treant check')
if pPlot.getFeatureType() == -1:
CvUtil.pyPrint('feature check')
if pPlot.canHaveFeature(gc.getInfoTypeForString('FEATURE_FOREST_NEW')):
CvUtil.pyPrint('creating forest')
pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FOREST_NEW'), 0)
if (not self.__LOG_UNITLOST):
return
CvUtil.pyPrint('%s was lost by Player %d Civilization %s'
%(PyInfo.UnitInfo(unit.getUnitType()).getDescription(), player.getID(), player.getCivilizationName()))
PY:Treant check
PY:feature check
PY:Treant was lost by Player 0 Civilization Ljosalfar
PY:Treant check
PY:feature check
PY:Treant was lost by Player 0 Civilization Ljosalfar
PY:Treant check
PY:feature check
I'm guessing that pPlot isn't being set correctly?!?
Hi. I would like to incorporate the <ihealrate> .xml tag of improments into my mods. FFH2 seems like a very big mod so I am not sure if it is in the .sdk/python, etc. Do you know what code I would need to incorporate it? I do know the .xml schema of my mod would have to change.
pCity = pPlot->getPlotCity();
iTotalHeal = 0;
if (pPlot->isCity(true, getTeam()))
{
iTotalHeal += GC.getDefineINT("CITY_HEAL_RATE") + (GET_TEAM(getTeam()).isFriendlyTerritory(pPlot->getTeam()) ? getExtraFriendlyHeal() : getExtraNeutralHeal());
if (pCity && !pCity->isOccupation())
{
iTotalHeal += pCity->getHealRate();
}
}
I'm pretty sure that's the sdk code you are talking about. I gues I'd have to change isCity to eImprovmenttype(somehow add it to define the imrpvoment I want, which is a field hospital) and remove city heal rate?
//FfH: Added by Kael 10/29/2007
if (pPlot->getImprovementType() != NO_IMPROVEMENT)
{
iTotalHeal += GC.getImprovementInfo((ImprovementTypes)pPlot->getImprovementType()).getHealRateChange();
}
if (iTotalHeal < 0)
{
iTotalHeal = 0;
}
//FfH: End Add
comparing the original bts .cpp and that one leads me to conclude that I just need to copy that code block into my .cpp file, then add the .xml tags/values, and finally modify the improvement schema?
Sounds about right.