City size population prereq mini SDK mod

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
In the file CvGameTextMgr.cpp there is a function:

Code:
void CvGameTextMgr::buildBuildingRequiresString(...

Is there a similar function for:

Code:
void ??????::trainUnitRequiresString(...

If so, in which file does it exist?

My Goal: In support of a City size population prereq mini SDK mod I am developing, I want to paste the following code:

Code:
if (kUnit.getNumCitySizeUnitPrereq() > 0)
{
	if (NULL == pCity || pCity->getPopulation() < kUnit.getNumCitySizeUnitPrereq())
	{
		szBuffer.append(NEWLINE);
		szBuffer.append(gDLL->getText("TXT_KEY_UNIT_REQUIRES_CITY_SIZE", kUnit.getNumCitySizeUnitPrereq()));
	}
}

What it does: The code prevents a unit from being trained if the city population is below the prerequisite value. For example, I want to prevent a city from training an immigrant if the City population is less than 10.

All other code changes have been made, except for this change. Thanks in advance for your help.
 
This is what is shown, via SDK, for a building (Barracks) that does not have enough population to build it in a city. I need to show the same kind of "SDK" message for a unit. See attachment.

Once I paste the SDK message in the right function and test it, I will post the mini SDK mod for everyone to use.
 

Attachments

  • BldPopPrereq.jpg
    BldPopPrereq.jpg
    50.2 KB · Views: 85
Back
Top Bottom