Need help merging

Is that Buccaneers event a creation of yours or one of the mods you merged, or is it from BTS itself? I've never gotten the event, but I don't play a whole lot.

Yeah its from RoM.

I have no idea what would cause the second problem with the bombing range shading. That's really strange. If you select a different unit and then reselect the missile, does it fix it or still look wrong?

Still looks the same even if i switch to a different kind of missile.
 
OK after the all the work you put into this, i now get an error on the barbarian mod stuff, also tied together with SA/GP mods.

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 184, in checkBarbCities

AttributeError: 'CyCity' object has no attribute 'countTotalCulture'
ERR: Python function onEvent failed, module CvEventInterface
 
What does the author of BarbarianCiv have to say about this error? I don't see how it's connected to the two other mods.
 
What does the author of BarbarianCiv have to say about this error? I don't see how it's connected to the two other mods.

Thats jdog5000 and havent talked to him yet, but i just PMed him, thx.
 
It means that the python file doesn't find the function "countTotalCulture" in the SDK. The real name of the function is "countTotalCultureTimes100" (but you must divide the number it returns by 100).
 
It means that the python file doesn't find the function "countTotalCulture" in the SDK. The real name of the function is "countTotalCultureTimes100" (but you must divide the number it returns by 100).

So i change what in BarbarianCiv.py?
 
You replace:

Line 184 ==> barbCityList.GetCy().countTotalCulture() by (barbCityList.GetCy().countTotalCultureTimes100()/100)

Line 551 ==> city.GetCy().countTotalCulture() by (city.GetCy().countTotalCultureTimes100()/100)
 
You replace:

Line 184 ==> barbCityList.GetCy().countTotalCulture() by (barbCityList.GetCy().countTotalCultureTimes100()/100)

Line 551 ==> city.GetCy().countTotalCulture() by (city.GetCy().countTotalCultureTimes100()/100)


See below.
 
Given that the syntax error is on line 186, I would guess you made an error modifying line 184. A syntax error in Python means that it doesn't not understand what you wrote. The parser (the piece that reads your code) found invalid code as opposed to an identifier (function or variable) that doesn't exist.

Look at lines 184-188 and parse them by hand to see if they are valid Python. You can use the Python reference at docs.python.org as you really need to learn Python to be doing modding at this level. You'll be much more efficient as you could fix this error yourself in 5 minutes rather than having to post and wait for someone to do it for you. I think you'll also get much more enjoyment out of modding and pick up a very useful skill.
 
I put it in by hand and still get this:

Traceback (most recent call last):
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "<string>", line 1, in ?
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "<string>", line 52, in load_module
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "CvEventInterface", line 13, in ?
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "<string>", line 52, in load_module
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "CvCustomEventManager", line 25, in ?
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "<string>", line 35, in load_module
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "<string>", line 13, in _get_code
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
File "
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
BarbarianCiv
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
", line
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
186
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
mod = self.config.getfloat("BarbarianCiv", "Modifier", 1.00)
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
^
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
SyntaxError
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
:
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
invalid syntax
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface

ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
Failed to load python module CvEventInterface.
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
 
That's the exact same error. What did you changed? If you post the few lines before and after line 186 and bold line 186, I'll take a look. But you really do need to learn to do this kind of stuff on your own or you'll have a tough time getting your mod to work.
 
Spoiler :
Code:
pop = maxListPop
            cl = int( barbCityList[i].getCulture()/2.0 + (barbCityList[i].GetCy().countTotalCultureTimes100()/100)
            # Odds modifier from config file
            [B]mod = self.config.getfloat("BarbarianCiv", "Modifier", 1.00)[/B]
            # If lots of barb cities, increase odds
            numCitiesMod = int(sqrt(len(barbCityList)))
            # Change by gamespeed
            gsm = (661.0)/(game.getMaxTurns() + 1.0)
            # Odds of barb city settling down go up by era
            eraMod = gc.getActivePlayer().getCurrentEra() - game.getStartEra()/2.0
            if( eraMod < .5 ) :
                eraMod = .5
 
You didn't add the closing parenthesis when modifying line 184. You should double-check that you edited the other line correctly, too.

Code:
cl = int( barbCityList[i].getCulture()/2.0 + (barbCityList[i].GetCy().countTotalCultureTimes100()/100)[B][COLOR="Orange"] )[/COLOR][/B]

As in this case, syntax errors on a line that looks okay usually means the line(s) just before have the error.
 
You must have: cl = int( barbCityList.getCulture()/2.0 + (barbCityList.GetCy().countTotalCultureTimes100()/100)/10.0 ) if you want to respect the original code.
 
You didn't add the closing parenthesis when modifying line 184. You should double-check that you edited the other line correctly, too.

Code:
cl = int( barbCityList[i].getCulture()/2.0 + (barbCityList[i].GetCy().countTotalCultureTimes100()/100)[B][COLOR="Orange"] )[/COLOR][/B]

As in this case, syntax errors on a line that looks okay usually means the line(s) just before have the error.

OK i tried it this
Spoiler :
Code:
 pop = maxListPop
            cl = int( barbCityList[i].getCulture()/2.0 + (barbCityList[i].GetCy().countTotalCultureTimes100()/100) )
            # Odds modifier from config file
            mod = self.config.getfloat("BarbarianCiv", "Modifier", 1.00)
            # If lots of barb cities, increase odds
            numCitiesMod = int(sqrt(len(barbCityList)))
            # Change by gamespeed
            gsm = (661.0)/(game.getMaxTurns() + 1.0)
            # Odds of barb city settling down go up by era
            eraMod = gc.getActivePlayer().getCurrentEra() - game.getStartEra()/2.0
            if( eraMod < .5 ) :
                eraMod = .5
way and i got this:

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 206, in checkBarbCities

File "BarbarianCiv", line 428, in createBarbCiv

ArgumentError: Python argument types in
CyPlayer.initUnit(CyPlayer, int, int, int, CvPythonExtensions.UnitAITypes)
did not match C++ signature:
initUnit(class CyPlayer {lvalue}, int, int, int, enum UnitAITypes, enum DirectionTypes)
ERR: Python function onEvent failed, module CvEventInterface

both ways are ALMOST the same results?? (See below)
 
You must have: cl = int( barbCityList.getCulture()/2.0 + (barbCityList.GetCy().countTotalCultureTimes100()/100)/10.0 ) if you want to respect the original code.


OK tried it this way:
Spoiler :
Code:
pop = maxListPop
            cl = int( barbCityList[i].getCulture()/2.0 + (barbCityList[i].GetCy().countTotalCultureTimes100()/100)/10.0 )
            # Odds modifier from config file
            mod = self.config.getfloat("BarbarianCiv", "Modifier", 1.00)
            # If lots of barb cities, increase odds
            numCitiesMod = int(sqrt(len(barbCityList)))
            # Change by gamespeed
            gsm = (661.0)/(game.getMaxTurns() + 1.0)
            # Odds of barb city settling down go up by era
            eraMod = gc.getActivePlayer().getCurrentEra() - game.getStartEra()/2.0
            if( eraMod < .5 ) :
                eraMod = .5

and got this:

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 206, in checkBarbCities

File "BarbarianCiv", line 428, in createBarbCiv

ArgumentError: Python argument types in
CyPlayer.initUnit(CyPlayer, int, int, int, CvPythonExtensions.UnitAITypes)
did not match C++ signature:
initUnit(class CyPlayer {lvalue}, int, int, int, enum UnitAITypes, enum DirectionTypes)
ERR: Python function onEvent failed, module CvEventInterface

both ways are ALMOST the same results??
 
The function "initUnit" must have 5 arguments, not 4 as it is coded in your file. You must add ,-1 at the end of all the "initUnit" functions which have only 4 attributes. Like in the following example:

newPlayer.initUnit(gpType,ix,iy,UnitAITypes.NO_UNITAI) must be replaced by:

newPlayer.initUnit(gpType,ix,iy,UnitAITypes.NO_UNITAI,-1)
 
Where do i add them? I think i got one(1), :blush::(


Spoiler :
Code:
if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,cityX,cityY,3)
if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,cityX,cityY,1)

if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military infantry'))
                            if( not iMobile == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iMobile,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military mobile'))
                            if( not iAttack == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iAttack,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military mobile'))


if( not iScout == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iScout,capital.getX(),capital.getY(),1)
                if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)


if( not iSettler == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iSettler,capital.getX(),capital.getY(),1)
                    if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)
                if( barbSettleType == 2 ) : # Builder
                    if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)
                    if( not iSettler == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iSettler,capital.getX(),capital.getY(),1)
                    if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)
                    if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,capital.getX(),capital.getY(),2)


if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)
                        if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)


if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,cityX,cityY,1)
                    if( not iMobile == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iMobile,cityX,cityY,2)
                    if( not iAttack == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iAttack,cityX,cityY,1)


pyNewPlayer.initUnit(iAssaultShip,city.getX(),city.getY(),2)


newPlayer.initUnit(gpType,ix,iy,UnitAITypes.NO_UNITAI-1)


if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,cityX,cityY,3)
                    if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,cityX,cityY,1)


if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,cityX,cityY,2+game.getSorenRandNum(5+extraUnits,'BarbarianCiv: give military infantry'))
                            if( not iAttack == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iAttack,cityX,cityY,2+game.getSorenRandNum(5+extraUnits,'BarbarianCiv: give military mobile'))
                        else :
                            if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military infantry'))
                            if( not iMobile == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iMobile,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military mobile'))
                            if( not iAttack == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iAttack,cityX,cityY,1+game.getSorenRandNum(4+extraUnits,'BarbarianCiv: give military mobile')

if( not iScout == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iScout,capital.getX(),capital.getY(),1)
                if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)


if( not iSettler == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iSettler,capital.getX(),capital.getY(),1)
                    if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)
                if( barbSettleType == 2 ) : # Builder
                    if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)
                    if( not iSettler == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iSettler,capital.getX(),capital.getY(),1)
                    if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)
                    if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,capital.getX(),capital.getY(),2)


if( not iWorker == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iWorker,capital.getX(),capital.getY(),1)
                        if( not iBestDefender == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iBestDefender,capital.getX(),capital.getY(),1)
                elif( barbSettleType == 1 and (len(cityList) == 1 or newPlayer.getCurrentEra() > 2) ) : # Military extra stuff if small or late
                    if( not iCounter == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iCounter,cityX,cityY,1)
                    if( not iMobile == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iMobile,cityX,cityY,2)
                    if( not iAttack == UnitTypes.NO_UNIT ) : pyNewPlayer.initUnit(iAttack,cityX,cityY,1)
 
Look at all the places where that code calls initUnit() and count how many parameters are pass in the ()s. You can tell because parameters are separated by commas.
 
Look at all the places where that code calls initUnit() and count how many parameters are pass in the ()s. You can tell because parameters are separated by commas.

OK, whats a parameter?:blush: I flunked English back in the 60's,:p
 
Back
Top Bottom