[SDK] Advanced Diplomacy

This is just great :goodjob:
Even more so as i need exactly this for my ZOC mod, i mean "right of passage" diplomacy option.

Afforess
I haven't tried Advanced Diplomacy yet maybe things described below are already realized..

My suggestion is:
for a given civ to cancel automatically open borders agreement with any civ that goes to war with a third civ given civ is not at war with.
Say you are civ A that have OB agreement with both civ B and civ C. civ C declares a war on civ B => open borders cancelled both with civ B and civ C. Civ A should to declare a war on either of them in order to make an OB agreement with the other, or wait until they make peace (after is OB cancelled, RoP agreement with both civs remains). edit: OR civ A can sign OB with ONE of warring civs later, what will have a negative diplo effect:
"-1: You allowed our enemies to pass through your territory"

Consequences of this:
1. you can not to attack from a third civ's territory (your troops will be moved immediately from any neutral country's territory after a DoW);
2. there will be no battles on a third civ's territory (that always looked weird).

PS: i have a feeling that "open borders" and "right of passage" agreement names should be swapped. imo right of passage suit better to right of military units passage through one's territory while OB is associated with trade..
 
PS: i have a feeling that "open borders" and "right of passage" agreement names should be swapped. imo right of passage suit better to right of military units passage through one's territory while OB is associated with trade..

Yes,tottaly agree...
Hey Affroes this is great modcomp :goodjob:
Is it possible that you make 30dll civ(or any number larger than 18)?
Couse this modcomp will be ideal for some modern time mods...
Great work!!
 
Nice mod...I have been looking for one that opens trade routes whilst still disallowing military traffic.

I have noticed the following using the download link today:

1 - I am getting a compilation error

PHP:
CyEnumsInterface.cpp(1462) : error C2065: 'TRADE_FREE_TRADE_ZONE' : undeclared identifier
CyEnumsInterface.cpp(1462) : error C2228: left of '.value' must have class/struct/union type
CyEnumsInterface.cpp(1462) : error C2228: left of '.value' must have class/struct/union type

linked to line 1308 in CyEnumsInterface.cpp
PHP:
		.value("TRADE_FREE_TRADE_ZONE", TRADE_FREE_TRADE_ZONE)

The constant doesn't appear to be referenced anywhere else and commenting out the line doesn't appear to have a detrimental effect

2 - I also noticed that the RITE_OF_PASSAGE is not allowing any units, military or otherwise, to enter the foreign territory. I added some conditions of my own into CvUnit::canEnterTerritory, but you probably have a more elegant or at least flexible solution in mind:

PHP:
	if (!bIgnoreRightOfPassage)
	{
		if (GET_TEAM(getTeam()).isOpenBorders(eTeam))
		{
			return true;
		}
		if (GET_TEAM(getTeam()).isLimitedBorders(eTeam) && !m_pUnitInfo->isPillage() && getDomainType() != DOMAIN_AIR && !isAnimal())
		{
			return true;
		}
	}

3 - I also noticed that the Right of Passage appears twice when looking at the Current Deals diplomacy screen

4 - After having established an embassy I can't see into the other players capital by double-clicking on it. Is there another way I am supposed to look at the city?

5 - I'm not sure if it is deliberate or not but the ContactTypes and MemoryTypes aren't being exposed to Python in CyEnumsInterface.cpp. I think the following lines should probably be added:

PHP:
		.value("CONTACT_PEACE_PRESSURE", CONTACT_PEACE_PRESSURE)
		.value("CONTACT_EMBASSY", CONTACT_EMBASSY)
		.value("CONTACT_TRADE_STOP_TRADING", CONTACT_TRADE_STOP_TRADING)
		.value("CONTACT_TRADE_JOIN_WAR", CONTACT_TRADE_JOIN_WAR)
		.value("CONTACT_TRADE_MILITARY_UNITS", CONTACT_TRADE_MILITARY_UNITS)
		.value("CONTACT_TRADE_WORKERS", CONTACT_TRADE_WORKERS)
		.value("CONTACT_TRADE_CONTACTS", CONTACT_TRADE_CONTACTS)
		.value("CONTACT_TRADE_CORPORATION", CONTACT_TRADE_CORPORATION)

and

PHP:
		.value("MEMORY_RECALLED_AMBASSADOR", MEMORY_RECALLED_AMBASSADOR)
 
My suggestion is:
for a given civ to cancel automatically open borders agreement with any civ that goes to war with a third civ given civ is not at war with.
Say you are civ A that have OB agreement with both civ B and civ C. civ C declares a war on civ B => open borders cancelled both with civ B and civ C. Civ A should to declare a war on either of them in order to make an OB agreement with the other, or wait until they make peace (after is OB cancelled, RoP agreement with both civs remains). edit: OR civ A can sign OB with ONE of warring civs later, what will have a negative diplo effect:
"-1: You allowed our enemies to pass through your territory"

Consequences of this:
1. you can not to attack from a third civ's territory (your troops will be moved immediately from any neutral country's territory after a DoW);
2. there will be no battles on a third civ's territory (that always looked weird).

Interesting Idea. I can add that.
PS: i have a feeling that "open borders" and "right of passage" agreement names should be swapped. imo right of passage suit better to right of military units passage through one's territory while OB is associated with trade..

Feel free to swap the text key's around, so Right of Passage read Open Borders and vice-versa.

Yes,tottaly agree...
Hey Affroes this is great modcomp :goodjob:
Is it possible that you make 30dll civ(or any number larger than 18)?
Couse this modcomp will be ideal for some modern time mods...
Great work!!

I never intended my DLL to be used for more than to show that the mod works. ;)

Nice mod...I have been looking for one that opens trade routes whilst still disallowing military traffic.

I have noticed the following using the download link today:

1 - I am getting a compilation error

PHP:
CyEnumsInterface.cpp(1462) : error C2065: 'TRADE_FREE_TRADE_ZONE' : undeclared identifier
CyEnumsInterface.cpp(1462) : error C2228: left of '.value' must have class/struct/union type
CyEnumsInterface.cpp(1462) : error C2228: left of '.value' must have class/struct/union type

linked to line 1308 in CyEnumsInterface.cpp
PHP:
		.value("TRADE_FREE_TRADE_ZONE", TRADE_FREE_TRADE_ZONE)

The constant doesn't appear to be referenced anywhere else and commenting out the line doesn't appear to have a detrimental effect

2 - I also noticed that the RITE_OF_PASSAGE is not allowing any units, military or otherwise, to enter the foreign territory. I added some conditions of my own into CvUnit::canEnterTerritory, but you probably have a more elegant or at least flexible solution in mind:

PHP:
	if (!bIgnoreRightOfPassage)
	{
		if (GET_TEAM(getTeam()).isOpenBorders(eTeam))
		{
			return true;
		}
		if (GET_TEAM(getTeam()).isLimitedBorders(eTeam) && !m_pUnitInfo->isPillage() && getDomainType() != DOMAIN_AIR && !isAnimal())
		{
			return true;
		}
	}

3 - I also noticed that the Right of Passage appears twice when looking at the Current Deals diplomacy screen

4 - After having established an embassy I can't see into the other players capital by double-clicking on it. Is there another way I am supposed to look at the city?

5 - I'm not sure if it is deliberate or not but the ContactTypes and MemoryTypes aren't being exposed to Python in CyEnumsInterface.cpp. I think the following lines should probably be added:

PHP:
		.value("CONTACT_PEACE_PRESSURE", CONTACT_PEACE_PRESSURE)
		.value("CONTACT_EMBASSY", CONTACT_EMBASSY)
		.value("CONTACT_TRADE_STOP_TRADING", CONTACT_TRADE_STOP_TRADING)
		.value("CONTACT_TRADE_JOIN_WAR", CONTACT_TRADE_JOIN_WAR)
		.value("CONTACT_TRADE_MILITARY_UNITS", CONTACT_TRADE_MILITARY_UNITS)
		.value("CONTACT_TRADE_WORKERS", CONTACT_TRADE_WORKERS)
		.value("CONTACT_TRADE_CONTACTS", CONTACT_TRADE_CONTACTS)
		.value("CONTACT_TRADE_CORPORATION", CONTACT_TRADE_CORPORATION)

and

PHP:
		.value("MEMORY_RECALLED_AMBASSADOR", MEMORY_RECALLED_AMBASSADOR)

Thanks. As I said in the OP; I have this working in my mod, and this is an extraction from the source code, which is why there are a lot of bugs. :mischief: I'll make sure to update the download soon.
 
I'm not sure, but in Civ4LeaderHeadInfos.xml you got:

PHP:
<SecretaryGeneralVoteRefuseAttitudeThreshold>ATTITUDE_ANNOYED</SecretaryGeneralVoteRefuseAttitudeThreshold>

Is SecretaryGeneral Vote Trading available with this modcomp? I'm not sure, I know you have removed something voting related.
 
I'm not sure, but in Civ4LeaderHeadInfos.xml you got:

PHP:
<SecretaryGeneralVoteRefuseAttitudeThreshold>ATTITUDE_ANNOYED</SecretaryGeneralVoteRefuseAttitudeThreshold>

Is SecretaryGeneral Vote Trading available with this modcomp? I'm not sure, I know you have removed something voting related.

That feature never worked properly; and I wasn't very interested in it; so I removed it from this modcomp, and disabled it in my mod.

is this modcomp compatible with DCM.
Sure. It should be compatible with nearly all mods.
 
Updated to V1.05. Should fix all known bugs. There are quite a few changed files, be careful when merging.
 
hey afforess, thanks for the new version,

but i think something is wrong with the embassy's,

i cant seems to offer to establish an embassy - the ai offers me right of passage before he establishes embassy with me, only when i said to him i wanna re negotiate - i get the option to establish. after a short while the ai also offers embassy.

but on first contact, after getting agriculture, it seems i cant offer embassy's, i can do nothing besides - "lets discuss something else" or cease bothering us (revdcm option).
 
hey afforess, thanks for the new version,

but i think something is wrong with the embassy's,

i cant seems to offer to establish an embassy - the ai offers me right of passage before he establishes embassy with me, only when i said to him i wanna re negotiate - i get the option to establish. after a short while the ai also offers embassy.

but on first contact, after getting agriculture, it seems i cant offer embassy's, i can do nothing besides - "lets discuss something else" or cease bothering us (revdcm option).

You did notice these tags, right:

Code:
			<!--Afforess Advanced Diplomacy-->
			<bLimitedBordersTrading>1</bLimitedBordersTrading>
			<bEmbassyTrading>1</bEmbassyTrading>
			<!--Afforess Advanced Diplomacy-->

You can only trade embassies after researching a specific tech. I suggest Writing, but whatever tech you set it to.
 
hi afforess,

yes of course, you put those in agriculture , so that's not the issue im afraid.

so basically, when i met an ai - after i had learnt agriculture, i did not have the ability to offer an embassy nor right of passage, all i could to is "discuss something else" or "cease bothering us".

when the ai contacted me- it first offered right of passage, but when i did re negotiate , i had the possibility to establish embassy...

im sure i did all the merge currently, since i compared your 1.04 to 1.05 and updated the changes.

i will try another new game, although im certain of this.


can anyone else confirm this??
 
Well, right of passage does not need an embassy (intended, no bug).
 
That's intentional, as the window of time you can actually sell contacts is small (before everyone meets all the other civs). You can increase it with the ContactRands for leaders, if you so desire.
 
Perhaps this is the wrong place to ask, or too dumb a question (I'm no modder), but would it be easy to add this to something like Quot Capita myself, or would the author have to do it?

Avain will have to add that himself if he want to.

But you can add this yourself after you apply yourself to understanding basic merging skills in time though :). Then after you understand merging, you will have to read Rafer (look in Modiki, linked at the top of this webpage) instruction on compiling a dll. Though, it is a bit outdated now that we have a method to compile a dll faster than before, but still very relevant.

If you are lost at what I was saying above, just tell Avain and let him decide :).
 
If you are lost at what I was saying above, just tell Avain and let him decide :).
AFAIK, avain has expressed great interest in it and thinks about adding it (probably when his pc is working again...).

Btw, Afforess, do you intend to release the "Realistic Corporations" parts of AND as a standalone mod as well? Would be awesome if you did that (if possible)! :)
 
Back
Top Bottom