Modmodding Q&A Thread

Maybe you need to add a widget type or something in the DLL to make it work. The interface isn't as easily modifiable as it should be in my opinion.
 
(Amended the OP with some additional information.)
 
I am trying to add a new civilization in DoC.
One of the UHV is to control 7 Orthodoxy ports. Try to borrowed some code from RFCCW:
Code:
# Vandal UHV2 control 9 ports in 550AD
				if iGameTurn == getTurnForYear(550):
					PortList = []
					apCityList = PyPlayer(iVandals).getCityList()
					for pCity in apCityList:
						if pCity.GetCy().isCoastal(gc.getMIN_WATER_SIZE_FOR_OCEAN()):
							PortList.append(pCity)
					if len (PortList) >= 9:
						sd.setGoal(iVandals, 2, 1)
					else:
						sd.setGoal(iVandals, 2, 0)

I tried to "and pCity.getCy().isHasReligion(con.iOrthodoxy)" after"if pCity.GetCy().isCoastal(gc.getMIN_WATER_SIZE_FOR_OCEAN())", but it doesn't work. Maybe should look up the right method for city religions in CvCity.cpp. But what can I found is
Code:
int CvCity::getReligionCount() const
{
	int iCount;
	int iI;

	iCount = 0;

	for (iI = 0; iI < GC.getNumReligionInfos(); iI++)
	{
		if (isHasReligion((ReligionTypes)iI))
		{
			iCount++;
		}
	}

	return iCount;
}
. Can this work?
 
I have access to the source code now and isHasReligion(con.iOrthodoxy) is indeed correct.

What exactly doesn't work? Do you get error messages?
 
Or you could look at what the Python exception is complaining about.
 
If I remember correctly, it's the elevation of the tile.

Peak = 0
Hill = 1
Plains = 2
Water = 3
 
If I remember correctly, it's the elevation of the tile.

Peak = 0
Hill = 1
Plains = 2
Water = 3

Thank you. I've addressed you this question because I don't understand how can I change a terrain feature (for example, remove a jungle in 1700). I'm working on Resources.py and I know it should be something like this:

if iGameTurn == getTurnForYear(550):
gc.getMap().plot(67, 30).setFeatureType(-1, 0)
gc.getMap().plot(67, 31).setFeatureType(-1, 0)

but I don't know what I'm supposed to write after "setFeatureType("
 
either an integer or a constant, if you have constants defined for feature types, followed by a 0. follow the order of feature types in the xml, calling the first one 0. I guess setting the feature type to -1 just removes any feature thats there. the 2nd integer is for the feature variety, as in the 3 types of forest.
 
Spoiler :
Now I am moving modern Greece to latest SVN version, but error occurs:
1.JPG

2.JPG

3.JPG

Around line 170 of "CvRFCEventHandler" is:
Code:
		for x in range(124):
			for y in range(68):
				plot = gc.getMap().plot(x, y)
				if plot.isWater(): continue
				for iPlayer in range(con.iNumPlayers):
					if utils.isPlotInArea((x, y), con.tCoreAreasTL[0][iPlayer], con.tCoreAreasBR[0][iPlayer], con.tExceptions[0][iPlayer]):
						plot.setCore(iPlayer, False, True)
					if utils.isPlotInArea((x, y), con.tCoreAreasTL[1][iPlayer], con.tCoreAreasBR[1][iPlayer], con.tExceptions[1][iPlayer]):
						plot.setCore(iPlayer, True, True)
                
                return 0

PythonErr2.txt shows:
Code:
load_module BugEventManager
load_module InputUtil
01:47:48 DEBUG: BugUtil - extending BugEventManager.preGameStart instead CvAppInterface
01:47:48 DEBUG: BugEventManager - adding event 'PreGameStart'
01:47:48 DEBUG: BugEventManager - adding event 'BeginActivePlayerTurn'
01:47:48 DEBUG: BugEventManager - adding event 'SwitchHotSeatPlayer'
01:47:48 DEBUG: BugEventManager - adding event 'LanguageChanged'
01:47:48 DEBUG: BugEventManager - adding event 'ResolutionChanged'
01:47:48 DEBUG: BugEventManager - adding event 'PythonReloaded'
01:47:48 DEBUG: BugEventManager - adding event 'unitUpgraded'
01:47:48 DEBUG: BugEventManager - adding event 'unitCaptured'
01:47:48 DEBUG: BugEventManager - adding event 'combatWithdrawal'
01:47:48 DEBUG: BugEventManager - adding event 'combatRetreat'
01:47:48 DEBUG: BugEventManager - adding event 'combatLogCollateral'
01:47:48 DEBUG: BugEventManager - adding event 'combatLogFlanking'
01:47:48 DEBUG: BugEventManager - adding event 'playerRevolution'
01:47:48 DEBUG: BugInit - game not fully initialized
PY:OnInit

yeah, just found the bug.
I missed a line of tExceptions in Consts.py
 
Yes. However, the changes don't carry all the way through to stuff that already is on the map. So for example, if you give knights a starting promotion all new knights will have it, but existing knights will stay as they are.
 
either an integer or a constant, if you have constants defined for feature types, followed by a 0. follow the order of feature types in the xml, calling the first one 0. I guess setting the feature type to -1 just removes any feature thats there. the 2nd integer is for the feature variety, as in the 3 types of forest.

Thanks!

Where is coded initial stack of a spawning civ?
 
How does the great people naming works? Just adding <Type>UNIT_AUSTRALIAN_SCIENTIST</Type> thingies into CIV4UnitInfos.xml will be fine?
 
Back
Top Bottom