strategyonly
C2C Supreme Commander
Does anyone have any idea how to FIX this??? post # 12.
see below attachments, thx.
see below attachments, thx.
What does line 598 of your version of CvGameUtils do?
#Checks religion percents
lReligions = [ ]
bestReligionPercent = 0
iBestReligion = -1
for iReligionLoop in range(gc.getNumReligionInfos( )):
iReligionLevel = gc.getGame().calculateReligionPercent(iReligionLoop)
[B]if iReligionLevel > gc.getGame().calculateReligionPercent(iStateReligion):[/B]
lReligions.append( iReligionLoop )
if (iReligionLoop != iStateReligion):
religionPercent = gc.getGame().calculateReligionPercent(iReligionLoop)
if (religionPercent > bestReligionPercent):
bestReligionPercent = religionPercent
iBestReligion = iReligionLoop
I am also guessing, but it looks like The J is on the right track. Where is the value of iStateReligion set, and what is it's value? Most Civ4 functions that return an id number will return a -1 if there is something wrong. Is it possible that iStateReligion equals -1 when the error is occuring?
is this in a mod you are making or converting? a little context might help too
Code:#Checks religion percents lReligions = [ ] bestReligionPercent = 0 iBestReligion = -1 for iReligionLoop in range(gc.getNumReligionInfos( )): iReligionLevel = gc.getGame().calculateReligionPercent(iReligionLoop) [B]if iReligionLevel > gc.getGame().calculateReligionPercent(iStateReligion):[/B] lReligions.append( iReligionLoop ) if (iReligionLoop != iStateReligion): religionPercent = gc.getGame().calculateReligionPercent(iReligionLoop) if (religionPercent > bestReligionPercent): bestReligionPercent = religionPercent iBestReligion = iReligionLoop
#Checks religion percents
lReligions = [ ]
bestReligionPercent = 0
iStateLevel = 0
for iReligionLoop in range(gc.getNumReligionInfos( )):
if (gc.getGame().getReligionGameTurnFounded(iReligionLoop) > 0):
iReligionLevel = gc.getGame().calculateReligionPercent(iReligionLoop)
if iStateReligion >= 0:
iStateLevel = gc.getGame().calculateReligionPercent(iStateReligion)
if iReligionLevel > iStateLevel:
lReligions.append( iReligionLoop )
if (iReligionLoop != iStateReligion):
religionPercent = gc.getGame().calculateReligionPercent(iReligionLoop)
if (religionPercent > bestReligionPercent):
bestReligionPercent = religionPercent
Code:#Checks religion percents lReligions = [ ] bestReligionPercent = 0 iStateLevel = 0 for iReligionLoop in range(gc.getNumReligionInfos( )): if (gc.getGame().getReligionGameTurnFounded(iReligionLoop) > 0): iReligionLevel = gc.getGame().calculateReligionPercent(iReligionLoop) if iStateReligion >= 0: iStateLevel = gc.getGame().calculateReligionPercent(iStateReligion) if iReligionLevel > iStateLevel: lReligions.append( iReligionLoop ) if (iReligionLoop != iStateReligion): religionPercent = gc.getGame().calculateReligionPercent(iReligionLoop) if (religionPercent > bestReligionPercent): bestReligionPercent = religionPercent
Try this.
My guess is that you've merged BUG into your mod, but you used your own event manager called CvModEvents. This won't work. Follow the instructions for using your event manager class with BUG on the wiki that I linked for you in the BUG thread.
The second error looks like it's caused by trying to merge in Next War's event manager class. That class stores the number of nukes as a list in CyGame's script data. However, BUG uses Stone-D's SdToolkit to store all its data in that same place, and not as a list (it's a dictionary). Cammagno posted a version of Next War merged with BUG a while back, and I think he's working on an updated version for BUG 3.6.
When you say that you haven't merged BUG and those other Python files, you mean that you haven't modified the files themselves, right? You did copy them into the same Assets folder hierarchy, right? If so, that won't work. You can't load up the trunk of a car and expect it to run like a hybrid. You have to alter the engine. There's just no getting around that, sorry.
Sorry, I thought this was one of your threads in the BUG forum. I see you didn't pack any BUG files in the RAR you just posted, but the error that CvAppInterface is calling fireEvent is from BUG--not the original game.
So, do you have BUG installed in CustomAssets and are trying to use your mod as a mod? If so, you need to tell your mod to ignore the BUG files. Open your mod's INI file and change NoCustomAssets to 1.
Correct. Next War keeps track of all nukes that are used in the game by storing the value in a list in CyGame's script data. You must have done something to either change that data or are using a game not created using that mod.
As for the first error, can you post your CvAppInterface.py file? I didn't see one in the RAR.