Dancing Hoskuld
Deity
All the resources are at iConstApperance 100. It is supposed to be the chance it appears somewhere on the map.
I did have it at 24 but that had the same problem.
I did have it at 24 but that had the same problem.
int CvMapGenerator::calculateNumBonusesToAdd(BonusTypes eBonusType)
{
CvBonusInfo& pBonusInfo = GC.getBonusInfo(eBonusType);
// Calculate iBonusCount, the amount of this bonus to be placed:
int iRand1 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance1(), "calculateNumBonusesToAdd-1");
int iRand2 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance2(), "calculateNumBonusesToAdd-2");
int iRand3 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance3(), "calculateNumBonusesToAdd-3");
int iRand4 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance4(), "calculateNumBonusesToAdd-4");
int iBaseCount = pBonusInfo.getConstAppearance() + iRand1 + iRand2 + iRand3 + iRand4;
bool bIgnoreLatitude = GC.getGameINLINE().pythonIsBonusIgnoreLatitudes();
// Calculate iNumPossible, the number of plots that are eligible to have this bonus:
int iLandTiles = 0;
if (pBonusInfo.getTilesPer() > 0)
{
int iNumPossible = 0;
for (int iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
if (pPlot->canHaveBonus(eBonusType, bIgnoreLatitude))
{
iNumPossible++;
}
}
iLandTiles += (iNumPossible / pBonusInfo.getTilesPer());
}
int iPlayers = (GC.getGameINLINE().countCivPlayersAlive() * pBonusInfo.getPercentPerPlayer()) / 100;
int iBonusCount = (iBaseCount * (iLandTiles + iPlayers)) / 100;
iBonusCount = std::max(1, iBonusCount);
return iBonusCount;
}
Are you sure the entry is a percent chance? It could also be a "1 in n" probability, i.e. the higher the value the lower the chance.
Default code:
Code:int CvMapGenerator::calculateNumBonusesToAdd(BonusTypes eBonusType) { CvBonusInfo& pBonusInfo = GC.getBonusInfo(eBonusType); // Calculate iBonusCount, the amount of this bonus to be placed: int iRand1 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance1(), "calculateNumBonusesToAdd-1"); int iRand2 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance2(), "calculateNumBonusesToAdd-2"); int iRand3 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance3(), "calculateNumBonusesToAdd-3"); int iRand4 = GC.getGameINLINE().getMapRandNum(pBonusInfo.getRandAppearance4(), "calculateNumBonusesToAdd-4"); int iBaseCount = pBonusInfo.getConstAppearance() + iRand1 + iRand2 + iRand3 + iRand4; bool bIgnoreLatitude = GC.getGameINLINE().pythonIsBonusIgnoreLatitudes(); // Calculate iNumPossible, the number of plots that are eligible to have this bonus: int iLandTiles = 0; if (pBonusInfo.getTilesPer() > 0) { int iNumPossible = 0; for (int iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++) { CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(iI); if (pPlot->canHaveBonus(eBonusType, bIgnoreLatitude)) { iNumPossible++; } } iLandTiles += (iNumPossible / pBonusInfo.getTilesPer()); } int iPlayers = (GC.getGameINLINE().countCivPlayersAlive() * pBonusInfo.getPercentPerPlayer()) / 100; int iBonusCount = (iBaseCount * (iLandTiles + iPlayers)) / 100; iBonusCount = std::max(1, iBonusCount); return iBonusCount; }
The higher the ConstAppearance, the more to be placed.
I tried zero zero but got the same result.In unmodded Civ4, iGroupRange is rather a boolean it seems.
If iGroupRange is 0, iGroupRand is always 0.
If iGroupRange is 1, igroupRand is either 25 or 50. This is the percentage of how likely it is that there is another resource of this placed next to this one.
Your iGroupRange of 3 might screw some calculations.
Spoiler :Also, it might be an effect of the forum, but both tags should be at the same level than the others. However, I suppose that this doesn't really matter.
GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding
When actually playing you don't encounter this because then you aren't using a debug DLL. I don't know if you intentionally compiled a debug DLL (it's certainly useful when trying out new stuff), but for the final product you should select target=RELEASE in your IDE instead. Not only does this prevent assertions from being checked, it also has significantly better performance.
That is precisely what it warns about. If you look closer, it checks if the player in question can build the building.After some more investigation I concluded that this error always shows up when I try to enter the city screen of a city which contains a unique building belonging to a different civ, and when I try to hover over such a building once inside.
<TEXT>
<Tag>TXT_KEY_CIV_PHOENICIA_PEDIA</Tag>
<English>[TAB]Phoenicia was an ancient.....</English>
<French></French>
<German></German>
<Italian></Italian>
<Spanish></Spanish>
</TEXT>
<!---->
<!--
-->
</TEXT>
<TEXT>
<Tag>TXT_KEY_CIV_PHOENICIA_ADJECTIVE</Tag>
<English>Phoenician</English>
<French>Phoenician</French>
<German>Phoenician</German>
<Italian>Phoenician</Italian>
<Spanish>Phoenician</Spanish>
</TEXT>
<!-- My Comment-->
<TEXT>
<Tag>TXT_KEY_CIV_PHOENICIA_PEDIA</Tag>
<English>:) :) :) :):) :) :) :):) :) :) :):) :) :) :):) :) :) :)Phoenicia was....</English>
<French></French>
<German></German>
<Italian></Italian>
<Spanish></Spanish>
</TEXT>
Somehow that sounds wrong on so many levels. I figured you added some invisible character, which screws up everything, but looking with a hex editor, all the characters in that area are as they should be. Quite strange.But if I remove that one comment, my game crashes.
int iCultureMod = city.getCultureGreatPeopleRateModifier();
szBuffer.append(gDLL->getText("TXT_KEY_GREAT_PEOPLE_CULTURE", iCultureMod));
szBuffer.append(NEWLINE);
iModifier += iCultureMod;
1>CvGameTextMgr.obj : error LNK2019: unresolved external symbol "public: int __thiscall CvCity::getCultureGreatPeopleRateModifier(void)const " (?getCultureGreatPeopleRateModifier@CvCity@@QBEHXZ) referenced in function "public: void __thiscall CvGameTextMgr:arseGreatPeopleHelp(class CvWStringBuffer &,class CvCity &)" (?parseGreatPeopleHelp@CvGameTextMgr@@QAEXAAVCvWStringBuffer@@AAVCvCity@@@Z)
1>Debug\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
int getCultureGreatPeopleRateModifier() const;
I really need to debug this. It makes absolutely no sense to me, though it's good that you figured out how to avoid the crash.In the file, I noticed that the English entry of the tag "TXT_KEY_CIV_GENOA_PEDIA" (line 1058) was actually occupying two lines. Fixing this and the game loads fine (without of course adding back the "My comment").
PS: needless to say that I have no idea why adding "My comment" in the first place could have helped the loading of this file!