help please w/RealFort code in FF+

CyrusOrlandeau

Everescan
Joined
Feb 8, 2008
Messages
82
Location
Lost in my head.
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:

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)


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
 
I'm not sure about FF+ but since Valkrionn borrowed the forts from Orbis...

In Orbis, fort culture is governed by PROMOTION_INFLUENCE. If you don't have it, the culture will never expand. So, if you haven't already, give your Magistrate the PROMOTION_INFLUENCE ;)

You can check in CvEventManager.py the updateAllForts function if you want :)
 
If you want help, you should probably use the [code][/code] tags instead of (or in addition to) the [spoiler][/spoiler] tags. It could be that spacing or indentation is messing it up, and we could never tell because that gets removed when you post without using [code][/code].
 
Not a bad idea, actually... At the least, I could see it as an Amurite/Kahd Fort Commander UU.

Opera is correct, the culture is based off of Influence, Expanded Influence, and Legendary Influence... Seach EventManager.py for them and you should see what to edit. :goodjob:

As for the Khazad code... This should work.

Code:
def spellClaimTower(pCaster):
	pPlot = pCaster.plot()
	pPlayer = gc.getPlayer(pCaster.getOwner())
	newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_MAGISTRATE'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
 
Thank you Valkrionn! I fixed everything else, gave my 'magistrate' a new version of the Influence promotion ('Arcane Influence' lol) and I knew there was some definition I was missing that gave the culture border, but I didn't know where. I'll check the eventmanager and make another code for the new influence promo.
For some reason, everytime I removed the if-else thing to get rid of the Khazad feature, the code wouldn't allow the new Claim Tower effect to work. I think this is the same code that didn't work, but I'll try it, it should be fine. It's just me that trips on the tiniest details. :p

Oh and I'll use the
Code:
 tag from now on, thanks Magister. You know, you might actually like this idea when i'm done with the beta version of the mod. ;)

-A9A
 
Okay, so I fixed the CvSpellInterface entry, now i found the piece in the EventManager.py, this is what i have so far (just renaming what I need). I know I missed a number of points (things still called Fort and castle) but I'm not sure if I can change those.Hopefully the following wiill explain a bit better.

1.) I know the Castle effect is still there, that's because later I want to make the tower turn into another version of itself, so i'll go back through and rename it after I get the basic idea to work. I would like to know if this is going to effect anything right now, or if I have to get rid of it then add what I want back to it later, or if i just have to go ahead and do the extra work to make the upgrade of the tower.

2.) I'd like to ask how I can take out the part that allows the Expanded and Legendary to increase the border. The effect will clash with what i have in mind, so I'd like to know just wht needs to be taken out so the ret can run smoothly.

Code:
	def updateAllTowers(self):
		
		# Update Tower culture
		iUnitTowerID = CvUtil.findInfoTypeNum(gc.getUnitClassInfo,gc.getNumUnitClassInfos(),'UNITCLASS_MAGISTRATE')
		# List made to preserve culture of units hired first
		aaiTowerList = []
		aaiCastleList = []
		
		for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
			pPlayer = gc.getPlayer(iPlayerLoop)
			pTeam = gc.getTeam(pPlayer.getTeam())
			pyPlayer = PyPlayer(iPlayerLoop)
			
			apUnitList = pyPlayer.getUnitList()
			for pUnitLoop in apUnitList:
				if (pUnitLoop.getUnitClassType() == iUnitTowerID):
					self.updateTowerCulture(iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY())
					if pUnitLoop.isHasPromotion(gc.getInfoTypeForString('PROMOTION_EXPANDED_INFLUENCE')):
						aaiFortList.append([pUnitLoop.getGameTurnCreated(), iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY()])
					if pUnitLoop.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEGENDARY_INFLUENCE')):
						aaiCastleList.append([pUnitLoop.getGameTurnCreated(), iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY()])

		if (len(aaiTowerList) > 0):
			
			# Make order such that units built first get culture preference
			aaiTowerList.sort()
#			aaiTowerList.reverse()
			
			for iTowerLoop in range(len(aaiTowerList)):
				self.updateCastleCulture(aaiTowerList[iTowerLoop][1], aaiTowerList[iTowerLoop][2], aaiTowerList[iTowerLoop][3])

		if (len(aaiCastleList) > 0):
			
			# Make order such that units built first get culture preference
			aaiCastleList.sort()
#			aaiCastleList.reverse()
			
			for iCastleLoop in range(len(aaiCastleList)):
				self.updateCitadelCulture(aaiCastleList[iCastleLoop][1], aaiCastleList[iCastleLoop][2], aaiCastleList[iCastleLoop][3])
								
	def updateTowerCulture(self, iPlayer, iX, iY):		
		# Create culture around unit
		for iXLoop in range(iX-0, iX+1):
			for iYLoop in range(iY-0, iY+1):
				
				iActiveX = iXLoop
				iActiveY = iYLoop
				
				if (iActiveX < 0):
					iActiveX = CyMap().getGridWidth() + iActiveX
				if (iActiveY < 0):
					iActiveY = CyMap().getGridHeight() + iActiveY
				
				pLoopPlot = CyMap().plot(iActiveX, iActiveY)
#				pPlotLoop = CyMap().plot(iXLoop, iYLoop)
#				printd("Setting Player %d as the owner of %d, %d" %(iPlayer, iXLoop, iYLoop))
				# Don't override culture that's already here
				pLoopPlot.setOwnerNoUnitCheck(iPlayer)

i am experimenting with this on my own too, so don't think I'm being lazy by asking others to do it for me. I'd just like a little help, is all. ;)

EDIT: this code didn't work, i think i know why, i think it's because I still don't have anything linking this effect to the Arcane Influence promo I gave my Magistrate, but I'm at a loss of where to go from here. Help?

-A9A
 
This SHOULD work. You don't need to add a different initial promotion to anything, far as I can tell. It looks for the unit itself... Only for the higher two tiers do you have to search for a promotion. Only thing I can think of if this doesn't work, is did you actually make the unitclass?

Code:
    def updateAllTowers(self):
        
        # Update Tower culture
        iUnitTowerID = CvUtil.findInfoTypeNum(gc.getUnitClassInfo,gc.getNumUnitClassInfos(),'UNITCLASS_MAGISTRATE')
        
        for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
            pPlayer = gc.getPlayer(iPlayerLoop)
            pTeam = gc.getTeam(pPlayer.getTeam())
            pyPlayer = PyPlayer(iPlayerLoop)
            
            apUnitList = pyPlayer.getUnitList()
            for pUnitLoop in apUnitList:
                if (pUnitLoop.getUnitClassType() == iUnitTowerID):
                    self.updateTowerCulture(iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY())
                    
                                
    def updateTowerCulture(self, iPlayer, iX, iY):        
        # Create culture around unit
        for iXLoop in range(iX-0, iX+1):
            for iYLoop in range(iY-0, iY+1):
                
                iActiveX = iXLoop
                iActiveY = iYLoop
                
                if (iActiveX < 0):
                    iActiveX = CyMap().getGridWidth() + iActiveX
                if (iActiveY < 0):
                    iActiveY = CyMap().getGridHeight() + iActiveY
                
                pLoopPlot = CyMap().plot(iActiveX, iActiveY)
#                pPlotLoop = CyMap().plot(iXLoop, iYLoop)
#                printd("Setting Player %d as the owner of %d, %d" %(iPlayer, iXLoop, iYLoop))
                # Don't override culture that's already here
                pLoopPlot.setOwnerNoUnitCheck(iPlayer)
 
Yeah, as far as i know I created everything I'd need. unitclass_MAGISTRATE, the unit itself, the Arcane Influence promotion(specifically for Magistrate), the spell, the effect....

Let me try your code so hopefully that should work, and I'll edit this message to report if it works or not and to what extent.

EDIT: It didn't work, but it wasn't the CvEventManager code, it was the CvSpellInterface code. the Claim Tower spell would show up, but I wouldn't be allowed to use it, and anytime that happened to me was because I took out the Khazad feature in the spellclaimTower code. I would delete the if-else part to get rid of the Khazad thing to get the same code you said would work, but it doesn't, only with the Khazad part does it work.

Code:
def spellClaimTower(pCaster):
	pPlot = pCaster.plot()
	pPlayer = gc.getPlayer(pCaster.getOwner())
	newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_MAGISTRATE'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)

for anybody with a similar problem, this is the original code:

Code:
def spellClaimFort(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_FORT_COMMANDER'), pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)

What keeps causing the problem? i;m thinking it may not be the code, it may be the spell Claim Tower, maybe I missed something there....
Well, at most, i'll just switch out the Khazad with an Amurite/Kahd special feature. I was going to do that anyway later, i just wanted to see if it could work without.

-A9A
 
Okay, my problem still isn't solved. Now I can't even use the spell, so I'll be examining all my changes and trial-and-error everything to determine what the problem is. I'll edit this post when I figure it out.

-A9A
 
I know I had to have tripped over some small detail in the XML, that's what always happens to me when things don't work like they should, so I'll post all that I changed here.
Btw, I'm going to edit this post a few times to make it easier to read and organize.

UnitInfos entry for Magistrate
Spoiler :
Code:
	<UnitInfo>
            <Class>UNITCLASS_MAGISTRATE</Class>
            <Type>UNIT_MAGISTRATE</Type>
            <Combat>UNITCOMBAT_ADEPT</Combat>
            <Domain>DOMAIN_IMMOBILE</Domain>
            <DefaultUnitAI>UNITAI_RESERVE</DefaultUnitAI>
            <Description>TXT_KEY_UNIT_MAGISTRATE</Description>
            <Civilopedia>TXT_KEY_UNIT_MAGISTRATE_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_MAGISTRATE_STRATEGY</Strategy>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bMilitarySupport>0</bMilitarySupport>
            <bNukeImmune>1</bNukeImmune>
            <Flavors>
                <Flavor>
                    <FlavorType>FLAVOR_MILITARY</FlavorType>
                    <iFlavor>3</iFlavor>
                </Flavor>
            </Flavors>
            <iCost>-1</iCost>
            <iAdvancedStartCost>-1</iAdvancedStartCost>
            <iMoves>1</iMoves>
            <iAirRange>1</iAirRange>
            <iCombat>4</iCombat>
            <iFirstStrikes>1</iFirstStrikes>
            <iChanceFirstStrikes>1</iChanceFirstStrikes>
            <iCityDefense>20</iCityDefense>
			<UnitMeshGroups>
				<iGroupSize>1</iGroupSize>
				<fMaxSpeed>1.25</fMaxSpeed>
				<fPadTime>1</fPadTime>
				<iMeleeWaveSize>1</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>1</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_MAGISTRATE</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_DEFAULT</FormationType>
            <FreePromotions>
                <FreePromotion>
                    <PromotionType>PROMOTION_ARCANE_INFLUENCE</PromotionType>
                    <bFreePromotion>1</bFreePromotion>
                </FreePromotion>
		    <FreePromotion>
                    <PromotionType>PROMOTION_CHANNELING1</PromotionType>
                    <bFreePromotion>1</bFreePromotion>
                </FreePromotion>
		    <FreePromotion>
                    <PromotionType>PROMOTION_CHANNELING2</PromotionType>
                    <bFreePromotion>1</bFreePromotion>
                </FreePromotion>
            </FreePromotions>
            <bFreeXP>1</bFreeXP>
            <DenyPromotions>
                <Promotion>PROMOTION_MOBILITY1</Promotion>
				<Promotion>PROMOTION_MECHANICAL</Promotion>
            </DenyPromotions>
        </UnitInfo>

UnitClassInfos for Magistrate
Spoiler :
Code:
		<UnitClassInfo>		<!-- MAGISTRATE -->
			<Type>UNITCLASS_MAGISTRATE</Type>
			<Description>TXT_KEY_UNIT_MAGISTRATE</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>UNIT_MAGISTRATE</DefaultUnit>
		</UnitClassInfo>

PromotionInfos for Arcane Influence
Spoiler :
Code:
	<PromotionInfos>
		<PromotionInfo>
            <Type>PROMOTION_ARCANE_INFLUENCE</Type>
            <Description>TXT_KEY_PROMOTION_ARCANE_INFLUENCE</Description>
            <Help>TXT_KEY_PROMOTION_ARCANE_INFLUENCE_HELP</Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <UnitCombats>
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_ADEPT</UnitCombatType>
                    <bUnitCombat>1</bUnitCombat>
                </UnitCombat>
            </UnitCombats>
            <Button>Art/Civs/Other/FortCommander/Influence.dds</Button>
            <iBetterDefenderThanPercent>-20</iBetterDefenderThanPercent>
            <iMinLevel>-1</iMinLevel>
            <iSpellCasterXP>60</iSpellCasterXP>
            <PromotionNextLevel>PROMOTION_EXPANDED_INFLUENCE</PromotionNextLevel>
            <PyPerTurn>checkTower(pCaster)</PyPerTurn>
        </PromotionInfo>

SpellInfos for Claim Tower spell
Spoiler :
Code:
		<SpellInfo>
            <Type>SPELL_CLAIM_TOWER</Type>
            <Description>TXT_KEY_SPELL_CLAIM_TOWER</Description>
            <Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
            <Help>TXT_KEY_SPELL_CLAIM_TOWER_STRATEGY</Help>
            <ImprovementPrereq>IMPROVEMENT_TOWER</ImprovementPrereq>
		<UnitCombatPrereq>UNITCOMBAT_ADEPT</UnitCombatPrereq>
            <bAllowAI>1</bAllowAI>
            <iAIWeight>400</iAIWeight>
            <bDisplayWhenDisabled>1</bDisplayWhenDisabled>
            <bHasCasted>1</bHasCasted>
            <PyResult>spellClaimTower(pCaster)</PyResult>
            <PyRequirement>reqClaimTower(pCaster)</PyRequirement>
            <Effect>EFFECT_SPELL1</Effect>
            <Sound>AS3D_SPELL_TRAIN</Sound>
            <Button>Art/Interface/Buttons/Spells/Ardor.dds</Button>
        </SpellInfo>

CvSpellInterface for Tower spell/effect
Spoiler :
Code:
def reqClaimTower(pCaster):
	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())
		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)

CvEventManager for Culture border(i think)
Spoiler :
Code:
    def updateAllTowers(self):
        
        # Update Tower culture
        iUnitTowerID = CvUtil.findInfoTypeNum(gc.getUnitClassInfo,gc.getNumUnitClassInfos(),'UNITCLASS_MAGISTRATE')
        
        for iPlayerLoop in range(gc.getMAX_CIV_PLAYERS()):
            pPlayer = gc.getPlayer(iPlayerLoop)
            pTeam = gc.getTeam(pPlayer.getTeam())
            pyPlayer = PyPlayer(iPlayerLoop)
            
            apUnitList = pyPlayer.getUnitList()
            for pUnitLoop in apUnitList:
                if (pUnitLoop.getUnitClassType() == iUnitTowerID):
                    self.updateTowerCulture(iPlayerLoop, pUnitLoop.getX(), pUnitLoop.getY())
                    
                                
    def updateTowerCulture(self, iPlayer, iX, iY):        
        # Create culture around unit
        for iXLoop in range(iX-0, iX+1):
            for iYLoop in range(iY-0, iY+1):
                
                iActiveX = iXLoop
                iActiveY = iYLoop
                
                if (iActiveX < 0):
                    iActiveX = CyMap().getGridWidth() + iActiveX
                if (iActiveY < 0):
                    iActiveY = CyMap().getGridHeight() + iActiveY
                
                pLoopPlot = CyMap().plot(iActiveX, iActiveY)
#                pPlotLoop = CyMap().plot(iXLoop, iYLoop)
#                printd("Setting Player %d as the owner of %d, %d" %(iPlayer, iXLoop, iYLoop))
                # Don't override culture that's already here
                pLoopPlot.setOwnerNoUnitCheck(iPlayer)

The art model and the text entry are unnecessary for obvious reasons. The ancient tower wasn't adjusted at all, so I don't think I need to post it. =P
The new code you gave me for the culture effect probably does work fine, but for some reason I'm not allowed to cast the spell to claim the tower. I even tried adding back in the Khazad feature, still didn't work. Hoping you can figure what I did wrong.
Thank you for the continued help so far, I was afraid this thread would be abandoned. :lol::rolleyes:

Before I forget, Valkrionn, if you wanted to use a variation of this in FF+, i would be honored, but please give me credit. :D
And I love that artstyle in your avi Opera. Where'd you get it? Or did you draw it? It's beautiful. ^_^
-A9A
 
CvSpellInterface for Tower spell/effect
Spoiler :
Code:
def reqClaimTower(pCaster):
	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())
		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)
Here it is! In reqClaimTower(pCaster) you use caster (third line) instead of pCaster. I didn't see any other error :) Since this is the req part, it cancels out all your spell.
When you use python to mod, remember to activate the python logs and to check them; I'm sure the error would have been logged in ;)

And I love that artstyle in your avi Opera. Where'd you get it? Or did you draw it? It's beautiful. ^_^
-A9A
It's a picture by Susan Marino :)

Edit: I notice the error wasn't there in the first post... Too bad :lol:
 
alright, I fixed that typo, although since I copied and pasted from the original fort code then just renamed 'fort' to 'tower' and 'fortcommander' to 'magistrate', it really shoudn't have made a difference.
And sadly, it didn't. The problem is still there, but I have a little more insight now. While testing it, I found out that the Explore Lair ability (I had two units on a Dungeon and a Giant Staedding) doesn't work either. The last time everything worked was before I added the code in the CvEventManager. It was either my placement of the code or there is something funny with the code itself. I'm going to try working on that.

Thanks Opera, for the bit about the pcaster, and for letting me view Susan Marino's stunning portfolio. :D Bookmarked. I've never seen work that amazing before, honestly. I know I couldn't do it, at least not until I dedicate a good year to learning photoshop. :lol::crazyeye:

EDIT: No matter what I do, still can't cast. Also, the intro movie and civ strategy that is supposed to pop-up at the start of a new game has been disabled, and I didn't do it myself. something's screwed up, but where? If it's not the CvEventManager code, then what is causing this?
And how do i activate the python logs? is it in the config file, or somewhere else?

EDIT2: Okay, I took out the CvEventManager code, and the intro movie and strategy popped up again. also, lairs work now. But I STILL CAN'T CAST. I'm thinking I screwed it up somewhere, so I'm probably going to try re-copying the Fort code and renaming it, again. At least I know there's more than one problem to the entire thing. Yippee.
Well, knowing there is a problem is the first step to fixing it right? Now to copy the code... again.

EDIT3: Alright, after minor tweaks to everything else, and putting the EventMgr code back in then back out, it's definitely the EventMgr code that causes problems. Valkrionn, could you check the code you gave me please? After taking it out i could cast the spell again, so it has to be that. I'm going to try copying the original code for forts in and renaming that. If that doesn't work, I'm close to giving up. I'm tired.

EDIT4: Huzzah! It works now! Sorry Valkrionn, but the code you suggested for the Eventmgr was wrong. After copying the fort code and renaming it, allowing for slight modification of the extra code that allowed the castle and citadel culture (took out the citadel and renamed the castle something that doesn't exist yet ;) ), and now I have my culture border.
The next step will be any additional corrections to allow/disable certain features, then I can let my imagination run wild with what i want the tower to do. :D
Thank you for all your help. If I don't post anymore after this then that means everything will be going smoothly. Now I can have some real fun. :D

-A9A
 
but wait, how do I turn ON the python logs/exceptions?
Thanks for your help though.

If this thread is checked on again, I have another question. For an add-on idea to the tower, I need a promotion that has 'y' chance to give 'x' promotion to units in the same tile as the unit with the promotion. I was originally looking at 'Crazed', but it only gives the effect for the unit with the promotion. Is it possible I can alter the 'Crazed' code to allow the 'y' chance to gain 'x' promotion to any unit in the stack?
Meaning that every unit has the 'y' chance to gain 'x' promotion, so some units get the promotion before others. I don't want a spell to go with this, because it only adds more work and more micromanagement. I also don't want the units to gain 'x' promotion at the same time.

If it helps, here's an example:
x - promo to give chance to get 'z' promo
y - random chance # (20%)
z - promotion that gives bonus/ability

Turn 1
Magistrate has 'x' promotion
Two scouts move on to the tower. Each scout has 'y' chance to gain 'z' promotion

Turn 2
Scout 1 gets 'z' promo
Warrior moves onto tile
Scout 1 moves off tile

Turn 3
Scout 2 gets 'z' promo
Warrior gets 'z' promo

How could I find the 'PromotionRandomApply' code so that I can try modding it to what I need?

-A9A
 
That code is in the DLL, which might be more than you want to play with, but I think it is easier than python personally.

Anyway, you could also use the PyPerTurn function if you are really desperate. Pretty sure we wrote one of those for promotions.
 
You did not write a PyPerTurn function for promotions; Kael did, possibly before FF even started.
 
Thanks xienwolf! well, i have to start somewhere if I want to get anywhere, and your idiots guide to modding the dll whill be a nice starting point. I should be able to follow an idiot's guide right? :lol:
You know i bookmarked your sig right? :lol: There's a lot of good info there. :goodjob:
One thing I have to ask to avoid bugging people in the future: is there a list somewhere that defines where to find what you're looking for python and dll and whatnot? I mean, until you get really acquainted with everything, is there some kind of reference list to help identify what is what and where you can find what you're looking for without having to ask people here all the time?
I appreciate the help, but i know nobody wants to be bugged all the time help someone with something that's new to them but basic stuff to you. :D

EDIT: Your dll guide helps greatly so far, and it gives that reference list for dll's, now I could really use one for Python files....

-A9A
 
Back
Top Bottom