How to Add Diplomacy Text to a Leaderhead

smeagolheart

Monarch
Joined
Sep 4, 2007
Messages
924
Location
Phoenix, AZ
So you've downloaded Elvis McPatton and want to add him to your mod. You add him in, but when you play the game and encounter him, he seems a bit - mute. I couldn't find another guide for this so I made one here, this guide assumes passing familiarity with XML..

Here's how to give old Elvis a bit more conversation. This guide assumes you've got the leader installed already, viewable selectable etc. If not see this guide: http://forums.civfanatics.com/showthread.php?t=278907

Required Files:
  • CIV4DiplomacyInfos.xml
  • CIV4GameText_DiplomacyText_BTS.xml
  • maybe CIV4LeaderHeadInfos.xml if you need to check the exact tag for your mute leaderhead

So the first thing you'll probably want to know is there there are some generic responses already in the game so your Elvis probably isn't entirely mute. But you can specify additional personalized first contact, refusal to speak to you etc dialogues as well. You could edit Washington for example to give a tidbit of wisdom about his wooden teeth.

First thing you'll want to do is create responses for these text items and place them in the text folder of your XML folder for your mod. Never modify your original gamefiles.

I made a template for the types of responses that are used in game. See the spoiler below. You can copy these responses, and replace the "CALIGULA" tag with the leaderhead of your choice. Leave the _1 extension though capeche? It should be sorta clear what each item between <TEXT> means. [CT NAME] is a variable for you (the player). There's a few more, feel free to reply to this thread if you have that list handy. You'll want to paste your edited, replaced, customized version of this in a file in the \Assets\XML\Text\ folder of your BTS install. You can make a new text file (you'll need head and end tags) or you can plop this in another one, it "belongs" in CIV4GameText_DiplomacyText_BTS.xml Foreign language tags are in for French, Spanish, German in official Firaxis XML. My example doesn't have them I've heard it still works for them but people with those languages get only the English text.
Spoiler :

<TEXT>
<Tag>AI_DIPLO_FIRST_CONTACT_LEADER_CALIGULA_1</Tag>
<English>Welcome to the party, [CT_NAME].</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_REFUSE_TO_TALK_LEADER_CALIGULA_1</Tag>
<English>Go away [CT_NAME]. My horse has more sense than you!</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_NO_PEACE_LEADER_CALIGULA_1</Tag>
<English>There will not be peace between us while my armies gather at your gates.</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_GREETINGS_ATT_FR_LEADER_CALIGULA_1</Tag>
<English>Greetings, [CT_NAME]. Relax, sit down and let's chat.</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_GREETINGS_ATT_FUR_LEADER_CALIGULA_1</Tag>
<English>And why have *you* disturbed me?</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_DEMAND_TRIBUTE_POWER_WEAKER_CALIGULA_1</Tag>
<English>Can you spare this friend [CT_NAME]?</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_DEMAND_TRIBUTE_POWER_EQUAL_CALIGULA_1</Tag>
<English>[CT_NAME] this will bring our people closer together.</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_CALIGULA_1</Tag>
<English>Hand this over or suffer the consequences.</English>
</TEXT>


Ok so thats done. That was the creative part where you get to think of witty sayings and stuff, now comes the more tedious part.

Open up CIV4DiplomacyInfos.xml.
It's a nasty looking thing for sure. It is grouped by First contacts, then the refusal to meets, then the other tags. So you can't just cut and paste to the bottom of the thing, you have to place a tag in each correct area or the thing will cause your computer to melt. Here's an easy way to do that. Search for Gilgamesh. After his <response>, paste the corresponding response for your leaderhead (ie first contact after his first contact). After you've pasted your first contact text (NOTE: it will be in the same format as his is, not the earlier text, see below spoiler for example) then search again for gilgamesh and follow his next <response> tag with your leaderhead. And so on down the file until you run out of Gilgameshes.

I've created templates below grouped out that you can again copy and replace CALIGULA with your leaderhead.

Spoiler :
<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_FIRST_CONTACT_LEADER_CALIGULA_1</Text>

</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_REFUSE_TO_TALK_LEADER_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_NO_PEACE_LEADER_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes>
<Attitude>
<AttitudeType>ATTITUDE_FRIENDLY</AttitudeType>
<bAttitudeType>1</bAttitudeType>
</Attitude>
<Attitude>
<AttitudeType>ATTITUDE_PLEASED</AttitudeType>
<bAttitudeType>1</bAttitudeType>
</Attitude>
<Attitude>
<AttitudeType>ATTITUDE_CAUTIOUS</AttitudeType>
<bAttitudeType>1</bAttitudeType>
</Attitude>
</Attitudes>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_GREETINGS_ATT_FR_LEADER_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes>
<Attitude>
<AttitudeType>ATTITUDE_ANNOYED</AttitudeType>
<bAttitudeType>1</bAttitudeType>
</Attitude>
<Attitude>
<AttitudeType>ATTITUDE_FURIOUS</AttitudeType>
<bAttitudeType>1</bAttitudeType>
</Attitude>
</Attitudes>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_GREETINGS_ATT_FUR_LEADER_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers>
<DiplomacyPower>
<DiplomacyPowerType>DIPLOMACYPOWER_WEAKER</DiplomacyPowerType>
<bDiplomacyPowerType>1</bDiplomacyPowerType>
</DiplomacyPower>
</DiplomacyPowers>
<DiplomacyText>
<Text>AI_DIPLO_DEMAND_TRIBUTE_POWER_WEAKER_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers>
<DiplomacyPower>
<DiplomacyPowerType>DIPLOMACYPOWER_EQUAL</DiplomacyPowerType>
<bDiplomacyPowerType>1</bDiplomacyPowerType>
</DiplomacyPower>
</DiplomacyPowers>
<DiplomacyText>
<Text>AI_DIPLO_DEMAND_TRIBUTE_POWER_EQUAL_CALIGULA_1</Text>
</DiplomacyText>
</Response>

<Response>
<Civilizations/>
<Leaders>
<Leader>
<LeaderType>LEADER_CALIGULA</LeaderType>
<bLeaderType>1</bLeaderType>
</Leader>
</Leaders>
<Attitudes/>
<DiplomacyPowers>
<DiplomacyPower>
<DiplomacyPowerType>DIPLOMACYPOWER_STRONGER</DiplomacyPowerType>
<bDiplomacyPowerType>1</bDiplomacyPowerType>
</DiplomacyPower>
</DiplomacyPowers>
<DiplomacyText>
<Text>AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_CALIGULA_1</Text>
</DiplomacyText>
</Response>
 
So I figured out the variables that you can use. Talking as Ho Chi Minh of the Vietnamese to Hannibal of Carthage will get you these results:

[CT_NAME] - player's (you) name in game ex. "Jim"
[OUR_EMPIRE] - ex. "Carthaginian Empire"
[OUR_CIV_ADJ] - ex "Carthaginian"
[OUR_NAME] - ex "Hannibal"
[CT_CIV_SHORT] - ex "Vietnam"
[OUR_CIV_SHORT] - ex "Carthage"
[CT_CIV_ADJ] - ex "Vietnamese"
 
Hi, thank you for the guide!
I have a problem:
I'm trying to edit dialogues for a civ in a modpack (avain's Varietas Delectat). All works fine, but the responses are showed randomly:when I have first contact, it is not showed always the AI_DIPLO_FIRST_CONTACT_LEADER_[leader_name]_1 response but rather, sometimes, any other of them I have created (i.e: AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_[leader_name]_1).
Is it depends by the [leader_name]_CIV4LeaderHeadInfos.xml file? How have I to edit it?

Thank you in advance!
 
Hi 10lire,

I actually just had the same problem last night, and I was able to resolve it just by making sure that everything was tabbed correctly in the XML editor in CIV4GameText_DiplomacyText_BTS.xml .

For example: Instead of this:

<TEXT>
<Tag>AI_DIPLO_FIRST_CONTACT_LEADER_CALIGULA_1</Tag>
<English>Welcome to the party, [CT_NAME].</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_REFUSE_TO_TALK_LEADER_CALIGULA_1</Tag>
<English>Go away [CT_NAME]. My horse has more sense than you!</English>
</TEXT>
<TEXT>
<Tag>AI_DIPLO_NO_PEACE_LEADER_CALIGULA_1</Tag>
<English>There will not be peace between us while my armies gather at your gates.</English>
</TEXT>
I had to make sure it looked like this:

<TEXT>
1 <Tag>AI_DIPLO_FIRST_CONTACT_LEADER_CALIGULA_1</Tag>
1 <English>Welcome to the party, [CT_NAME].</English>
</TEXT>
<TEXT>
1 <Tag>AI_DIPLO_REFUSE_TO_TALK_LEADER_CALIGULA_1</Tag>
1 <English>Go away [CT_NAME]. My horse has more sense than you!</English>
</TEXT>
<TEXT>
1 <Tag>AI_DIPLO_NO_PEACE_LEADER_CALIGULA_1</Tag>
1 <English>There will not be peace between us while my armies gather at your gates.</English>
</TEXT>

That at least worked for me, it may vary depending on what you are using to edit (I'm using notepad++). Also, feel free to correct me if I'm wrong, anyone.

EDIT: I added the "1's" just to make sure that the spaces displayed in the post. Do not put them in there.
 
Hi 10lire,

I actually just had the same problem last night, and I was able to resolve it just by making sure that everything was tabbed correctly in the XML editor in CIV4GameText_DiplomacyText_BTS.xml .

Thank you for the suggestion!
The point is that I am not interested to edit the original files (putting them in CustomAssets) because I'm working on a completely new (modular) civilization (Italy) for a mod (Varietas Delectat); this means that I'm working on files of my own; By the way, I've tried to hiddent the tags as in the original BTS file, but it doesn't work.

These files are named:
"Cavour_CIV4DiplomacyInfos.xml",
"Cavour_CIV4GameText.xml" and
"Cavour_CIV4LeaderHeadInfos.xml"
where "Cavour" is the name of the leader.
My second try was to cut and paste the diplomacy tags from "Cavour_CIV4GameText.xml" in a new file that i have called: "Cavour_CIV4GameText_DiplomacyText_BTS.xml"; but for some reason (I am not skilled in XML) it is showed the label (AI_DIPLO_....) instead of text in this way; then I've restored the previous situation. Obviously the "random" problem remained.

Third try: these files are in the folder:
[BtS folder]\MODS\Varietas Delectat\Assets\Modules\Italy\XML\Leaderheads\Cavour.
I thought: «Maybe is not the proper folder?» Then I've moved these files in other folders (i.e.: XML\GameInfo) but nothing changes.

I haven't other ideas. Probably it can be useful to find a civilization created by fans where edited (and working! :) ) diplomacy, but I have found nothing.
 
So I figured out the variables that you can use. Talking as Ho Chi Minh of the Vietnamese to Hannibal of Carthage will get you these results:

[CT_NAME] - player's (you) name in game ex. "Jim"
[OUR_EMPIRE] - ex. "Carthaginian Empire"
[OUR_CIV_ADJ] - ex "Carthaginian"
[OUR_NAME] - ex "Hannibal"
[CT_CIV_SHORT] - ex "Vietnam"
[OUR_CIV_SHORT] - ex "Carthage"
[CT_CIV_ADJ] - ex "Vietnamese"

There is another thing you can add to the list:
[OUR_CIV_ADJ:1] will give you the plural word like: Carthaginians. This is of course in case the ADJ (in the Objects file) has a few options to choose from. It this case the CIV_ADJ should say: Carthaginian:Carthaginians. So ADJ:0 is Carthaginian, adn ADJ:1 is Carthaginians.
 
Hi, thank you for the guide!
I have a problem:
I'm trying to edit dialogues for a civ in a modpack (avain's Varietas Delectat). All works fine, but the responses are showed randomly:when I have first contact, it is not showed always the AI_DIPLO_FIRST_CONTACT_LEADER_[leader_name]_1 response but rather, sometimes, any other of them I have created (i.e: AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_[leader_name]_1).
Is it depends by the [leader_name]_CIV4LeaderHeadInfos.xml file? How have I to edit it?

Thank you in advance!

I think I might know what your problem is. Did you put all the links to the texts in the same place in the CIV4DiplomacyInfos file? Anyway, here is my CIV4DiplomacyInfos file- take a look. It works, so you might find your answer there.
 

Attachments

  • CIV4DiplomacyInfos.zip
    17.9 KB · Views: 197
I think I might know what your problem is. Did you put all the links to the texts in the same place in the CIV4DiplomacyInfos file? Anyway, here is my CIV4DiplomacyInfos file- take a look. It works, so you might find your answer there.

Problem solved!! :woohoo: Comparing my file with yours I have seen that some <Type> tags were missed; in other words all my responses were referred to the first Response Type (First contact). As I've said before, I'm totally unskilled with XML... :hammer2: BTW thank you for support!!
 
Problem solved!! :woohoo: Comparing my file with yours I have seen that some <Type> tags were missed; in other words all my responses were referred to the first Response Type (First contact). As I've said before, I'm totally unskilled with XML... :hammer2: BTW thank you for support!!

No problem. When you said that during the greeting you saw other texts I understood the problem was they're probably characterized as greetings as well. I'm glad my file helped you.
 
Now I have a new problem.........
My civ has 3 LHs; diplomacy texts work for two of them, not the third: he seems mute.
Obviously there is no difference among the files of the three LHs, except for the names (i.e.: "[leader_name]_CIV4LeaderHeadInfos.xml") and the labels (i.e.: "AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_[leader_name]_1");
obviously the labels match in every file of the same LH...

Any idea? I don't have some more..
 
Now I have a new problem.........
My civ has 3 LHs; diplomacy texts work for two of them, not the third: he seems mute.
Obviously there is no difference among the files of the three LHs, except for the names (i.e.: "[leader_name]_CIV4LeaderHeadInfos.xml") and the labels (i.e.: "AI_DIPLO_DEMAND_TRIBUTE_POWER_STRONGER_[leader_name]_1");
obviously the labels match in every file of the same LH...

Any idea? I don't have some more..

I don't know what to say here. Check really well the xml for the not-working LH. Maybe there's a spelling mistake or something small you can't notice.
 
I think it's a spelling problem too, and I've checked the xml again and again.. I have also replaced the files of the not-working LH with the files of a working one.. Nothing changes.. There is something I don't see or understand..

BTW thanks again for support! ;)
 
Is there any way to make custom diplomacy text for a specific leader's response to a peace treaty? The game only has generic ones.

Spoiler :

<DiplomacyInfo>
<Type>AI_DIPLOCOMMENT_PEACE</Type>
<Responses>
<Response>
<Civilizations/>
<Leaders/>
<Attitudes/>
<DiplomacyPowers/>
<DiplomacyText>
<Text>AI_DIPLO_PEACE_1</Text>
<Text>AI_DIPLO_PEACE_2</Text>
<Text>AI_DIPLO_PEACE_3</Text>
<Text>AI_DIPLO_PEACE_4</Text>
<Text>AI_DIPLO_PEACE_5</Text>
<Text>AI_DIPLO_PEACE_6</Text>
<Text>AI_DIPLO_PEACE_7</Text>
<Text>AI_DIPLO_PEACE_8</Text>
<Text>AI_DIPLO_PEACE_9</Text>
<Text>AI_DIPLO_PEACE_10</Text>
<Text>AI_DIPLO_PEACE_11</Text>
<Text>AI_DIPLO_PEACE_12</Text>
<Text>AI_DIPLO_PEACE_13</Text>
<Text>AI_DIPLO_PEACE_14</Text>
<Text>AI_DIPLO_PEACE_15</Text>
<Text>AI_DIPLO_PEACE_16</Text>
<Text>AI_DIPLO_PEACE_17</Text>
<Text>AI_DIPLO_PEACE_18</Text>
<Text>AI_DIPLO_PEACE_19</Text>
<Text>AI_DIPLO_PEACE_20</Text>
</DiplomacyText>
</Response>
</Responses>
</DiplomacyInfo>


The game refuses to acknowledge any custom leader specific text for this, will I have to alter the tag "<Type>AI_DIPLOCOMMENT_PEACE</Type>" and if I do, where will I find it? Sorry if this seems confusing.

EDIT: Never mind, solved it. =D
 
Is there any way to make custom diplomacy text for a specific leader's response to a peace treaty? The game only has generic ones.

EDIT: Never mind, solved it. =D




How did you solve it? I'm curious about this myself.
 
in my Narnia mod that I made (it still hasn't been approved) the files aren't there. I got the bones of it (as I had never before made a mod) from Radio Noer
Spoiler :
btw thanks for the help, I gave you credit
and it didn't have a diplo text file. to change it, I copy/pasted it from BTS and edited, could that be the causeof it not working?

EDIT: I got it! I just had to delete some things.... :bump:

Thanks for the tutorial!
 
SORRY FOR BUMP, BUT I AM STUCK.


Ok, do all my tags have to go under the same leader, like for example, I put them all underneath franklin roosevelt, do they all have to go under the same leader for each file, or does it not really matter.

I am wondering because I get an error when my mod loads.

the first one says

"failed loading XML file xml\text\civ4diplomacyinfos.xml"

the next one says

"LoadXML call failed for xml\text\civ4\dilomacyinfos.xml.
Current XML file is xml\text\civ4homestucktext.xml."

Can anybody help me fix this?
 
Any help, on making diplo text for declaring war? Making peace? Demand to covert religion or civic?
 
Top Bottom