Combining shouldn't be to hard.
You can look at the structure of one of the modcomps, and just use it as base.
If the next modcomp, which you want to merge, has additional files, which are not already present in the old one, then just add them.
If there's an overlap, then you have to find the new entries and copy them over. In the xml files, the new entries are normaly at the end of every file, in the python files you have to search for the name of the modcomp and copy it over to the right section.
Has anyone else had problems with the Leonardo's workshop wonder? Mine doesn't seem to work at all. I playted a test-game and built it (I actually built it, I didn't just plop it down anywhere), movie played, culture went up all that stuff, except the upgrade costs were the same. So it must be the python. Can someone help me out here?
I have attached the python file used in my mod, CvGameUtils.py, it was the only one that came in the download. Thanks in advance to anyone who could help me out with this.![]()
I edited the XML too, otherwise I wouldn't have been able to build it. Could you post your python file so I could compare it?
@ The Capo: Do you have another python code which changes upgrade cost?
Wouldn't make much sence since both my python file is based on the one from HiTM
and because I added a lot of Tsentom1's python wonders and some other stuff in there.
\Skodkim
Yeah, but I'd still be able to compare what you have in yours with what I have in mine.
def getWidgetHelp(self, argsList):
eWidgetType, iData1, iData2, bOption = argsList
return u""
def getUpgradePriceOverride(self, argsList):
iPlayer, iUnitID, iUnitTypeUpgrade = argsList
## Leonardo's Workshop Start ##
pPlayer = gc.getPlayer(iPlayer)
pUnit = pPlayer.getUnit(iUnitID)
iPrice = gc.getDefineINT("BASE_UNIT_UPGRADE_COST")
iPrice += (max(0, (pPlayer.getUnitProductionNeeded(iUnitTypeUpgrade) - pPlayer.getUnitProductionNeeded(pUnit.getUnitType()))) * gc.getDefineINT("UNIT_UPGRADE_COST_PER_PRODUCTION"))
if ((not pPlayer.isHuman()) and (not pPlayer.isBarbarian())):
pHandicapInfo = gc.getHandicapInfo(gc.getGame().getHandicapType())
iPrice = iPrice * pHandicapInfo.getAIUnitUpgradePercent() / 100
iPrice = iPrice * max(0, ((pHandicapInfo.getAIPerEraModifier() * pPlayer.getCurrentEra()) + 100)) / 100
iPrice = iPrice - ((iPrice * pUnit.getUpgradeDiscount()) / 100)
b_Leonardo = gc.getInfoTypeForString("BUILDING_LEONARDO")
obsoleteTech = gc.getBuildingInfo(b_Leonardo).getObsoleteTech()
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(b_Leonardo) == true:
iPrice = ((gc.getDefineINT("BASE_UNIT_UPGRADE_COST"))/2)
iPrice += (((max(0, (pPlayer.getUnitProductionNeeded(iUnitTypeUpgrade) - pPlayer.getUnitProductionNeeded(pUnit.getUnitType()))) * gc.getDefineINT("UNIT_UPGRADE_COST_PER_PRODUCTION")))/2)
if ((not pPlayer.isHuman()) and (not pPlayer.isBarbarian())):
pHandicapInfo = gc.getHandicapInfo(gc.getGame().getHandicapType())
iPrice = ((iPrice * pHandicapInfo.getAIUnitUpgradePercent() / 100)/2)
iPrice = ((iPrice * max(0, ((pHandicapInfo.getAIPerEraModifier() * pPlayer.getCurrentEra()) + 100)) / 100)/2)
iPrice = ((iPrice - ((iPrice * pUnit.getUpgradeDiscount()) / 100))/2)
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEADER')):
iPrice = 0
return iPrice
## Leonardo's Workshop End ##
## Leonardo's Workshop Start ##
#
## NOTE: You need to comment out (add a # before) the original return -1 (done below) ##
#
# return -1 # Any value 0 or above will be used
#
## Leonardo's Workshop End ##
def getExperienceNeeded(self, argsList):
# use this function to set how much experience a unit needs
iLevel, iOwner = argsList
iExperienceNeeded = 0
I did notice something when I ran a DeugDLL on it. I have BUG in my mod, and aparently this assert failure comes up with BUG (see attachment). I also noticed that part of the code for Leonardo's workshop references this tag (PROMOTION_LEADER) in the python. Could that be the reason it isn't working for me?
if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEADER')):
iPrice = 0
# if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_LEADER')):
# iPrice = 0
Hmm...
I can see in the FAssert that it BUGslol
about CvGlobals.cpp, can you get your hands in your mod's source code? Just wondering why it's about PROMOTION_LEADER and GraphicOptionInfos.
Well, if by that you mean SDK there is none! I am just using BUG and there isn't a CvGlobals.cpp file involved at all. I asked EmperorFool about it (actually a couple people have) but he hasn't fixed it yet. So I suppose for the time being I'll have to deal with this until he fixes it, huh?