1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Artifacts Home World.

Discussion in 'Civ4 - MOO2Civ' started by Deon, Mar 12, 2010.

  1. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    As you may notice, I want to become a part of MOO2Civ dev team too :).

    In MOO2Civ/Assets/Python/ replace the whole "def addBasicBuildingsToBestPlanet(pSystem)" block with:

    Code:
    def addBasicBuildingsToBestPlanet(pSystem):
    	
    	pPlot = CyMap().plot(pSystem.getX(), pSystem.getY())
    	pCity = pPlot.getPlotCity()
    	pPlayer = gc.getPlayer(pCity.getOwner())
    	iCiv = pPlayer.getCivilizationType()
    	
    	iNutritionFacility = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_NUTRITION_FACILITY')
    	iMiningFacility = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_MINING_FACILITY')
    	iArtifacts = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_ARTIFACTS')
    	
    	pCity.setNumRealBuilding(iNutritionFacility, pCity.getNumRealBuilding(iNutritionFacility) + 1)
    	pCity.setNumRealBuilding(iMiningFacility, pCity.getNumRealBuilding(iMiningFacility) + 1)
    	
    	iBestPlanetIndex = getBestPlanetInSystem(pSystem)
    	
    	# Free buildings on the homeworld
    	pPlanet = pSystem.getPlanetByIndex(iBestPlanetIndex)
    	pPlanet.setHasBuilding(iNutritionFacility, true)
    	pPlanet.setHasBuilding(iMiningFacility, true)
    	if (iCiv == gc.getInfoTypeForString('CIVILIZATION_ALKARI') and pCity.isCapital()):
    		pCity.setNumRealBuilding(iArtifacts, pCity.getNumRealBuilding(iArtifacts) + 1)
    		pPlanet.setHasBuilding(iArtifacts, true)
    Then add a building to Civ4BuildingInfos.xml :
    Code:
    		<BuildingInfo>
    			<BuildingClass>BUILDINGCLASS_ARTIFACTS</BuildingClass>
    			<Type>BUILDING_ARTIFACTS</Type>
    			<SpecialBuildingType>NONE</SpecialBuildingType>
    			<Description>TXT_KEY_BUILDING_ARTIFACTS</Description>
    			<Civilopedia>TXT_KEY_BUILDING_ARTIFACTS_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_ARTIFACTS_STRATEGY</Strategy>
    			<Help/>
    			<Advisor>ADVISOR_SCIENCE</Advisor>
    			<ArtDefineTag>ART_DEF_BUILDING_UNIVERSITY</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_COMPUTERS_10_AUTOLAB</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>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>1</bNeverCapture>
    			<bNukeImmune>0</bNukeImmune>
    			<bPrereqReligion>0</bPrereqReligion>
    			<bCenterInCity>0</bCenterInCity>
    			<iAIWeight>0</iAIWeight>
    			<iCost>-1</iCost>
    			<iHurryCostModifier>0</iHurryCostModifier>
    			<iAdvancedStartCost>0</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMinAreaSize>-1</iMinAreaSize>
    			<iConquestProb>100</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>4</iAsset>
    			<iPower>0</iPower>
    			<fVisibilityPriority>1.0</fVisibilityPriority>
    			<SeaPlotYieldChanges/>
    			<RiverPlotYieldChanges/>
    			<GlobalSeaPlotYieldChanges/>
    			<YieldChanges/>
    			<CommerceChanges>
    				<iCommerce>0</iCommerce>
    				<iCommerce>4</iCommerce>
    			</CommerceChanges>
    			<ObsoleteSafeCommerceChanges/>
    			<CommerceChangeDoubleTimes/>
    			<CommerceModifiers/>
    			<GlobalCommerceModifiers/>
    			<SpecialistExtraCommerces/>
    			<StateReligionCommerces/>
    			<CommerceHappinesses/>
    			<ReligionChanges/>
    			<SpecialistCounts/>
    			<FreeSpecialistCounts/>
    			<CommerceFlexibles/>
    			<CommerceChangeOriginalOwners/>
    			<ConstructSound>AS2D_BUILD_UNIVERSITY</ConstructSound>
    			<BonusHealthChanges/>
    			<BonusHappinessChanges/>
    			<BonusProductionModifiers/>
    			<UnitCombatFreeExperiences/>
    			<DomainFreeExperiences/>
    			<DomainProductionModifiers/>
    			<BuildingHappinessChanges/>
    			<PrereqBuildingClasses/>
    			<BuildingClassNeededs/>
    			<SpecialistYieldChanges/>
    			<BonusYieldModifiers/>
    			<ImprovementFreeSpecialists/>
    			<Flavors/>
    			<HotKey/>
    			<bAltDown>0</bAltDown>
    			<bShiftDown>0</bShiftDown>
    			<bCtrlDown>0</bCtrlDown>
    			<iHotKeyPriority>0</iHotKeyPriority>
    		</BuildingInfo>
    and finally to Civ4BuildingClassInfos :

    Code:
    		<BuildingClassInfo>
    			<Type>BUILDINGCLASS_ARTIFACTS</Type>
    			<Description>TXT_KEY_BUILDING_ARTIFACTS</Description>
    			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
    			<iMaxTeamInstances>-1</iMaxTeamInstances>
    			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
    			<iExtraPlayerInstances>0</iExtraPlayerInstances>
    			<bNoLimit>0</bNoLimit>
    			<bMonument>0</bMonument>
    			<DefaultBuilding>BUILDING_ARTIFACTS</DefaultBuilding>
    			<VictoryThresholds/>
    		</BuildingClassInfo>
    
    Enjoy ;).
     
  2. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,048
    Location:
    In orbit
    Well, I welcome anyone to contributes and this definitely looks like a nice contribution. ;)
     
  3. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    Does it mean that I'm in? Do you accept me as your friend, master? :D :D :D

    Jk.

    I have a lot of other ideas. I will test them in my Starcraft project and if they work I will post them here.
     
  4. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,048
    Location:
    In orbit
    Feel free. :goodjob:

    :lol: Ofcourse (you have been on the credits list ever since your leaderheads additions were included in patch4). :yup:
     
  5. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    I just want to be a bit more active and useful :).
     
  6. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,048
    Location:
    In orbit
    So I noticed. ;) (I'd been wondering where'd you'd gone after that LH contribution.)
     
  7. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    As usual, from time to time I realize that I have a wife and a son and I have to earn money and spend all my lifetime with the family etc... and after a while I realize that I need to play some game and mod to be happy, and here I am again :D.
     
  8. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    I've updated the first post. I forgot to add an increment to the numbers of buildings in the city.
    Code:
    pCity.setNumRealBuilding(iArtifacts, pCity.getNumRealBuilding(iArtifacts) + 1)
    
    Now it's right. Use the current code please.
     

Share This Page