Afforess
The White Wizard
@ EmeperorFool: I'd like to revisit the PROMOTION_LEADER issue from before. I am adding a few new wonders to my mod and one of them is Leonardo's Workshop by Tsentom1.
I noticed within this code there is a reference to the PROMOTION_LEADER tag or whatever. I added this python to my mod, and while I can build Leonardo's Workshop there is no effect on unit upgrade costs (it is supposed to halve the cost to upgrade a unit). Since someone in Tsentom's thread told me it worked, and since I definitely added it correctly (I compared my python to his) I was wondering if it wasn't working becuase of the missing PROMOTION_LEADER tag from this assert failure:
No. As I understand it, those are not loaded before the XML. They are used when the game calls them. They operate exactly like python callbacks. So that promotion leader call is not causing an assert.
I think Afforess said he had the same issue when he ran BUG with a DebugDLL. I'm just wondering if BUG is incompatible with the Leonardo's Workshop python (from Tsentom1's Python Wonders) that I have here. I ask this because a couple people have reported on Tsentom1's thread that the wonder works, the building is completely buildable and is properly inserted (as a wonder, with working video and art, and you get the effects from BuildingInfos too) it is just that the python effect (the -50% upgrade cost) doesn't happen at all.
Also, you will notice that it references the GraphicOptions xml file, not the PromotionInfos XML, so I'm wondering why it is looking for the Promotion there anyway.
Two things here. Check that you have this block of code in CvUnit.cpp
Code:
CyArgsList argsList;
argsList.add(getOwnerINLINE());
argsList.add(getID());
argsList.add((int) eUnit);
long lResult=0;
gDLL->getPythonIFace()->callFunction(PYGameModule, "getUpgradePriceOverride", argsList.makeFunctionArgs(), &lResult);
if (lResult >= 0)
{
return lResult;
}
That's the code that calls the python section that adjusts the units upgrade prices. If it is not there or commented out, your code won't work. If it is there, then you code should work fine.
Second things, the reason it is looking at graphic infos XML file for the assert is because that is the last XML file to have been loaded. It is not significant. For those who don't understand, Civ loads XML files in a specific order, a few at a time. It loads the python before it loads 98% if the XML. That's why you are getting the assert, it is trying to find an XML value before it is loaded. Now, I looked at the PLE that Ruff was creating, and it seems that the line
Code:
iLeaderPromo = gc.getInfoTypeForString('PROMOTION_LEADER')
Can simply be removed. It isn't used for anything, he resets the value later on. I removed a week or so ago and have had no issues and no asserts.