Hey, I'm a non-programmer trying to play around with Python. I'm using PlatyPing's Gigapack mod and am using the code in there as a basis for experimenting with new ideas.
Anyways, I wanted to make a wonder that generates research based off of the city's culture. Here is the part that is causing me trouble:
I know that hardcoding the player with getPlayer(0) is bad, but I'm taking baby steps here
Obviously, getting a research bonus equal to your culture is crazy over powered, but right now I'm just trying to get the idea to work.
self.Wonder is a variable declared higher up in the code. The problem I'm having is with the last line. If I don't comment it out, it breaks my game (the game loads, but the user interface vanishes and you can't play the game). I'm surprised that the last line is the one causing the problem, because it's a straight copy/paste of PlatyPing's WillisTower code, which works. I'm guessing it has to do with getCulture not playing nice with setBuildingCommerceChange, but I have no idea how to proceed from here.
Anyways, I wanted to make a wonder that generates research based off of the city's culture. Here is the part that is causing me trouble:
Code:
if self.Wonder[0] != -1:
WonderCity = CyMap().plot(self.Wonder[0], self.Wonder[1]).getPlotCity()
iBonus = WonderCity.getCulture(gc.getPlayer(0))
WonderCity.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_WONDER"), 1, iBonus
I know that hardcoding the player with getPlayer(0) is bad, but I'm taking baby steps here

self.Wonder is a variable declared higher up in the code. The problem I'm having is with the last line. If I don't comment it out, it breaks my game (the game loads, but the user interface vanishes and you can't play the game). I'm surprised that the last line is the one causing the problem, because it's a straight copy/paste of PlatyPing's WillisTower code, which works. I'm guessing it has to do with getCulture not playing nice with setBuildingCommerceChange, but I have no idea how to proceed from here.