acquireCity changed in 3.13 !!

Fabrysse

Charming-snake learner
Joined
Sep 11, 2006
Messages
430
Location
Toulouse - France
My mod was ok with BtS 3.03, and now I have problems with 3.13 !!
I have an unidentifiable C++ exception on "acquireCity" function.
I can't see why.
I tried to remove all buildings and all units in the city : it's equal !
Is there a way to know when this exception occurs ?
Some suggestions ?...
 
What does your code look like?
 
Here is the code I use :
Code:
apCityList = pyFP.getCityList()
for pyCity in apCityList:
   pCity = pyCity.GetCy()
   if(not pCity.isNone() and pCity.getName() = "MyCity"):
      NewPlayer.acquireCity()

With that code, I have an unidentified C++ exception.

I've tried to replace "NewPlayer.acquireCity()" by "Owner.disband(pCity)" or by "pCity.kill()" in the 2 tests, the game turns, and turns, and turns, and never ends !...

When I use acquireCity(), the city is passed to NewPlayer, the buildings are OK, the religions too... there is only one religion (holy city), but on an other Holy city, I don't have the problem. All looks good, but this C++ exception stops the python execution.
I can't see what happens.

I had a similar problem with 3.03 version, but adding in the "if" the "not pCity.isNone()" solved the problem.

This time I don't know how to do... :(
 
From API:
VOID acquireCity(CyCity pCity, BOOL bConquest, BOOL bTrade)
Your code:
NewPlayer.acquireCity()

It looks to me like you're missing the three required arguments.


Here's another thing:
pCity.getName() = "MyCity"
You're missing a =. It should be
pCity.getName() == "MyCity"
Otherwise you're trying to set pCity.getName() to "MyCity".
 
No, no, I made mistakes writing the code in the forum.
  • I have written "=="
  • and Newplayer.acquireCity(pCity, False, False)

I have no python error, but a c++ exception. So my python code is ok.
I continue tests to find where is the problem. It's not easy : I have no information, so I have to test each element one by one.
When I have no building, no unit and no religion in the city, it works (but it takes 10 minutes !!!!!!). When I have no religion, but units and buildings, the problem occurs.
Now, I'm searching wich building or unit causes the problem. It's very long !
 
Back
Top Bottom