A new civ…and some questions (some of which involve C++)

antaine

King
Joined
Aug 1, 2005
Messages
737
A new civ…and some questions (some of which involve C++)

Alright, so…I'm taking what I learned doing RFC with Celts and realizing that making the Celts playable really should never have been the project. In addition, there are some things that didn't work right which I attribute to taking the existing minor civ and trying to make it into a major one.

Not only that, but the Celts never pulled together in a strong unified empire or kingdom (a "Celtia," if you will).

So here's my next project and what I believe the first project SHOULD have been.

I'm adding the Irish to RFC. They will take the place of the Khmer. I've created a new flag for them, a new UU and UB and three new UHVs. All of that has gone rather swimmingly. I do have one issue, however, in that the new building replaces the amphitheater (colosseum)…I can't seem to adjust the functioning to produce +1 happiness for every 10% culture rather than 20% culture...

But my real problem is the UP. Now, the first thing I need to do is to kill the old Khmer UP of walking through jungles. I see where the header of the UniquePowers.py file directs me to CvUnit::canMoveInto() . I've commented the following lines, but haven't recompiled yet. Is this correct?

//Rhye - start UP (Khmer)
//return false;
//if (getOwnerINLINE() == KHMER && pPlot->getFeatureType() == 1)
//return true;
//else
//return false;
//Rhye - end

That aside, I now need a new UP. I had toyed with the idea of one similar to Arabia in which all three religious buildings would be built for the state religion upon city capture or founding. Aside from the fact that I haven't quite been able to get that to work, I'd like something a little more original.

Pursuant to Khmer's original UP of special tile properties, I'm thinking an appropriate UP for Ireland would be +1 hammer per coast tile. I'm almost dead positive that needs to be done in C++ (CvPlot, I assume), which I'm willing to do if someone will point me in the right direction (but I'd welcome a python way!).

NEW IDEAS WELCOME

I'm also open to other UP ideas that would be appropriate for the Irish, although given their geography, most of their cities' tiles will be coast (three cities, small island), and so the extra hammers would help with actually building stuff.


NOW FOR THE SIMPLE QUESTION:

I've designed a new button to go with the new flag, harp.dds to replace khmer.dds. Unfortunately, the old symbol still shows up with the civilopedia entries and in the relationship advisor screen. I must be missing a file where I need to change a call for "khmer.dds" to "harp.dds"…anybody know where that stuff is?
 
true to form...after three days of banging my head against the wall, I've managed to fix the button problem upon posting the question...but everything else is still vexing me.

Thanks in advance for your help...
 
Whatever you do, please get rid of iron and coal from Ireland (not really true to life and one reason why Ireland didn't have an Industrial Revolution, per Wikipedia).
How about the power of emigration: population leaves from time to time to the New World cities you have when you're less than stable.
 
Well, my C++ is suuuuuuper basic...the emigration thing might work if I can figure out how to do it in python.

I included coal because Ireland is very rich in peat, which is unfortunately not represented at all in the resources. Since peat is on its way to becoming coal, and is used for the same purposes, it seemed appropriate, although it really should have been located in the south west, despite being found throughout the country.

According to G. Phillips Bevan in The Industrial Resources of Ireland, a report read before the Statistical Society in 1881, both coal and iron ore mining were present (as well as copper and lead).
 
as an interim attempt, I'm trying to compile this right now...am I going in the right direction to add a hammer to coast tiles?

in CvPlot, right after the Incan UP which makes mountains worth two food and one hammer, I put this...the code is identical except for where I changed isPeak to isCoast...I would think that the only problem I might encounter is if it needed to be placed in a certain part of the file, instead of immediately following the Incan UP...

//Antaine - start UP
if (isCoast())
{
if (eTeam == KHMER)
return 0 + GC.getYieldInfo(eYield).getLakeChange() + GC.getYieldInfo(eYield).getLakeChange() + GC.getYieldInfo(eYield).getHillsChange() + GC.getYieldInfo(eYield).getLakeChange();
else
return 0;
}
//Antaine - end UP
 
alright...so apparently it didn't know what to do with isCoast, so I had to change it to isWater ...but I couldn't tell if isWater will be read as "Ocean" or "Ocean or Coast"...

...recompiling...
 
here's what I have for the new building xml. For some reason, when I look it up in the civilopedia, it still says 1 happiness for every 20% culture. Have I done this correctly? I wanted to increase that as this is the civ's unique building. (Honestly, I'd love to decrease the culture rate so that it's 1 happiness for every 10% culture, but I'd settle for it either way)

<BuildingInfo>
<BuildingClass>BUILDINGCLASS_COLOSSEUM</BuildingClass>
<Type>BUILDING_KHMER_BARAY</Type>
<SpecialBuildingType>NONE</SpecialBuildingType>
<Description>Irish Pub</Description>
<Civilopedia>The Public House or Pub has traditionally been at the center of Irish social life. They provided a meeting place for friends and family as well as political and revolutionary organizations. In addition to alcoholic beverages, one could frequently find camraderie, music, entertainment and a hot meal. While perhaps not as influential a building as the ancient scriptoria, the pub is an important, and perhaps the most recognizable, fixture in the social life of an Irish town.</Civilopedia>
<Strategy>TXT_KEY_BUILDING_KHMER_BARAY_STRATEGY</Strategy>
<Advisor>ADVISOR_ECONOMY</Advisor>
<ArtDefineTag>ART_DEF_BUILDING_JAIL</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_CONSTRUCTION</PrereqTech>
<TechTypes/>
<Bonus>NONE</Bonus>
<PrereqBonuses/>
<!-- Rhye -->
<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>50</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iConquestProb>66</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>
<!-- Rhye -->
<iHealth>1</iHealth>
<iAreaHealth>0</iAreaHealth>
<iGlobalHealth>0</iGlobalHealth>
<iHappiness>4</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>5</iAsset>
<iPower>0</iPower>
<fVisibilityPriority>1.0</fVisibilityPriority>
<SeaPlotYieldChanges/>
<RiverPlotYieldChanges/>
<GlobalSeaPlotYieldChanges/>
<YieldChanges/>
<CommerceChanges/>
<ObsoleteSafeCommerceChanges/>
<CommerceChangeDoubleTimes/>
<CommerceModifiers/>
<GlobalCommerceModifiers/>
<SpecialistExtraCommerces/>
<StateReligionCommerces/>
<CommerceHappinesses>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>5</iCommerce>
</CommerceHappinesses>
<ReligionChanges/>
<SpecialistCounts/>
<FreeSpecialistCounts/>
<CommerceFlexibles/>
<CommerceChangeOriginalOwners/>
<ConstructSound>AS2D_BUILD_COLOSSEUM</ConstructSound>
<BonusHealthChanges/>
<BonusHappinessChanges>
<BonusHappinessChange>
<BonusType>BONUS_WINE</BonusType>
<iHappinessChange>1</iHappinessChange>
</BonusHappinessChange>
</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>
 
ABOUT THE UP

so...what I did compiled correctly, but made the water tiles for khmer equal two food and one production, and 0 for everyone else. I realized this is exactly what I would expect, considering the model I used was for mountains. I think I've got it working correctly by melding the principles behind the Incan and Malinese UPs

//Antaine - start UP
if (isWater())
{
if (eTeam == KHMER)
return 0 + GC.getBonusInfo((BonusTypes)2).getYieldChange(eYield) + GC.getBonusInfo((BonusTypes)15).getYieldChange(eYield) + GC.getBonusInfo((BonusTypes)21).getYieldChange(eYield) + GC.getBonusInfo((BonusTypes)21).getYieldChange(eYield);
else
return 0 + GC.getBonusInfo((BonusTypes)15).getYieldChange(eYield) + GC.getBonusInfo((BonusTypes)21).getYieldChange(eYield) + GC.getBonusInfo((BonusTypes)21).getYieldChange(eYield);
}
//Antaine - end UP
 
as for the pub, I have successfully raised the base happy improvement, so I think that's a sufficient bonus for a UB without altering the culture:happiness ratio.

I have just now noticed that the button for the Khmer embassy is still the old khmer symbol...but I'm not sure where the command is to change that button in the city build menu as well as the civilopedia.

Other than that, I'll try tomorrow to test the UHVs and perhaps toy with the resources, and if they work, this mod is basically done.
 
will do.

I've got two of the three UHVs working. The one that doesn't, I just don't understand why.

Here's the full Irish (Khmer) uhv code:

elif (iPlayer == iKhmer):
if (pKhmer.isAlive()):

if (iGameTurn <= i1500AD):
bEngland = False
if (self.getGoal(iKhmer, 0) == -1):
bEngland = self.checkOwnedCiv(iKhmer, iEngland)
if (bEngland):
self.setGoal(iKhmer, 0, 1)
else:
if (self.getGoal(iKhmer, 0) == -1):
self.setGoal(iKhmer, 0, 0)


if (iGameTurn <= i1500AD):
if (self.getGoal(iKhmer, 0) == -1):
iCounterChristianMonastery = 0
iCounterLibrary = 0
cityList = PyPlayer(iKhmer).getCityList()
for city in cityList:
if (city.hasBuilding(con.iChristianMonastery)):
iCounterChristianMonastery += 1
if (city.hasBuilding(con.iLibrary)):
iCounterLibrary += 1
## if (not city.isConnectedToCapital(iKhmer)):
## bConditions = False
if (iCounterChristianMonastery >= 5 and iLibrary >= 5):
self.setGoal(iKhmer, 1, 1)
if (iGameTurn == i1500AD+1):
if (self.getGoal(iKhmer, 0) == -1):
self.setGoal(iKhmer, 1, 0)

#bestCity = self.calculateTopCityPopulation(102, 34) #if (bestCity != -1):
# if (bestCity.getOwner() == iKhmer and bestCity.getX() == 102 and bestCity.getY() == 34):
# self.setGoal(iKhmer, 1, 1)
# else:
# self.setGoal(iKhmer, 1, 0)


if (self.getGoal(iKhmer, 2) == -1):
religionPercent = gc.getGame().calculateReligionPercent(con.iChristianity)
#print ("religionPercent", religionPercent)
if (religionPercent >= 40.0):
self.setGoal(iKhmer, 2, 1)

Now, the one with building the buildings (modeled on rome) works, and the one with spreading the religion (modeled on arabia) works. The one about controlling england, modeled on mongolia, does not work when england is either vassalized or conquered. The mongolian code is identical save that I replaced "mongolia" with "khmer" and "china" with "england." I know I must be missing something somewhere, but I just don't know where. There are no python exceptions from my code, either...it just always shows "not yet"...
 
alright, I think I've got it now...just a little more toying around to make sure, and then I'll probably be posting the file for the whole thing later tonight/tomorrow
 
Back
Top Bottom