Modmodding Q&A Thread

Trying modular (modmod)modding. Is there any schema file I can use?

Solved
 
I'm getting these errors (in my Canada DoC mod):

Spoiler :

Traceback (most recent call last):
File "BugEventManager", line 400, in _handleDefaultEvent
File "CvRFCEventHandler", line 184, in onCityAcquired
File "Stability", line 72, in onCityAcquired
AttributeError: 'NoneType' object has no attribute 'changeConqueredCities'
Traceback (most recent call last):
File "BugEventManager", line 400, in _handleDefaultEvent
File "CvRFCEventHandler", line 823, in onChangeWar
File "Stability", line 109, in onChangeWar
File "StoredData", line 253, in removeWarStatus
KeyError: 37
Traceback (most recent call last):
File "BugEventManager", line 400, in _handleDefaultEvent
File "CvRFCEventHandler", line 823, in onChangeWar
File "Stability", line 109, in onChangeWar
File "StoredData", line 253, in removeWarStatus
KeyError: 36


I'm confused because lWarStatus should automatically increment to iNumPlayers right?

I feel like I still have a problem maintaining the WarStatus objects in general, so that might not actually be related to your modmod.

still getting lots of these errors. any ideas?

oddly, they don't occur during auto-play, but now I'm getting many of them every turn.
 
I haven't had time to take care of that yet.
 
Is there already a method for checking colonial owner in the code (I would assume it would be from the Argentina and Brazil spawns), and if so, where is it?
 
Is there already a method for checking colonial owner in the code (I would assume it would be from the Argentina and Brazil spawns), and if so, where is it?
getColonyPlayer() in RFCUtils.py.
 
Is there any way to remove the hammers granted to religious buildings by the apostolic palace?
 
XML\GameInfos\VoteSourceInfos.xml
 
I'm getting these problems.

1. I tried to borrow some code from Catholic URV. But it doesn't work. Did do something wrong?

Code:
				if (self.getGoal(iTatar, 2) == -1):
					iTotalLand = gc.getMap().getLandPlots()
					iIslamicLand = 0

					for iLoopPlayer in range(con.iNumPlayers):
						if gc.getPlayer(iLoopPlayer).isAlive() and gc.getPlayer(iLoopPlayer).getStateReligion() == con.iIslam:
								iIslamicLand += gc.getPlayer(iLoopPlayer).getTotalLand()

					fLandPercent = 100.0 * iIslamicLand / iTotalLand

					if (fLandPercent >= 30.0)
						self.setGoal(iTatar, 2, 1)

2. I also borrowed the code of Viking UP. Every cavalry unit can earn gold after a victorious battle as intended, except new UU. I'm sure there is a "iTatarNoyan" constant in Consts.py. Why?
Code:
#------------------TATAR UP----------------------
	
		if (iOwner == iTatar) and (pWinningUnit.getUnitType() == con.iHorseArcher or pWinningUnit.getUnitType() == con.iKnight or pWinningUnit.getUnitType() == con.iTatarNoyan or pWinningUnit.getUnitType() == con.iCavalry or pWinningUnit.getUnitType() == con.iMongolKeshik):
			if cLosingUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND"):
				iGold = cLosingUnit.getProductionCost() / 3
				gc.getPlayer(iOwner).changeGold(iGold)
				sAdjective = gc.getPlayer(pLosingUnit.getOwner()).getCivilizationAdjectiveKey()
				CyInterface().addMessage(iOwner, False, con.iDuration, CyTranslator().getText("TXT_KEY_TATAR_YOKE_UP", (iGold, sAdjective, pLosingUnit.getNameKey())), "", 0, "", ColorTypes(con.iWhite), -1, -1, True, True)
 
I'm getting these problems.

1. I tried to borrow some code from Catholic URV. But it doesn't work. Did do something wrong?

Code:
				if (self.getGoal(iTatar, 2) == -1):
					iTotalLand = gc.getMap().getLandPlots()
					iIslamicLand = 0

					for iLoopPlayer in range(con.iNumPlayers):
						if gc.getPlayer(iLoopPlayer).isAlive() and gc.getPlayer(iLoopPlayer).getStateReligion() == con.iIslam:
								iIslamicLand += gc.getPlayer(iLoopPlayer).getTotalLand()

					fLandPercent = 100.0 * iIslamicLand / iTotalLand

					if (fLandPercent >= 30.0)
						self.setGoal(iTatar, 2, 1)
Your code lacks a colon in the last if clause. Please mod with Python exceptions enabled, you would have seen this by yourself then.

2. I also borrowed the code of Viking UP. Every cavalry unit can earn gold after a victorious battle as intended, except new UU. I'm sure there is a "iTatarNoyan" constant in Consts.py. Why?
Code:
#------------------TATAR UP----------------------
	
		if (iOwner == iTatar) and (pWinningUnit.getUnitType() == con.iHorseArcher or pWinningUnit.getUnitType() == con.iKnight or pWinningUnit.getUnitType() == con.iTatarNoyan or pWinningUnit.getUnitType() == con.iCavalry or pWinningUnit.getUnitType() == con.iMongolKeshik):
			if cLosingUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND"):
				iGold = cLosingUnit.getProductionCost() / 3
				gc.getPlayer(iOwner).changeGold(iGold)
				sAdjective = gc.getPlayer(pLosingUnit.getOwner()).getCivilizationAdjectiveKey()
				CyInterface().addMessage(iOwner, False, con.iDuration, CyTranslator().getText("TXT_KEY_TATAR_YOKE_UP", (iGold, sAdjective, pLosingUnit.getNameKey())), "", 0, "", ColorTypes(con.iWhite), -1, -1, True, True)
Are you sure the constants actually match the XML? Open the Python console and print GC.getInfoTypeForString([the Noyan XML tag]) and con.iTatarNoyan.
 
Your code lacks a colon in the last if clause. Please mod with Python exceptions enabled, you would have seen this by yourself then.


Are you sure the constants actually match the XML? Open the Python console and print GC.getInfoTypeForString([the Noyan XML tag]) and con.iTatarNoyan.


Thank you very much.
Actually I have set Python exceptions enabled, but doesn't understand what it said. It's a colon:eek:
 
In my modmodmod I noticed that the saves can't be opened with the modmodmod deinstalled. Since my modmodmod is a module and makes only graphical changes the saves should be playable with the modmodmod installed or not. How I can fix this?
 
Are you using the same paths for the flags as before?
 
No, I use new paths inside the module.
Then that's causing the incompatibility. Paths to the flag decals are stored inside the savegame file, if the flags at these locations are deleted you are likely to get a crash.
 
Then that's causing the incompatibility. Paths to the flag decals are stored inside the savegame file, if the flags at these locations are deleted you are likely to get a crash.

Oh, how I can fix it then? I want to avoid replacing the original files.
 
Back
Top Bottom