• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Creating a new project

Paolo80

Chieftain
Joined
Dec 20, 2019
Messages
85
Hi guys,

I have a question for you.

I've created a new project called "silk way" and i want to create a python function that does the following:

if a player has created project silk way then he gets silk free bonus for every owned city.

Is it possible? I've looked for some function that control if a player has created "silk way project", but I haven't found.
 
I don’t think you need to use python. Xml would be enough.
Using xml you can have a wonder that gives a free building in every city.
Also in xml, you can create a building that provides a free silk bonus.
 
Also similar is the FreeBonus tag (the Broadway/Musicals ability) in Civ4BuildingInfos.xml. Projects are handled at the level of teams, so CyTeam::getProjectCount should be the function that you were looking for.
 
I wrote the following code

Code:
for i in range(gc.getMAX_PLAYERS()):
            for pCity in PyPlayer(i).getCityList():
                iTeam = pCity.GetCy().getTeam()
                if gc.getTeam(iTeam).getProjectCount(gc.getInfoTypeForString('PROJECT_VIA_DELLA_SETA')) == True:
                    pCity.getCy().changeFreeBonus(gc.getInfoTypeForString('BONUS_SILK'), 1)

Now it seems work
 
Back
Top Bottom