CyrusOrlandeau
Everescan
Okay, so I was experimenting with an idea of mine, and I'm close to what I want, but I hit a snag. In FF+ after you claim a fort you get the commander, and the next turn your territory expands to that one tile the fort is on.
Well, I was modifying what I needed for my idea, and everything has gone smoothly, except I can't get my territory to expand to the tile.
Here's the code I'm using in CvSpellInterface:
I know the middle string still has the feature for the Khazad and their line of forts, but I don't know how to remove it without disabling the entire spell.
I'm trying to make it so that an Adept can claim a tower as a magical keep, and everything has worked out so far, except for the problem above, and my territory won't expand to the tile. I don't know what else to do. Please help, this is my first ime modding python code.
-A9A
Well, I was modifying what I needed for my idea, and everything has gone smoothly, except I can't get my territory to expand to the tile.
Here's the code I'm using in CvSpellInterface:
Spoiler :
def reqClaimTower(caster):
iUnitMagistrate = CvUtil.findInfoTypeNum(gc.getUnitClassInfo,gc.getNumUnitClassInfos(),'UNITCLASS_MAGISTRATE')
pPlot = caster.plot()
for iUnitLoop in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(iUnitLoop)
# Can't cast if another commander is there
if pUnit.getUnitClassType() == iUnitMagistrate:
return false
if pPlot.isOwned():
if pPlot.getOwner() != caster.getOwner():
pPlayer = gc.getPlayer(caster.getOwner())
eTeam = gc.getTeam(pPlayer.getTeam())
p2Player = gc.getPlayer(pPlot.getOwner())
e2Team = p2Player.getTeam()
if eTeam.isAtWar(e2Team) == False:
return false
return true
def spellClaimTower(pCaster):
pPlot = pCaster.plot()
pPlayer = gc.getPlayer(pCaster.getOwner())
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_KHAZAD'):
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_DWARVEN_COMMANDER'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
else:
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_MAGISTRATE'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
def checkTower(pCaster):
pPlot = pCaster.plot()
if (pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_TOWER')):
pCaster.kill(True, PlayerTypes.NO_PLAYER)
iUnitMagistrate = CvUtil.findInfoTypeNum(gc.getUnitClassInfo,gc.getNumUnitClassInfos(),'UNITCLASS_MAGISTRATE')
pPlot = caster.plot()
for iUnitLoop in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(iUnitLoop)
# Can't cast if another commander is there
if pUnit.getUnitClassType() == iUnitMagistrate:
return false
if pPlot.isOwned():
if pPlot.getOwner() != caster.getOwner():
pPlayer = gc.getPlayer(caster.getOwner())
eTeam = gc.getTeam(pPlayer.getTeam())
p2Player = gc.getPlayer(pPlot.getOwner())
e2Team = p2Player.getTeam()
if eTeam.isAtWar(e2Team) == False:
return false
return true
def spellClaimTower(pCaster):
pPlot = pCaster.plot()
pPlayer = gc.getPlayer(pCaster.getOwner())
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_KHAZAD'):
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_DWARVEN_COMMANDER'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
else:
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_MAGISTRATE'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
def checkTower(pCaster):
pPlot = pCaster.plot()
if (pPlot.getImprovementType() != gc.getInfoTypeForString('IMPROVEMENT_TOWER')):
pCaster.kill(True, PlayerTypes.NO_PLAYER)
I know the middle string still has the feature for the Khazad and their line of forts, but I don't know how to remove it without disabling the entire spell.
I'm trying to make it so that an Adept can claim a tower as a magical keep, and everything has worked out so far, except for the problem above, and my territory won't expand to the tile. I don't know what else to do. Please help, this is my first ime modding python code.
-A9A