national Religious wonders

j_mie6

Deity
Joined
Dec 20, 2009
Messages
2,963
Location
Bristol (uni)/Swindon (home)
Bit of a strange concept...

I want to make it o that the national wonders of National Park, Ironworks, globe theatre and heroic epic becoem religion (granted by roman gods) so I joined them to god names

Temple of Mars - Heroic Epic
Temple of Apollo - National Park
Temple of Vulcan - Ironworks
Temple of Braccus - Globe Theatre

All I would do for these would be to make the roman Temple a prereq (like cathedrals) however I figured that each religion needs a alternative name (ie Temples of Ares) so what happens if I made each national wonder a Unique building? like this:

Code:
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_HEROIC_EPIC</BuildingClass>
			<Type>BUILDING_TEMPLE_MARS</Type>
			<SpecialBuildingType>NONE</SpecialBuildingType>
			<Description>TXT_KEY_BUILDING_HEROIC_EPIC</Description>
			<Civilopedia>TXT_KEY_BUILDING_HEROIC_EPIC_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_HEROIC_EPIC_STRATEGY</Strategy>
			<Advisor>ADVISOR_MILITARY</Advisor>
			<ArtDefineTag>ART_DEF_BUILDING_HEROIC_EPIC</ArtDefineTag>
			<MovieDefineTag>NONE</MovieDefineTag>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<bStateReligion>0</bStateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<FoundsCorporation>NONE</FoundsCorporation>
			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
			<VictoryPrereq>NONE</VictoryPrereq>
			<FreeStartEra>NONE</FreeStartEra>
			<MaxStartEra>ERA_RENAISSANCE</MaxStartEra>
			<ObsoleteTech>NONE</ObsoleteTech>
			<PrereqTech>TECH_LITERATURE</PrereqTech>
			<TechTypes/>
			<Bonus>NONE</Bonus>
			<PrereqBonuses/>
			<ProductionTraits/>
			<HappinessTraits/>
			<NoBonus>NONE</NoBonus>
			<PowerBonus>NONE</PowerBonus>
			<FreeBonus>NONE</FreeBonus>
			<iNumFreeBonuses>0</iNumFreeBonuses>
			<FreeBuilding>NONE</FreeBuilding>
			<FreePromotion>NONE</FreePromotion>
			<CivicOption>NONE</CivicOption>
			<GreatPeopleUnitClass>UNITCLASS_ARTIST</GreatPeopleUnitClass>
			<iGreatPeopleRateChange>1</iGreatPeopleRateChange>
			<iHurryAngerModifier>0</iHurryAngerModifier>
			<bBorderObstacle>0</bBorderObstacle>
			<bTeamShare>0</bTeamShare>
			<bWater>0</bWater>
			<bRiver>0</bRiver>
			<bPower>0</bPower>
			<bDirtyPower>0</bDirtyPower>
			<bAreaCleanPower>0</bAreaCleanPower>
			<DiploVoteType>NONE</DiploVoteType>
			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
			<bCapital>0</bCapital>
			<bGovernmentCenter>0</bGovernmentCenter>
			<bGoldenAge>0</bGoldenAge>
			<bAllowsNukes>0</bAllowsNukes>
			<bMapCentering>0</bMapCentering>
			<bNoUnhappiness>0</bNoUnhappiness>
			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
			<bNeverCapture>0</bNeverCapture>
			<bNukeImmune>0</bNukeImmune>
			<bPrereqReligion>0</bPrereqReligion>
			<bCenterInCity>0</bCenterInCity>
			<iAIWeight>0</iAIWeight>
			<iCost>200</iCost>
			<iHurryCostModifier>50</iHurryCostModifier>
			<iAdvancedStartCost>-1</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iMinAreaSize>-1</iMinAreaSize>
			<iConquestProb>0</iConquestProb>
			<iCitiesPrereq>0</iCitiesPrereq>
			<iTeamsPrereq>0</iTeamsPrereq>
			<iLevelPrereq>4</iLevelPrereq>
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
			<iAnarchyModifier>0</iAnarchyModifier>
			<iGoldenAgeModifier>0</iGoldenAgeModifier>
			<iGlobalHurryModifier>0</iGlobalHurryModifier>
			<iExperience>0</iExperience>
			<iGlobalExperience>0</iGlobalExperience>
			<iFoodKept>0</iFoodKept>
			<iAirlift>0</iAirlift>
			<iAirModifier>0</iAirModifier>
			<iAirUnitCapacity>0</iAirUnitCapacity>
			<iNukeModifier>0</iNukeModifier>
			<iNukeExplosionRand>0</iNukeExplosionRand>
			<iFreeSpecialist>0</iFreeSpecialist>
			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
			<iMaintenanceModifier>0</iMaintenanceModifier>
			<iWarWearinessModifier>0</iWarWearinessModifier>
			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
			<iHealRateChange>0</iHealRateChange>
			<iHealth>0</iHealth>
			<iAreaHealth>0</iAreaHealth>
			<iGlobalHealth>0</iGlobalHealth>
			<iHappiness>0</iHappiness>
			<iAreaHappiness>0</iAreaHappiness>
			<iGlobalHappiness>0</iGlobalHappiness>
			<iStateReligionHappiness>0</iStateReligionHappiness>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iMilitaryProductionModifier>100</iMilitaryProductionModifier>
			<iSpaceProductionModifier>0</iSpaceProductionModifier>
			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
			<iTradeRoutes>0</iTradeRoutes>
			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
			<iTradeRouteModifier>0</iTradeRouteModifier>
			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
			<iGlobalPopulationChange>0</iGlobalPopulationChange>
			<iFreeTechs>0</iFreeTechs>
			<iDefense>0</iDefense>
			<iBombardDefense>0</iBombardDefense>
			<iAllCityDefense>0</iAllCityDefense>
			<iEspionageDefense>0</iEspionageDefense>
			<iAsset>8</iAsset>
			<iPower>8</iPower>
			<fVisibilityPriority>1.0</fVisibilityPriority>
			<SeaPlotYieldChanges/>
			<RiverPlotYieldChanges/>
			<GlobalSeaPlotYieldChanges/>
			<YieldChanges/>
			<CommerceChanges/>
			<ObsoleteSafeCommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>4</iCommerce>
			</ObsoleteSafeCommerceChanges>
			<CommerceChangeDoubleTimes>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>1000</iCommerce>
			</CommerceChangeDoubleTimes>
			<CommerceModifiers/>
			<GlobalCommerceModifiers/>
			<SpecialistExtraCommerces/>
			<StateReligionCommerces/>
			<CommerceHappinesses/>
			<ReligionChanges/>
			<SpecialistCounts/>
			<FreeSpecialistCounts/>
			<CommerceFlexibles/>
			<CommerceChangeOriginalOwners/>
			<ConstructSound/>
			<BonusHealthChanges/>
			<BonusHappinessChanges/>
			<BonusProductionModifiers>
				<BonusProductionModifier>
					<BonusType>BONUS_MARBLE</BonusType>
					<iProductonModifier>100</iProductonModifier>
				</BonusProductionModifier>
			</BonusProductionModifiers>
			<UnitCombatFreeExperiences/>
			<DomainFreeExperiences/>
			<DomainProductionModifiers/>
			<BuildingHappinessChanges/>
			<PrereqBuildingClasses>
				<PrereqBuildingClass>
					<BuildingClassType>BUILDINGCLASS_ROMAN_TEMPLE</BuildingClassType>
					<iNumBuildingNeeded>2</iNumBuildingNeeded>
				</PrereqBuildingClass>
			</PrereqBuildingClasses>
			<BuildingClassNeededs/>
			<SpecialistYieldChanges/>
			<BonusYieldModifiers/>
			<ImprovementFreeSpecialists/>
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_MILITARY</FlavorType>
					<iFlavor>10</iFlavor>
				</Flavor>
			</Flavors>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
		</BuildingInfo>

Because only 1 of the building class is allowed this should mean you either make Mars or Ares but not both. However will you actually be able to construct a unique building if it isn't defined in the CivInfos?

or does it need to be a special building?

Help will be appreciated!
 
However will you actually be able to construct a unique building if it isn't defined in the CivInfos?
No. for a UB to be restricted to a particular civ, it would have to be defined in CivInfos.
special building ties buildings like temples together, enabling them with Priesthood although each temple has a different set of prereqs so can't be necessarily be built with that Tech, so won't be helpful to you

You can restrict it by religion as with Temples, in buildinginfo's
<ReligionType>WHATEVER</ReligionType>
<PrereqReligion>WHATEVER</PrereqReligion>

But to be honest I'm not quiet clear as to what you want to achieve.
Is it
Temple of Mars - Heroic Epic, one in the world, prereq religion present, unique to a civ
Temples of Ares - Heroic Epic, one in the world, (different) prereq religion present, unique to a civ?

in which case, fill in tags as for Heroic Epic etc replacing HEROIC_EPIC with TEMPLE_MARS
CIV4BuildingInfos.xml
Code:
			<BuildingClass>BUILDINGCLASS_TEMPLE_MARS</BuildingClass>
			<Type>BUILDING_TEMPLE_MARS</Type>.....
                    ..........  set your religion prereqs here
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<bStateReligion>0</bStateReligion>
			<PrereqReligion>NONE</PrereqReligion>
to set one only in the world in CIV4BuildingClassInfos.xml
Code:
		<BuildingClassInfo>
			<Type>BUILDINGCLASS_TEMPLE_MARS</Type>
			<Description>TXT_KEY_BUILDING_TEMPLE_MARS</Description>
			<iMaxGlobalInstances>1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iExtraPlayerInstances>0</iExtraPlayerInstances>
			<bNoLimit>0</bNoLimit>
			<bMonument>0</bMonument>
			<DefaultBuilding>BUILDING_TEMPLE_MARS</DefaultBuilding>
			<VictoryThresholds/>
		</BuildingClassInfo>

then for the UB CIV4CivilizationInfos.xml
Code:
			<Buildings>
				<Building>
					<BuildingClassType>BUILDINGCLASS_TEMPLE_MARS</BuildingClassType>
					<BuildingType>BUILDING_TEMPLE_MARS</BuildingType>
				</Building>
			</Buildings>

Then repeat the same replacing TEMPLE_MARS with TEMPLE_ARES.
Should work no?
 
Personally I also not too sure what you want.

But if you want to set it such that you either make Mars or Ares, using python you can set it to do a check if city has Mars, cannot build Ares, if city has Ares, cannot build Mars
 
ok Mars/Ares are National Epics. only one of them can be constructed in a civ at a time (so national wonders) and they require religons. The religions are easy enough but it's just whether it's possible in the xml to make sure that if Mars national wonder is built then the Ares national wonder cannot be built...

I guess this could be achieved with the cannot do building callback (going through every player city and checking that the wonders are not already present), but I am looking for the most lag effiecient solution at the moment
 
ok Mars/Ares are National Epics. only one of them can be constructed in a civ at a time (so national wonders) and they require religons. The religions are easy enough but it's just whether it's possible in the xml to make sure that if Mars national wonder is built then the Ares national wonder cannot be built...
would have to be python for that I'd say
 
looking in the api the python solution seems pretty easy with the cannotConstruct callback. I will just have to use some building finding methods. At some point I will have to move it to C++ though for speed
 
ok I got some code!

Code:
dWars = {"TXT_KEY_BUILDING_MARS": getIndex("Building", "Temple of Mars"),\
         "TXT_KEY_BUILDING_ARES": getIndex("Building", "Temple of Ares"),\
         "TXT_KEY_BUILDING_COCIDIUS": getIndex("Building", "Temple of Cocidius"),\
         "TXT_KEY_BUILDING_ONURIS": getIndex("Building", "Temple of Onuris")}
dHammers = {"TXT_KEY_BUILDING_VULCAN": getIndex("Building", "Temple of Vulcan"),\
            "TXT_KEY_BUILDING_HEPHAESTUS": getIndex("Building", "Temple of Hephaestus"),\
            "TXT_KEY_BUILDING_BELISAMA": getIndex("Building", "Temple of Belisama"),\
            "TXT_KEY_BUILDING_PTAH": getIndex("Building", "Temple of Ptah")}
dHappy = {"TXT_KEY_BUILDING_BACCHUS": getIndex("Building", "Temple of Bacchus"),\
          "TXT_KEY_BUILDING_DIONYSUS": getIndex("Building", "Temple of Dionysus"),\
          "TXT_KEY_BUILDING_ALAUNUS": getIndex("Building", "Temple of Alaunus"),\
          "TXT_KEY_BUILDING_HORUS": getIndex("Building", "Temple of Horus")}
dHealthy = {"TXT_KEY_BUILDING_APOLLO": getIndex("Building", "Temple of Apollo"),\
            "TXT_KEY_BUILDING_ASCLEPIUS": getIndex("Building", "Temple of Asclepius"),\
            "TXT_KEY_BUILDING_BENEDIGEIDFRAN": getIndex("Building", "Temple of Benedigeidfran"),\
            "TXT_KEY_BUILDING_HATHOR": getIndex("Building", "Temple of Hathor")}

def canBuildTemple(eBuilding, pCity):
        """
        Works out whether a temple can be contructed based on whether another temple is already in place
        """
        #Determine type of building and get list of simmilar buildings, if applicable.
        eBuildingName = gc.getBuildingInfo(eBuilding).getDescription()
        if eBuildingName in dWars.keys():
                lBuildings = [dWars[x] for x in dWars.keys() if not x == eBuildingName]
        elif eBuildingName in dHammers.keys():
                lBuildings = [dHammers[x] for x in dHammers.keys() if not x == eBuildingName]
        elif eBuildingName in dHappy.keys():
                lBuildings = [dHappy[x] for x in dHappy.keys() if not x == eBuildingName]
        elif eBuildingName in dHealthy.keys():
                lBuildings = [dHealthy[x] for x in dHealthy.keys() if not x == eBuildingName]
        else:
                return True
        pPlayer = gc.getPlayer(pCity.getOwner())
        #check if other temples have been built
        for x in lBuildings:
                if pPlayer.countNumBuildings(x) >= 1: return False
        return True

Code:
	def canConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		return self.custom.canBuildTemple(eBuilding, pCity)

Code:
def getIndex(category, entry):
        """
        Returns the enumerated index value (integer) of the specified entry belonging to the
        specified category, as specified by the XML.
        """
        key = category.replace(" ", "") + "_" + entry.replace(" ", "_")
        return gc.getInfoTypeForString(key.upper())

think it will work?
 
This is actually some of the code I am most proud of ever :D

I have never used the x = [n for n in y] stuff before and it is pretty cool

I will test after I have finished my current game (otherwise I lose it, or atleast I always seem to lose it :p)

edit: and I am still proud even when I think that I have made a working chess program (without ai for the moment :p) and my own logging system (where the module stores data by editing itself :p)
 
Hmm never tried SDK before, but I noticed the 2nd portion is defined under canConstruct in CvGameUtils which will call the canBuildTemple function?

However, under the canBuildTemple function, I believe what it does is checking whether the building belongs to any of the listed groups, else return True. In other words, for any other buildings like Barracks, Statue of Liberty, it will return True to canConstruct? Then this means that the pCity can build those buildings regardless of whatever.
Even if there is already an existing Statue of Liberty, the pCity can still build, even if the player don't have prerequiste stuff like bonus, technology etc

Also, I am guessing
Code:
lBuildings = [dWars[x] for x in dWars.keys() if not x == eBuildingName]
for x in lBuildings:
       if pPlayer.countNumBuildings(x) >= 1: return False
return True
Checks if any of the other temples are built, return false so the city cannot build.
If none is built, return True, so since it does not check the named Temple itself, again returning true to canConstruct means, even if the player has a "Temple of Alaunus", it can still build another "Temple of Alaunus".

Lastly, usually I wouldn't use name or description to compare, since there can be various buildings/units/cities with similar names, but type is unique
 
The only thing I would say is that the canContruct callback is disabled by default which in your logic means everything cannot be built...

The Temple of Mars cannot be built twice by the same civ as it will follow the normal rules of being a national wonder, I think. And you are right about what everything means btw.

For example we have power code for the greeks:

Code:
def greece(ePlayer, eCivic):
        "Power of Democracy - Enables Universal Sufferage from the start"
        return ePlayer == pointer("Greece", playerID) and eCivic == eGreeceCivic

which is connected to this

Code:
	def canDoCivic(self,argsList):
		ePlayer = argsList[0]
		eCivic = argsList[1]
		return self.powers.greece(ePlayer, eCivic)

this code doesn't mean that everyother civic is not allowed or whatever, it works only with this exception. at least that is how I see it, feel free to correct me if I'm wrong :lol:


oh and good point about the names, however given that I
a) didn't think about that :lol:
and
b) I know there will never be another building with the same name

I think it should be fine...

Edit: I had to read what you said 3 times before the message really kicked in :lol:, I see what your are saying now, as everything else will return true... I will have to test it first but if you are right I think it is easily fixed by swapping to cannotConstruct and reversing the bools. However I don't think an abnormal effect like that could happen... could it? what do you think The J?

edit:edit: I think (not too sure though) that if I set the else to return -1 it will work without problem... because some other callbacks use -1 to not affect anything... will that work?

also to put my mind slightly at rest I found this code:

Code:
def isInvalidSite(ePlayer, tCoords):
        """
        Called from CvGameUtils.cannotFoundCity().
        Returns False if the city plot or any adjacent plot is found in the city name dictionary.
        Also always returns False if the call concerns the human player.
        Returns True by default if no conditions are met.
        """
        if ( instance(ePlayer) == human()
             or isHistoric(tCoords)
             or isHistoric(checkAdjacent(tCoords)) ):
                return False
        return True

if the place is historic allow founding, however this means a water tile could be historic and the settler could found there, evidently they can't. So surely the same logic is passed over.
 
If you are looking for some SDK code which allows you to say, in XML, that building X can't be built in cities that have building Y or Z then Afforess did stuff for it. You could look int his code in RAND it may help.
 
I found it out from experiments:

Spoiler :
Code:
## Window of the World Start ##
		eBuildingInfo = gc.getBuildingInfo(eBuilding)
		if isNationalWonderClass(eBuildingInfo.getBuildingClassType()):
			pPlayer = gc.getPlayer(pCity.getOwner())
			pTeam = gc.getTeam(pPlayer.getTeam())
			if pTeam.getProjectCount(gc.getInfoTypeForString("WINDOW_OF_WORLD")) == 1:
				if pPlayer.getBuildingClassCount(eBuildingInfo.getBuildingClassType()) == 1:
					return False
				if pCity.getProductionBuilding() != eBuilding:
					if pPlayer.getBuildingClassMaking(eBuildingInfo.getBuildingClassType()) > 0:
						return False
				if eBuildingInfo.isWater() and pCity.isCoastal(10) == false:
					return False
				if pTeam.isHasTech(eBuildingInfo.getPrereqAndTech()) == false:
					return False
				for i in range(0, gc.getNUM_BUILDING_AND_TECH_PREREQS()):
					if eBuildingInfo.getPrereqAndTechs(i) == -1:
						break
					elif pTeam.isHasTech(eBuildingInfo.getPrereqAndTechs(i)) == false:
						return False
				if pPlayer.getHighestUnitLevel() < eBuildingInfo.getUnitLevelPrereq():
					return False
				if pPlayer.getNumCities() < eBuildingInfo.getNumCitiesPrereq():
					return False	
				for iClass in range(gc.getNumBuildingClassInfos()):
					if pPlayer.getBuildingClassCount(iClass) < eBuildingInfo.getPrereqNumOfBuildingClass(iClass):
						return False
					if eBuildingInfo.isBuildingClassNeededInCity(iClass):
						iClassInfo = gc.getBuildingClassInfo(iClass)
						civBuilding = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(iClass)
						if pCity.getNumBuilding(civBuilding) == 0:
							return False
				return True
## Window of the World End ##
This code allows you to build any national wonder in the city provided all requirements met, but ignore national limit count.

If I simply write:
Spoiler :
Code:
	def canConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]

## Window of the World Start ##
		eBuildingInfo = gc.getBuildingInfo(eBuilding)
		if isNationalWonderClass(eBuildingInfo.getBuildingClassType()):
			return True
## Window of the World End ##

		return False
I can build a red cross even at stone age
 
problem with that is that is has to be:

A can't be built by a civ that already has X, Y, or Z

it's a national thing :crazyeye:
 
urg...

I am going to have to use cannotConstruct and make sure that it doesn't care about other buildings... HOW? :lol: as long as the -1 thing works it will be fine (but it most likely won't :rolleyes:)
 
Ok this I think would work better (confirmation needed on the can build multiple of the same wonder in a city though)

Code:
def canBuildTemple(eBuilding, pCity):
        """
        Works out whether a temple can be contructed based on whether another temple is already in place
        """
        #Determine type of building and get list of simmilar buildings, if applicable.
        eBuildingName = gc.getBuildingInfo(eBuilding).getDescription()
        if eBuildingName in dWars.keys():
                lBuildings = [dWars[x] for x in dWars.keys()] #if not x == eBuildingName]
        elif eBuildingName in dHammers.keys():
                lBuildings = [dHammers[x] for x in dHammers.keys()] #if not x == eBuildingName]
        elif eBuildingName in dHappy.keys():
                lBuildings = [dHappy[x] for x in dHappy.keys()] #if not x == eBuildingName]
        elif eBuildingName in dHealthy.keys():
                lBuildings = [dHealthy[x] for x in dHealthy.keys()] #if not x == eBuildingName]
        else:
                return False
        pPlayer = gc.getPlayer(pCity.getOwner())
        #check if other temples have been built
        for x in lBuildings:
                if pPlayer.countNumBuildings(x) >= 1: return True
        return False

and use cannotConstruct
 
Should be ok I guess.
Since it is defined under CannotConstruct, the multiple Wonders problems is solved as well.

As Dancing Hoskuld mentioned, I remembered ROM/AND has similar stuff with Copernicus, Leonardo and Newton I think where a city can only build one of them.
But that is done with extra XML tags.

Since this is regarding buildings, name comparison is still ok, but if you are going to do similar stuff for units and cities. I will say not advisable since you can rename units and cities
 
By the way, I am curious about one thing.
I haven't explored SDK yet, but I believe people usually compile tough programs there to replace tedious python codes for faster processing time?

But it looks like you are using python to call a SDK function, doesn't this defeat the purpose and make it as inefficient as using purely python? If so, you might as well just do the whole function under cannotConstruct and totally ignore SDK?
 
I can't do C++ :p this is all python :lol:

What makes you think it is C++?

I guess it's because We use loads of external modules to keep all the mods code in one place, therefore anything in the original python files will only ever have function calls in it...


edit: so you are saying that I can put the if not x == eBuildingName back in and it won't mean that multiples are built because the callback is different?
 
Top Bottom