Modmodding Q&A Thread

Seems like
Code:
	// Leoreth: make sure flip at the beginning creates a capital
	BuildingClassTypes eCapitalBuildingClass = (BuildingClassTypes)GC.getDefineINT("CAPITAL_BUILDINGCLASS");
	BuildingTypes eCapitalBuilding = ((BuildingTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eCapitalBuildingClass)));

	if (!isMinorCiv() && !isBarbarian() && getBuildingClassCount(eCapitalBuildingClass) == 0)
	{
		findNewCapital();
	}
part only works for v1.12 python files, so I added that. Thanks.
 
Oh yes, I think I moved the code from Python to the DLL. Please always take care what you merge in.
 
Hi Leoreth. I'm converting 1.12 mod file into SVN 996. I'm looking for the CvUnit.cpp and seems like this part from 1.12v is removed in SVN 996.
Spoiler :

Code:
int CvUnit::workRate(bool bMax) const
{

(...)

	//Rhye - start switch
	switch (getOwnerINLINE())
	{
	case EGYPT:
		iRate *= 80 + 2*(int)GET_PLAYER((PlayerTypes)getOwnerINLINE()).getCurrentEra(); //90
		iRate /= 100;
		break;
	case CHINA:
		iRate *= 75 + 3*(int)GET_PLAYER((PlayerTypes)getOwnerINLINE()).getCurrentEra(); //90
		iRate /= 100;
		break;
	case BABYLONIA:
		iRate *= 80 + 2*(int)GET_PLAYER((PlayerTypes)getOwnerINLINE()).getCurrentEra(); //90
		iRate /= 100;
		break;

(...)

	if (getScenario() >= SCENARIO_600AD) //late start condition
		if (getOwnerINLINE() < VIKING) {
			iRate *= 105;
			iRate /= 100;
		}
	//Rhye - end

	return iRate;
}


Does it now totally removed or I should find this on other files?
 
Nope, I decided to remove this factor completely. This is generally favorable for early civs.
 
Hello. Another similar question and thanks in advance. No more EMBASSY Building class in CIV4BuildingClassInfos.xml and CIV4BuildingInfos.xml?
 
Correct.
 
I'm having trouble with compiling again. It complies well with debug setting, but Release setting makes following errors.

Spoiler :

Code:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
1>Performing Makefile project actions
1> "C:\VS Express\Microsoft Visual C++ Toolkit 2003\bin\link.exe" /out:Release\CvGameCoreDLL.dll /INCREMENTAL:NO /OPT:REF /OPT:ICF /PDB:"Release\CvGameCoreDLL.pdb" /DLL /NOLOGO /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1 /LIBPATH:Python24/libs /LIBPATH:boost-1.32.0/libs/ boost_python-vc71-mt-1_32.lib /LIBPATH:"C:\VS Express\Microsoft Visual C++ Toolkit 2003/lib" /LIBPATH:"C:\VS Express\WindowsSDK/Lib"  /LIBPATH:"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/libs" /LIBPATH:"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Python24/libs" winmm.lib user32.lib Release\CvArea.obj  Release\CvArtFileMgr.obj  Release\CvBugOptions.obj  Release\CvCity.obj  Release\CvCityAI.obj  Release\CvDeal.obj  Release\CvDiploParameters.obj  Release\CvDLLButtonPopup.obj  Release\CvDLLEntity.obj  Release\CvDLLPython.obj  Release\CvDllPythonEvents.obj  Release\CvDllTranslator.obj  Release\CvDLLWidgetData.obj  Release\CvEventReporter.obj  Release\CvFractal.obj  Release\CvGame.obj  Release\CvGameAI.obj  Release\CvGameCoreDLL.obj  Release\CvGameCoreUtils.obj  Release\CvGameInterface.obj  Release\CvGameTextMgr.obj  Release\CvGlobals.obj  Release\CvHallOfFameInfo.obj  Release\CvInfos.obj  Release\CvInfoWater.obj  Release\CvInitCore.obj  Release\CvMap.obj  Release\CvMapGenerator.obj  Release\CvMessageControl.obj  Release\CvMessageData.obj  Release\CvPlayer.obj  Release\CvPlayerAI.obj  Release\CvPlot.obj  Release\CvPlotGroup.obj  Release\CvPopupInfo.obj  Release\CvPopupReturn.obj  Release\CvRandom.obj  Release\CvReplayInfo.obj  Release\CvReplayMessage.obj  Release\CvRhyes.obj  Release\CvSelectionGroup.obj  Release\CvSelectionGroupAI.obj  Release\CvStatistics.obj  Release\CvStructs.obj  Release\CvTalkingHeadMessage.obj  Release\CvTeam.obj  Release\CvTeamAI.obj  Release\CvTextScreens.obj  Release\CvUnit.obj  Release\CvUnitAI.obj  Release\CvXMLLoadUtility.obj  Release\CvXMLLoadUtilityGet.obj  Release\CvXMLLoadUtilityInit.obj  Release\CvXMLLoadUtilitySet.obj  Release\CyArea.obj  Release\CyAreaInterface.obj  Release\CyArgsList.obj  Release\CyArtFileMgr.obj  Release\CyArtFileMgrInterface.obj  Release\CyCity.obj  Release\CyCityInterface1.obj  Release\CyCityInterface2.obj  Release\CyDeal.obj  Release\CyEnumsInterface.obj  Release\CyGame.obj  Release\CyGameCoreUtils.obj  Release\CyGameCoreUtilsInterface.obj  Release\CyGameInterface.obj  Release\CyGameTextMgr.obj  Release\CyGameTextMgrInterface.obj  Release\CyGlobalContext.obj  Release\CyGlobalContextInterface1.obj  Release\CyGlobalContextInterface2.obj  Release\CyGlobalContextInterface3.obj  Release\CyGlobalContextInterface4.obj  Release\CyHallOfFameInfo.obj  Release\CyHallOfFameInterface.obj  Release\CyInfoInterface1.obj  Release\CyInfoInterface2.obj  Release\CyInfoInterface3.obj  Release\CyMap.obj  Release\CyMapGenerator.obj  Release\CyMapGeneratorInterface.obj  Release\CyMapInterface.obj  Release\CyMessageControl.obj  Release\CyMessageControlInterface.obj  Release\CyPlayer.obj  Release\CyPlayerInterface1.obj  Release\CyPlayerInterface2.obj  Release\CyPlot.obj  Release\CyPlotInterface1.obj  Release\CyRandomInterface.obj  Release\CyReplayInfo.obj  Release\CySelectionGroup.obj  Release\CySelectionGroupInterface.obj  Release\CyStructsInterface1.obj  Release\CyTeam.obj  Release\CyTeamInterface.obj  Release\CyUnit.obj  Release\CyUnitInterface1.obj  Release\FAssert.obj  Release\FDialogTemplate.obj  Release\_precompile.obj   
1>   Creating library Release\CvGameCoreDLL.lib and object Release\CvGameCoreDLL.exp
1>CvPlot.obj : error LNK2019: unresolved external symbol _GetProcessMemoryInfo@12 referenced in function "bool __cdecl NeedToFreeMemory(void)" (?NeedToFreeMemory@@YA_NXZ)
1>Release\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
1>NMAKE : warning U4010: 'Release\CvGameCoreDLL.dll' : build failed; /K specified, continuing ...
1>NMAKE : warning U4011: 'Release' : not all dependents available; target not built
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://c:\Users\201310981\Desktop\Boer\CvGameCoreDLL\Release\BuildLog.htm"
1>CvGameCoreDLL - 3 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Can you give me any inspections?
 
I'm having multiple python attribute errors now, so I think debugging will take long time. I wonder this guide is still valid with latest SVN versions or not. Is it enough to modify what given in that guide, or I need more?
 
Nothing substantial has changed there in the meantime.
 
Code:
	def sortVoteUnitedNations(self):
		lSorted = []
		lItems = []
		lExceptions = []
		dUnitedNationsVotes = {
			gc.getInfoTypeForString("VOTE_SECRETARY_GENERAL") : "TXT_KEY_VOTE_SECRETARY_GENERAL_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_VICTORY") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_SINGLE_CURRENCY") : "TXT_KEY_VOTE_SINGLE_CURRENCY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_FREE_TRADE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_NO_NUKES") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_REPUBLIC") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_EGALITARIANISM") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_PUBLIC_WELFARE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_ENVIRONMENTALISM") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_FREE_RELIGION") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_UN_FORCE_PEACE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_UN_FORCE_NO_TRADE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_UN_ASSIGN_CITY") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_UN_DECOLONIZE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_UN_RELEASE_CIVILIZATION") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_POPE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_RELIGIOUS_VICTORY") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_OPEN_BORDERS") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_DEFENSIVE_PACT") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_FORCE_PEACE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_FORCE_NO_TRADE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_FORCE_WAR") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_ASSIGN_CITY") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_COLLECT_TITHE") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_INQUISITION") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION",
			gc.getInfoTypeForString("VOTE_EXCOMMUNICATION") : "TXT_KEY_VOTE_VICTORY_DESCRIPTION"
			}
		for iItem in xrange(gc.getNumVoteInfos()):
			ItemInfo = gc.getVoteInfo(iItem)
			if ItemInfo.isGraphicalOnly() and not CyGame().isDebugMode(): continue
			if iItem in lExceptions and not CyGame().isDebugMode(): continue
			[B]lItems.append([ItemInfo.getDescription(), iItem, ""])[/B]
		if not lItems: return lSorted
		lItems.sort()
		lSorted.append([CyTranslator().getText("TXT_KEY_BUILDING_UNITED_NATIONS_RESOLUTIONS_PEDIA", ()), "", lItems])
		return lSorted

How would I get the Bold text to return the text given in dUnitedNationsVotes?
The code works correctly except instead of returning the item's description, I want it to return the text given in dUnitedNationsVotes. But I don't know how.
 
I am trying to learn how to compile the DLL, which I used to know how to do.

The following error is returned when I try to open the SLN file from the git:

Code:
C:\devel\CvGameCoreDLL\CvGameCoreDLL.vcxproj : error  : Project "C:\devel\CvGameCoreDLL\CvGameCoreDLL.vcxproj" could not be found.

What do I need to do?
 
The .vcxproj file describes the Visual Studio project I have set up (and which strictly speaking should probably not be under version control ...). Are you using Visual Studio? In that case you might be able to open it. Or you should just set up a development environment yourself.

At what step are you right now exactly?
 
Oh, I see that the .vcxproj file is not included in the download. That explains it.

I'll try again with a new project/solution and report back.
 
Alright.
 
They are used to implement the era specific soundtracks. It's a workaround for the way Civ directly associates music files with eras. The eras are only accessed when picking background music, so the other entries don't matter.
 
is there anyone who know attack submarine can bring missiles ?

there s xml error about unit infors

just original bts game started well but

i dont know only this mod can't load :(

if i change even little about civ4unitinfos.xml file

then there s xml error i can't load this mod

is there any special program ? can change xml error ?

can u please someone upload files ? after change that part
 
is there anyone who know attack submarine can bring missiles ?

there s xml error about unit infors

just original bts game started well but

i dont know only this mod can't load

if i change even little about civ4unitinfos.xml file

then there s xml error i can't load this mod

is there any special program ? can change xml error ?

can u please someone upload files ? after change that part (please)



i d like to change attack submarine to submarine

submarine can bring one special spy

and attack submarine can bring missiles.


so i tried to change CIV4UnitInfos

<SpecialCargo>SPECIALUNIT_PEOPLE</SpecialCargo>
<DomainCargo>DOMAIN_LAND</DomainCargo>
<iCargo>1</iCargo>

this is attack submarine part

so i wanted to change this is for submarine

so i changed this part to submarine

and attack submarine is

<SpecialCargo>SPECIALUNIT_missile</SpecialCargo>
<DomainCargo>DOMAIN_air</DomainCargo>
<iCargo>3</iCargo>


but there s xml errors
 
Back
Top Bottom