[8019]
Just noticed that hidden nationality units can attack adjacent ship when trying to enter transport ship at same tile.
Not all of them but many.
I fixed a few odd things and bugs in them like true and false should be True and False.
WoC has no way to fix this because the TECH_MOUNTAINEERING exists even if you don't have the Useable Mountains option on.
<BuildingInfo>
<BuildingClass>BUILDINGCLASS_SLAUGHTERHOUSE</BuildingClass>
<Type>BUILDING_SLAUGHTERHOUSE</Type>
<SpecialBuildingType>NONE</SpecialBuildingType>
<Description>TXT_KEY_BUILDING_SLAUGHTERHOUSE</Description>
<Civilopedia>TXT_KEY_BUILDING_SLAUGHTERHOUSE_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_SLAUGHTERHOUSE_STRATEGY</Strategy>
<Advisor>ADVISOR_ECONOMY</Advisor>
<ArtDefineTag>ART_DEF_BUILDING_SLAUGHTERHOUSE</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>NONE</MaxStartEra>
<ObsoleteTech>NONE</ObsoleteTech>
<PrereqTech>TECH_COOKED_FOOD</PrereqTech>
<TechTypes>
<PrereqTech>TECH_SHELTER_BUILDING</PrereqTech>
</TechTypes>
<Bonus>NONE</Bonus>
<PrereqBonuses>
<Bonus>BONUS_CARCASS</Bonus>
<Bonus>BONUS_PELTS</Bonus>
<Bonus>BONUS_POULTRY</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>NONE</GreatPeopleUnitClass>
<iGreatPeopleRateChange>0</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>25</iCost>
<iHurryCostModifier>100</iHurryCostModifier>
<iAdvancedStartCost>-1</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iConquestProb>50</iConquestProb>
<iCitiesPrereq>0</iCitiesPrereq>
<iTeamsPrereq>0</iTeamsPrereq>
<iLevelPrereq>0</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>0</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>0</iAsset>
<iPower>0</iPower>
<fVisibilityPriority>0.0</fVisibilityPriority>
<SeaPlotYieldChanges/>
<RiverPlotYieldChanges/>
<GlobalSeaPlotYieldChanges/>
<YieldChanges>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</YieldChanges>
<CommerceChanges>
<iCommerce>1</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
</CommerceChanges>
<ObsoleteSafeCommerceChanges>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
</ObsoleteSafeCommerceChanges>
<CommerceChangeDoubleTimes/>
<CommerceModifiers/>
[B][COLOR="Red"] <TechYieldModifiers>
<TechYieldModifier>
<PrereqTech>TECH_STANDARDIZATION</PrereqTech>
<TechYield>
<iYield>5</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</TechYield>
</TechYieldModifier>
</TechYieldModifiers>[/COLOR][/B]
<GlobalCommerceModifiers/>
<SpecialistExtraCommerces/>
<StateReligionCommerces/>
<CommerceHappinesses/>
<ReligionChanges/>
<SpecialistCounts/>
<FreeSpecialistCounts/>
<CommerceFlexibles/>
<CommerceChangeOriginalOwners/>
<ConstructSound/>
<BonusHealthChanges/>
<BonusHappinessChanges/>
<BonusProductionModifiers/>
<UnitCombatFreeExperiences/>
<DomainFreeExperiences/>
<DomainProductionModifiers/>
<BuildingHappinessChanges/>
<PrereqOrBuildingClasses>
<PrereqOrBuildingClass>
<BuildingClassType>BUILDINGCLASS_STORAGE_PIT</BuildingClassType>
<bPrereqBuildingClass>1</bPrereqBuildingClass>
</PrereqOrBuildingClass>
<PrereqOrBuildingClass>
<BuildingClassType>BUILDINGCLASS_BARTER_POST</BuildingClassType>
<bPrereqBuildingClass>1</bPrereqBuildingClass>
</PrereqOrBuildingClass>
<PrereqOrBuildingClass>
<BuildingClassType>BUILDINGCLASS_VIKING_TRADING_POST</BuildingClassType>
<bPrereqBuildingClass>1</bPrereqBuildingClass>
</PrereqOrBuildingClass>
<PrereqOrBuildingClass>
<BuildingClassType>BUILDINGCLASS_SHOPPING_DISTRICT</BuildingClassType>
<bPrereqBuildingClass>1</bPrereqBuildingClass>
</PrereqOrBuildingClass>
</PrereqOrBuildingClasses>
<SpecialistYieldChanges/>
<BonusYieldModifiers/>
<ImprovementFreeSpecialists/>
<Flavors/>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
</BuildingInfo>
Except that true is a global defined as True and the same with false as False. Not that it matters really, it is just going to be a pain merging it with my working files since I was working on a number of files all over the place.
@albert
Actually, none of these odd stuff or bugs which you fix are bugs.
They are all valid expressions for python.
if [B]ppCity.getNumActiveBuilding(gi_Topkapi) == true[/B]:
gi_Topkapi_IsActive = true
pCity.changeFreeBonus([B]bonusinfo.GetType()[/B],1)
pCity.changeFreeBonus(bonusinfo,1)
Re: Geology/Mountaineering
WoC is not going to work anyway because the techs, buildings etc are loaded before you get to the custom options screen. You would need to check the options and start a game then exit and start again for it change anything. I have not checked that this is the case for the advance economy techs etc as I never have them on so the techs are not there and clicking the option does not put them there.
We really need a parameter screen before everything that shows all the options and tells you that you need to restart to get those options active.
if X == True:
Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. The following values are considered false:
None
False
zero of any numeric type, for example, 0, 0L, 0.0, 0j.
any empty sequence, for example, '', (), [].
any empty mapping, for example, {}.
instances of user-defined classes, if the class defines a __nonzero__() or __len__() method, when that method returns the integer zero or bool value False. [1]
All other values are considered true — so objects of many types are always true.
if 5 == True:
It must be fixed in the dll because and it affects all the techs with GameOption prereqs. I already posted the changes for CvPlayer::canResearch and every other place with simmilar code must be changed in the same way.
But with that fix it could be possible that techs with only GameOption dependent prereq techs end up without any prereq tech.
for (iI = 0; iI < GC.getNUM_AND_TECH_PREREQS(); iI++)
{
TechTypes ePrereq = (TechTypes)GC.getTechInfo(eTech).getPrereqAndTechs(iI);
if (ePrereq != NO_TECH && canEverResearch(ePrereq))
You are right that getNumActiveBuilding will always return an integer.
But there is nothing wrong with
where X is any integerCode:if X == True:
In python, anything can be used to do a boolean comparison.
In short, even
is a valid expression.Code:if 5 == True:
As for changeFreeBonus, the first input should be the Bonus ID.
Neither CyBonusInfo().getType() nor CyBonusInfo() should be used as the input.
P.S.
I do have experience with python modding, but there is no one who is always right.
People learn through experience.
reposting since it got lost
SVN 8014, bug may be in newer SVN's as well
At the moment i have an enemy naval unit stationed on top of a sea tunnel and fishing boat, when i try to attack said Naval unit it is unattackable, this is at the moment happening in 2 separate instances, as if the naval unit was on land.
If i try to attack it with a land unit moving into the sea tunnel it does not work either.