CvUnit::experienceNeeded

killmeplease

Mk Z on Steam
Joined
Nov 22, 2007
Messages
2,795
Location
Samara
Hello!
Its appeared that i need to edit this function in order to scale some unit's levels progress with a map size.
But what i've found there:
Code:
int CvUnit::experienceNeeded() const
{
	// Use python to determine pillage amounts...
	int iExperienceNeeded;
	long lExperienceNeeded;

	lExperienceNeeded = 0;
	iExperienceNeeded = 0;

	CyArgsList argsList;
	argsList.add(getLevel());	// pass in the units level
	argsList.add(getOwnerINLINE());	// pass in the units 

	gDLL->getPythonIFace()->callFunction(PYGameModule, "getExperienceNeeded", argsList.makeFunctionArgs(),&lExperienceNeeded);

	iExperienceNeeded = (int)lExperienceNeeded;

	return iExperienceNeeded;
}
seems that it calls for python function. i searched civ folder for python files that contain getExperienceNeeded string but i've found nothing. and comments confuse me strongly: "Use python to determine pillage amounts" :confused: What in the hell "pillage amounts" is? and how its related to experience?

Please help!
:help:
 
CvGameUtils.py
 
thanks!
it's strange that windows search have not found it :dunno:

i have an another question here, how to check in python if unit has iLeaderExperience > 0? (i use it to determine GGs)

From experience I've never found anything in a python file using the Windows search. I assume it's not possible. I haven't found a solution to this problem yet.
 
Python .py files are plain text files just like .txt, and as we all know, Windows has trouble doing anything simple or simply. Of course, it has even more trouble doing something hard, too. :mischief:

The great free programmer's editor Notepad++ has a Find in Files command for this type of thing.
 
Python .py files are plain text files just like .txt, and as we all know, Windows has trouble doing anything simple or simply. Of course, it has even more trouble doing something hard, too. :mischief:

The great free programmer's editor Notepad++ has a Find in Files command for this type of thing.

Sounds great. :goodjob: Will try this at next opportunity!
 
i have an another question here, how to check in python if unit has iLeaderExperience > 0? (i use it to determine GGs)

unit.getLeaderUnitType() > 0 would work, but you probably want to use unit.getLeaderUnitType() != -1 if you are doing a check for all leader types.
 
Back
Top Bottom