strategyonly
C2C Supreme Commander
Well, good. It seems to run past that part now, so it should be OK.
OK.
What it is saying is correct. The class PyCity, as defined in the file PyHelpers.py, does not have as an attribute a function called "setHasRealBuildingIdx".
What it does have is the function setNumRealBuildingIdx.
The difference is that instead of having a true/false value for the second parameter it takes a number. I would guess that originally you could only have one of any specific building in a city and at some point they changed it so that you could have more than one and this mod predates the change (the Final Frontier mod that comes with BtS can have more than one, so any such change happened in BtS or earlier - the GlobalDefines.xml or GlabalDefinesAlt.xml file has a value CITY_MAX_NUM_BUILDINGS which is normally set to 1, but can be higher as Final Frontier sets it to 8).
I would say that changing any occurrence of something like this:
to be something like this:Code:city.setHasRealBuildingIdx([COLOR="Red"]iThingy[/COLOR],True)
Code:city.setNumRealBuildingIdx([COLOR="Red"]iThingy[/COLOR],1)
The reason iThingy is red is that it isn't really iThingy, it will be something different each time.
There are 5 occurances of city.setHasRealBuildingIdx in the file on lines 540, 544, 547, 550, and 569.
There are also 3 occurances of capital.setHasRealBuildingIdx which need the same fix (but to capital.* rather than city.*) on lines 563, 566, and 580.
Fixing all 8 of those should get rid of this problem. Then you get to see what the next problem will be. I figure there is about a 50% chance that you won't be done with this file yet - it would be higher but this is getting close to the end of the file.
OK i did this.
Interesting thing (maybe). I was skimming the file to see what was ahead and noticed something.
I'm pretty sure the original BarbarianCiv.py file has a bug in it on line 609.
Code:for i in range(0, gc.getMAX_CIV_PLAYERS()) : [B]if( newPlayer.canContact( 9 ) ) :[/B] contactList.append( i )
The "9" should almost certainly be an "i".
As it is, if the new barbarian civ can contact player 9 then every player in the game is added to the list of players they can contact. If they can not contact player 9 then nobody is added to the list. This list is later used to pick a target for a "military type" barbarian to attack (it picks one off the list and declares war immediately if there is at least 1 player in the list).
Changing it to an "i" would hopefully make the list be the actual players that they could contact, which should be those that are close.
So even the original apparently didn't work quite the way it was supposed to.
Did this also.
There apepars to be another bug in the original:
Line 651 is nto indented as far as it should be. I ought to have 1 more tab level of indentation.
As it is, the lack of indentation should casue the definition of the function to end:
So the onFirstContact function is likely to do nothing and there is a bunch of loose code floating around in the end of class BarbarianCiv.Code:def onFirstContact( self, argsList ) : 'Contact' iTeamX,iHasMetTeamY = argsList
This can't be a good thing.
Edit: Well, after posting it here I discovered something. The line that starts with "iTeam" is indented with a single tab, the others use spaces. Mixing tabs and spaces is never a good idea. All (hopefully) of the other lines in the file use spaces. That one line ought to be indented with spaces as far as the next line with text on it.
Tried this and it didnt work, i got a syntax error that said something was wrong with: iTeamX,iHasMetTeamY = argsList SO i changed it back.
Now after the first two above i get this error message:
Traceback (most recent call last):
File "CvEventInterface", line 25, in onEvent
File "CvCustomEventManager", line 162, in handleEvent
File "CvCustomEventManager", line 173, in _handleDefaultEvent
File "BarbarianCiv", line 104, in onEndGameTurn
File "BarbarianCiv", line 207, in checkBarbCities
File "BarbarianCiv", line 552, in createBarbCiv
AttributeError: 'CyCity' object has no attribute 'countTotalCulture'
ERR: Python function onEvent failed, module CvEventInterface