Afforess
The White Wizard
Okay, I recompiled and loaded it. I saw about 30-40 messages, for each civic with a modifier. I never saw the "Skipping" message.
No. I'll try that.No. xienwolf's description seems to match the code we've got at this point. Have you tried running this using a debug DLL?
Do you still have value-setting code that ignores the XML values? If not, what XML values do you have specified? You gotta figure out from the evidence what's going wrong. What can you generalize from those test cases? Are they repeatable? Do they happen the same way every time you try them?
It will only say the target civic name because that's what appears in the XML. We could change the debug output to say the source civic name, but it looks like it's reading the XML fine.
Hmm, "25" looks suspicious because that's the number of civics, so there is no civic with that ID (0 to 24). Does your testing mod have extra civics? If so then the XML looks fine.
Do the Python accessors return correct values now?
if (m_piCivicAttitudeChanges)
{
for ( int i = 0; i < GC.getNumCivicInfos(); i++ )
{
if ( m_piCivicAttitudeChanges[i] == iDefault )
{
m_piCivicAttitudeChanges[i] = pClassInfo->getCivicAttitudeChange(i);
}
}
}
iI and iJ are index's, correct?
Why is applying the opposite effect if I don't have that civic combo?
Noncopydefaults and Noncopydefaultsreadpass2 are basically the same function now, yes.
I don't understand this question. Paste the latest code for the function that calculates the attitude value for two players please.
int CvPlayerAI::AI_getCivicAttitudeChange(PlayerTypes ePlayer) const
{
int iAttitude = 0;
// add modifier for every combination of civics between the two players
for (int iI = 0; iI < GC.getNumCivicOptionInfos(); iI++)
{
for (int iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
iAttitude += GC.getCivicInfo(getCivics((CivicOptionTypes)iI)).getCivicAttitudeChange(GET_PLAYER(ePlayer).getCivics((CivicOptionTypes)iJ));
}
}
return iAttitude;
}
That concerns me a bit. I wonder if copyNonDefaults() goes with readPass2() and copyNonDefaultsReadPass2() goes with readPass3() because the first read pass doesn't need any copying since there's no previously-read data to copy over. Try putting "return" as the first line of copyNonDefaultsReadPass2() and see if it makes a difference (if it returns a value, return the same value up top).
int CvPlayerAI::AI_getCivicAttitudeChange(PlayerTypes ePlayer) const
{
int iAttitude = 0;
// add modifier for every combination of civics between the two players
for (int iI = 0; iI < GC.getNumCivicOptionInfos(); iI++)
{
CivicOptionTypes eCivicOption = GC.getCivicInfo(getCivics((CivicOptionTypes)iI));
[COLOR="Red"] int iJunk = 0;[/COLOR]
for (int iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
iAttitude += eCivicOption.getCivicAttitudeChange(GET_PLAYER(ePlayer).getCivics((CivicOptionTypes)iJ));
}
}
return iAttitude;
}