CornPlanter
Emperor
I get this error message:
Failed Loading XML file xml\Civilizations/CIV4TraitInfos.xml
However I didn't touch this file at all. I didn't even copy it to my CustomAssets directory (I did copy it after just in a case to see if it solves the problem. It does not).
The problem must be in SDK... Here is what I've changed:
CvInfos.cpp
CvInfos.h
CvPlayerAI.cpp
CvPlayerAI.h
CvGameTextMgr.cpp
Compiled using Visual C++ 2005 express edition with makefile.
Failed Loading XML file xml\Civilizations/CIV4TraitInfos.xml
However I didn't touch this file at all. I didn't even copy it to my CustomAssets directory (I did copy it after just in a case to see if it solves the problem. It does not).
The problem must be in SDK... Here is what I've changed:
CvInfos.cpp
Spoiler :
Code:
CvLeaderHeadInfo::CvLeaderHeadInfo() :
m_iAlignment(0),
m_iWonderConstructRand(0),
.......
int CvLeaderHeadInfo::getSameReligionAttitudeChange() const
{
return m_iSameReligionAttitudeChange;
}
int CvLeaderHeadInfo::getAlignment() const
{
return m_iAlignment;
}
void CvLeaderHeadInfo::setAlignment(int i)
{
m_iAlignment = i;
}
int CvLeaderHeadInfo::getSameReligionAttitudeDivisor() const
{
return m_iSameReligionAttitudeDivisor;
}
.......
stream->Read(&m_iDifferentReligionAttitudeChangeLimit);
stream->Read(&m_iAlignment);
stream->Read(&m_iBonusTradeAttitudeDivisor);
.......
stream->Write(m_iDifferentReligionAttitudeChangeLimit);
stream->Write(m_iAlignment);
stream->Write(m_iBonusTradeAttitudeDivisor);
......
pXML->GetChildXmlValByName(&m_iDifferentReligionAttitud eChangeLimit, "iDifferentReligionAttitudeChangeLimit");
pXML->GetChildXmlValByName(&m_iAlignment, "iAlignment");
pXML->GetChildXmlValByName(&m_iBonusTradeAttitudeDiviso r, "iBonusTradeAttitudeDivisor");
CvInfos.h
Spoiler :
Code:
DllExport int getDifferentReligionAttitudeChangeLimit() const;
DllExport int getAlignment() const;
DllExport void setAlignment(int i);
DllExport int getBonusTradeAttitudeDivisor() const;
......
int m_iDifferentReligionAttitudeChangeLimit;
[B]int m_iAlignment;[/B]
int m_iBonusTradeAttitudeDivisor;
CvPlayerAI.cpp
Spoiler :
Code:
[B]int CvPlayerAI::AI_getAlignmentAttitude(PlayerTypes ePlayer)
{
int iAttitude;
iAttitude = 0;
if (GC.getLeaderHeadInfo(getPersonalityType()).getAli gnment() > 0)
{
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() < 0)
{
iAttitude = -3;
}
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() == 0)
{
iAttitude = 1;
}
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() > 0)
{
iAttitude = 4;
}
}
else if (GC.getLeaderHeadInfo(getPersonalityType()).getAli gnment() == 0)
{
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() < -80)
{
iAttitude = -3;
}
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() < 80 && GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerson alityType()).getAlignment() > -80)
{
iAttitude = 1;
}
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() > 80)
{
iAttitude = -2;
}
}
else if (GC.getLeaderHeadInfo(getPersonalityType()).getAli gnment() < 0)
{
if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() < 0)
{
iAttitude = 2;
}
else if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() == 0)
{
iAttitude = -1;
}
else if (GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPerso nalityType()).getAlignment() > 0)
{
iAttitude = -3;
}
}
return iAttitude;
}[/B]
......
iAttitude += AI_getRivalTradeAttitude(ePlayer);
[B]iAttitude += AI_getAlignmentAttitude(ePlayer);[/B]
CvPlayerAI.h
Spoiler :
Code:
int AI_getDifferentReligionAttitude(PlayerTypes ePlayer);
int AI_getAlignmentAttitude(PlayerTypes ePlayer);
int AI_getBonusTradeAttitude(PlayerTypes ePlayer);
CvGameTextMgr.cpp
Spoiler :
Code:
iAttitudeChange = GET_PLAYER(ePlayer).AI_getAlignmentAttitude(eTarge tPlayer);
if ((iPass == 0) ? (iAttitudeChange > 0) : (iAttitudeChange < 0))
{
if (GC.getLeaderHeadInfo(GET_PLAYER(eTargetPlayer).ge tPersonalityType()).getAlignment() > 0)
{
szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange > 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"), gDLL->getText("TXT_KEY_MISC_ATTITUDE_GOOD_ALIGNMENT", iAttitudeChange).GetCString());
szBuffer.append(NEWLINE);
szBuffer.append(szTempBuffer);
}
else if (GC.getLeaderHeadInfo(GET_PLAYER(eTargetPlayer).ge tPersonalityType()).getAlignment() < 0)
{
szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange > 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"), gDLL->getText("TXT_KEY_MISC_ATTITUDE_EVIL_ALIGNMENT", iAttitudeChange).GetCString());
szBuffer.append(NEWLINE);
szBuffer.append(szTempBuffer);
}
else
{
szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange > 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"), gDLL->getText("TXT_KEY_MISC_ATTITUDE_NEUTRAL_ALIGNMENT" , iAttitudeChange).GetCString());
szBuffer.append(NEWLINE);
szBuffer.append(szTempBuffer);
}
}
Compiled using Visual C++ 2005 express edition with makefile.