Advanced Diplomacy 2

@Orion. I'm not sure about the diplomacy options.

Testing shows that you can conduct trades for tech, resources and cities, without first establishing an embassy. This is very good, as the historian would have had a major problem with the mod, if an embassy was required to trade for those items. The mod is realistic and therefore, will make a fine addition to the next version of OGI.

Thanks for your hard work in expanding this mod.
 
Also, stolenrays, this is really being anal, but you can also remove the CONTACT_SECRETARY_GENERAL_VOTE and CONTACT_TRADE_CORPORATION from CvEnums.h, CvInfos.cpp, CyEnumsInterfaces.cpp and the GlobalTypes.XML. A harmless assert throws up if you don't do this, because the list in CvLeaderHeadsInfos.XML doesn't match the GlobalTypes.

What I did was add in the missing CONTACT_SECRETARY_GENERAL_VOTE and CONTACT_TRADE_CORPORATION to CIV4LeaderHeadInfos


<!-- Afforess Advanced Diplomacy-->
<ContactRand>
<ContactType>CONTACT_PEACE_PRESSURE</ContactType>
<iContactRand>100</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_EMBASSY</ContactType>
<iContactRand>25</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_STOP_TRADING</ContactType>
<iContactRand>20</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_JOIN_WAR</ContactType>
<iContactRand>10</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_SECRETARY_GENERAL_VOTE</ContactType>
<iContactRand>10</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_MILITARY_UNITS</ContactType>
<iContactRand>15</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_WORKERS</ContactType>
<iContactRand>25</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_CONTACTS</ContactType>
<iContactRand>25</iContactRand>
</ContactRand>
<ContactRand>
<ContactType>CONTACT_TRADE_CORPORATION</ContactType>
<iContactRand>25</iContactRand>
</ContactRand>
<!-- Afforess Advanced Diplomacy-->


<!-- Afforess Advanced Diplomacy-->
<ContactDelay>
<ContactType>CONTACT_PEACE_PRESSURE</ContactType>
<iContactDelay>100</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_EMBASSY</ContactType>
<iContactDelay>25</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_STOP_TRADING</ContactType>
<iContactDelay>20</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_JOIN_WAR</ContactType>
<iContactDelay>20</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_SECRETARY_GENERAL_VOTE</ContactType>
<iContactDelay>15</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_MILITARY_UNITS</ContactType>
<iContactDelay>20</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_WORKERS</ContactType>
<iContactDelay>20</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_CONTACTS</ContactType>
<iContactDelay>15</iContactDelay>
</ContactDelay>
<ContactDelay>
<ContactType>CONTACT_TRADE_CORPORATION</ContactType>
<iContactDelay>20</iContactDelay>
</ContactDelay>
<!-- Afforess Advanced Diplomacy-->


<!--Afforess Advanced Diplomacy-->
<ContactType>CONTACT_PEACE_PRESSURE</ContactType>
<ContactType>CONTACT_EMBASSY</ContactType>
<ContactType>CONTACT_TRADE_STOP_TRADING</ContactType>
<ContactType>CONTACT_TRADE_JOIN_WAR</ContactType>
<ContactType>CONTACT_SECRETARY_GENERAL_VOTE</ContactType>
<ContactType>CONTACT_TRADE_MILITARY_UNITS</ContactType>
<ContactType>CONTACT_TRADE_WORKERS</ContactType>
<ContactType>CONTACT_TRADE_CONTACTS</ContactType>
<ContactType>CONTACT_TRADE_CORPORATION</ContactType>
<!--Afforess Advanced Diplomacy-->


So now is the same as in GlobalTypes
 
Ripple could you attach those changed sdk files for me to quickly update the mod?

Why would you want to update the SDK to remove CONTACT_SECRETARY_GENERAL_VOTE and CONTACT_TRADE_CORPORATION, when you have Roamty's fix in the XML to make it work?
 
OK, I've changed the leaderheadinfos.xml file now (no update yet). I can't seem to find the CvDeal code strings that was mentioned here.

In fact, I checked all the SDK source files in Advanced Diplomacy ver 1.05 and in ver 2.0 for "removeFirstTradeNode" and could not find it anywhere. If this function is not there, I assume Afforess must have removed it. Ripple01 said the code was left out, but I don't see how it can affect game play since nothing in Advanced Diplomacy references that function. :confused: Lastly, I checked the original Civ4 SDK in both CvDeal files and didn't find it there either. Therefore, I don't beleve we have a problem in ver 2.0.

Reading the whole post seems to confirm my findings: http://forums.civfanatics.com/showthread.php?p=11327971
 
CyEnumsInterface I found this and change it to the second one double

.value("TRADE_SECRETARY_GENERAL_VOTE", TRADE_SECRETARY_GENERAL_VOTE)
.value("TRADE_PLEDGE_VOTE", TRADE_PLEDGE_VOTE)
.value("TRADE_SECRETARY_GENERAL_VOTE", TRADE_SECRETARY_GENERAL_VOTE)
.value("TRADE_PLEDGE_VOTE", TRADE_PLEDGE_VOTE)


/************************************************************************************************/
/* Afforess Start 06/16/10 */
/* */
/* Advanced Diplomacy */
/************************************************************************************************/
.value("TRADE_EMBASSY", TRADE_EMBASSY)
.value("TRADE_WORKER", TRADE_WORKER)
.value("TRADE_MILITARY_UNIT", TRADE_MILITARY_UNIT)
.value("TRADE_CONTACT", TRADE_CONTACT)
.value("TRADE_CORPORATION", TRADE_CORPORATION)
.value("TRADE_SECRETARY_GENERAL_VOTE", TRADE_SECRETARY_GENERAL_VOTE)
.value("TRADE_PLEDGE_VOTE", TRADE_PLEDGE_VOTE)
.value("TRADE_SECRETARY_GENERAL_VOTE", TRADE_SECRETARY_GENERAL_VOTE)
.value("TRADE_PLEDGE_VOTE", TRADE_PLEDGE_VOTE)
.value("TRADE_RITE_OF_PASSAGE", TRADE_RITE_OF_PASSAGE)
.value("TRADE_FREE_TRADE_ZONE", TRADE_FREE_TRADE_ZONE)
/************************************************************************************************/
/* Afforess END */
/************************************************************************************************/



/************************************************************************************************/
/* Afforess Start 06/16/10 */
/* */
/* Advanced Diplomacy */
/************************************************************************************************/
.value("TRADE_EMBASSY", TRADE_EMBASSY)
.value("TRADE_WORKER", TRADE_WORKER)
.value("TRADE_MILITARY_UNIT", TRADE_MILITARY_UNIT)
.value("TRADE_CONTACT", TRADE_CONTACT)
.value("TRADE_CORPORATION", TRADE_CORPORATION)
.value("TRADE_SECRETARY_GENERAL_VOTE", TRADE_SECRETARY_GENERAL_VOTE)
.value("TRADE_PLEDGE_VOTE", TRADE_PLEDGE_VOTE)
.value("TRADE_RITE_OF_PASSAGE", TRADE_RITE_OF_PASSAGE)
.value("TRADE_FREE_TRADE_ZONE", TRADE_FREE_TRADE_ZONE)
/************************************************************************************************/
/* Afforess END */
/************************************************************************************************/
 
Just been looking through the code and it looks like the m_iSecretaryGeneralVoteRefuseAttitudeThreshold variable from CvInfos.cpp does not have a default set and is not part of the CvLeaderHeadInfo XML file, though the code to read the entry from the XML file exists.

There is a call to CvLeaderHeadInfo::getSecretaryGeneralVoteRefuseAttitudeThreshold() from CvPlayer.cpp so the value is used.

The following changes should resolve it:

-------------------
CvInfos.cpp
-------------------
Code:
/***********************************************************************************************/
/* Afforess	                  Start		 07/29/10                                               */
/*                                                                                              */
/* Advanced Diplomacy                                                                           */
/***********************************************************************************************/
,m_iMilitaryUnitRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
,m_iWorkerRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
,m_iCorporationRefuseAttitudeThreshold(ATTITUDE_CAUTIOUS)
,m_iEmbassyRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
/***********************************************************************************************/
/* Afforess	                     END                                                            */
/***********************************************************************************************/

Should be changed to:

/***********************************************************************************************/
/* Afforess	                  Start		 07/29/10                                               */
/*                                                                                              */
/* Advanced Diplomacy                                                                           */
/***********************************************************************************************/
,m_iMilitaryUnitRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
,m_iWorkerRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
,m_iCorporationRefuseAttitudeThreshold(ATTITUDE_CAUTIOUS)
,m_iEmbassyRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
,m_iSecretaryGeneralVoteRefuseAttitudeThreshold(ATTITUDE_ANNOYED)
/***********************************************************************************************/
/* Afforess	                     END                                                            */
/***********************************************************************************************/

-------------------------------
CIV4CivilizationsSchema.xml
-------------------------------
Code:
<!-- Afforess Advanced Diplomacy -->
<ElementType name="MilitaryUnitRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="WorkerRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="CorporationRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="EmbassyRefuseAttitudeThreshold" content="textOnly"/>
<!-- Afforess Advanced Diplomacy -->

becomes

<!-- Afforess Advanced Diplomacy -->
<ElementType name="MilitaryUnitRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="WorkerRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="CorporationRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="EmbassyRefuseAttitudeThreshold" content="textOnly"/>
<ElementType name="SecretaryGeneralVoteRefuseAttitudeThreshold" content="textOnly"/>
<!-- Afforess Advanced Diplomacy -->

AND

<!-- Afforess Advanced Diplomacy -->
<element type="MilitaryUnitRefuseAttitudeThreshold" minOccurs="0"/>
<element type="WorkerRefuseAttitudeThreshold" minOccurs="0"/>
<element type="CorporationRefuseAttitudeThreshold" minOccurs="0"/>
<element type="EmbassyRefuseAttitudeThreshold" minOccurs="0"/>
<!-- Afforess Advanced Diplomacy -->

becomes

<!-- Afforess Advanced Diplomacy -->
<element type="MilitaryUnitRefuseAttitudeThreshold" minOccurs="0"/>
<element type="WorkerRefuseAttitudeThreshold" minOccurs="0"/>
<element type="CorporationRefuseAttitudeThreshold" minOccurs="0"/>
<element type="EmbassyRefuseAttitudeThreshold" minOccurs="0"/>
<element type="SecretaryGeneralVoteRefuseAttitudeThreshold" minOccurs="0"/>
<!-- Afforess Advanced Diplomacy -->

-----------------------------
CIV4LeaderHeadInfos.xml
-----------------------------

All instances of
Code:
<!-- Afforess Advanced Diplomacy-->
<MilitaryUnitRefuseAttitudeThreshold>ATTITUDE_ANNOYED</MilitaryUnitRefuseAttitudeThreshold>
<WorkerRefuseAttitudeThreshold>ATTITUDE_ANNOYED</WorkerRefuseAttitudeThreshold>
<CorporationRefuseAttitudeThreshold>ATTITUDE_CAUTIOUS</CorporationRefuseAttitudeThreshold>
<EmbassyRefuseAttitudeThreshold>ATTITUDE_ANNOYED</EmbassyRefuseAttitudeThreshold>
<!-- Afforess Advanced Diplomacy-->

should become

<!-- Afforess Advanced Diplomacy-->
<MilitaryUnitRefuseAttitudeThreshold>ATTITUDE_ANNOYED</MilitaryUnitRefuseAttitudeThreshold>
<WorkerRefuseAttitudeThreshold>ATTITUDE_ANNOYED</WorkerRefuseAttitudeThreshold>
<CorporationRefuseAttitudeThreshold>ATTITUDE_CAUTIOUS</CorporationRefuseAttitudeThreshold>
<EmbassyRefuseAttitudeThreshold>ATTITUDE_ANNOYED</EmbassyRefuseAttitudeThreshold>
<SecretaryGeneralVoteRefuseAttitudeThreshold>ATTITUDE_ANNOYED</SecretaryGeneralVoteRefuseAttitudeThreshold>
<!-- Afforess Advanced Diplomacy-->

I making an assumption that the correct threshold value is ATTITUDE_ANNOYED here of course.
 
Top Bottom