Era Stopper to SDK

Do you mean something like adding 'DisableEra'?
Because disabling each tech separately already exists.

If so, you should probably add it to the global defines, and then add the appropriate code in CvPlayer::canEverResearch().
 
I'm looking at moving the Era Stopper mod to the SDK and need some help as to where in the SDK it would fit.

:crazyeye:

CCV has got a SDK solution. But CCV uses the RevDCM options tab now to be able to enable and disable even in a running game. But of course you can also use standard gameoptions. So you are not able to switch in a running game but you can choose before game start. Just replace my checks with checks for the new game options like CCV had them in the past too. That should be now problem.

The CCV code in CvInfo.cpp looks like this:
PHP:
bool CvTechInfo::isDisable() const
{
// Thomas SG - ES: Era Stopper START
	if (!GC.isCCV_ERA_ANCIENT_ENABLED() && getEra() == 0)
	{
		return true;
	}
	if (!GC.isCCV_ERA_CLASSICAL_ENABLED() && getEra() == 1)
	{
		return true;
	}
	if (!GC.isCCV_ERA_MEDIEVAL_ENABLED() && getEra() == 2)
	{
		return true;
	}
	if (!GC.isCCV_ERA_RENAISSANCE_ENABLED() && getEra() == 3)
	{
		return true;
	}
	if (!GC.isCCV_ERA_INDUSTRIAL_ENABLED() && getEra() == 4)
	{
		return true;
	}
	if (!GC.isCCV_ERA_MODERN_ENABLED() && (getEra() == 5 || (getEra() == 6 && isRepeat())))
	{
		return true;
	}
	if (!GC.isCCV_ERA_FUTURE_ENABLED() && getEra() == 6 && !isRepeat())
	{
		return true;
	}
// Thomas SG - ES: Era Stopper END
	return m_bDisable;
}
 
Thomas SG seems to have already answered the OPs call, so I can safely add my idea for a (suboptimal) Python solution. (In case anyone is interested.)

In CvGameUtils.cannotResearch(), get the CvTechInfo instance of eTech with gc.getTechInfo(), then use CvTechInfo.getEra() to get the era. If the era is greater than the last available era, then make the method return True.
Spoiler :
Code:
	def cannotResearch(self,argsList):
		ePlayer = argsList[0]
		eTech = argsList[1]
		bTrade = argsList[2]

		return [B]gc.getTechInfo(eTech).getEra() > eLastEra[/B]
The eLastEra value needs to be defined however. Also the cannotResearch callback has to be enabled in PythonCallbackDefines.xml.

Its not a big mod by any standards...
 
Back
Top Bottom