what's up with canUpgradeAnywhere?

Baldyr

"Hit It"
Joined
Dec 5, 2009
Messages
5,530
Location
Sweden
I'm stuck on the finishing line with a project because I can't get the canUpgradeAnywhere callback to CvGameUtils to register, at all. I basically put a print statement in the method to see when it will fire - never as it turns out. And I can't find anything to enable in PythonCallbackDefines.xml either.

Searching these forums for the past hour only rendered me this. According to these folks the callback isn't even made from the SDK but is rather hard-coded into the executable. But my question is merely: how does it work?

What I need to do, in order to finish this project, is to allow some units of some player to upgrade units outside of cultural borders. Now, I'm not even sure if this is doable, because how would those units have access to the required special resources? :confused: So the whole callback isn't making much sense anyway. :crazyeye:
 
There's no such function/callback hard-coded in the executable, it simply doesn't exist, unless you copy it from RevDCM i.e. what Phungus posted + related CvInfo stuff. The essential part of the original code is in CvUnit::isReadyForUpgrade:
Code:
	if (plot()->getTeam() != getTeam())
	{
		return false;
	}

It checks if the unit and plot owner are on the same team, that's it. There's no "upgrade anywhere" ability in the DLL; the python thing is some leftover/unused code.
 
Back
Top Bottom