How to edit congresses?

DrZomboss

Brrrainz Gourmet
Joined
Mar 21, 2012
Messages
369
Location
Tervuren, Belgium
This is the question. I've wanted congresses to appear much earlier and tried changing the tech in Congresses.py from con.iNationalism to con.iAlphabet but it doesn't seem to work? Any help?
Spoiler :
def onTechAcquired(self, iTech, iPlayer):
if (self.getCongressEnabled() == True or self.getUNbuilt() == True):
return
if (self.getCivsWithNationalism() >= 1 and gc.getGame().getGameTurn() >= con.tBirth[utils.getHumanID()]):
print ("Congress enabled")
self.setCongressEnabled(True)
return
if (iTech == con.iNationalism):
self.setCivsWithNationalism(self.getCivsWithNationalism() + 1)
 
I haven't read this forum for long time... I see I am a couple of months late in replying to this question.

If I read the code correctly the appearance of congresses is set to the discovery by anybody of Nationalism.
The key piece of code is the last of what you posted:

if (iTech == con.iNationalism):
self.setCivsWithNationalism(self.getCivsWithNation alism() + 1)


you could just change the line to record the discovery of any other tech.
For example:

if (iTech == con.iCodeOfLaws):
self.setCivsWithNationalism(self.getCivsWithNation alism() + 1)

It's not the cleanest way but it should work out (at least for a test): congresses will then start appearing after the discovery of iCodeOfLaws (and after the human player start playing).

For the list of tech constants, look at the file Const.py where you can find the constants for all other techs.



If you want to connect the start of congresses to something else (date, turn, build of a wonder, or anything else) then the code will be a bit more complex (not a lot, but obviously more than changing a constant).
 
Back
Top Bottom