Diplomacy Text Mod Problem

DRBUGBOFFIN

Chieftain
Joined
Aug 31, 2005
Messages
25
Location
Illinois
I've modified all the text in my mod's Diplomacy file, using the CivIII Diplomacy Editor I downloaded (which seems to work great!). But, after playing several games in which the new text worked perfectly, now I find that for at least one leader, the text is blank or displaying parts of the Diplomacy file that weren't meant to be displayed.
This seems to have happened when I first played using the last civilization I created, i.e., the one whose responses appear last in the Diplomacy.txt lists. It seems things are out of sync, but I'm not sure why. I compared my new Diplomacy.txt file to the original, and the number of lines for each AI response seem equal (except for each response type the original has 3,6, or 9more lines than my modified file, which I assume is the way it's supposed to be?). Anyway, are there characters you shouldn't use in the text file that might be causing this? Any other ideas...??? Thanks!
 
I seriously hope some experienced diplomodders respond to this, because I'd like to know too.

I've tried changing some text, and the game hung. I assume that was because I changed the number of lines in the text. Then, if I keep the number of lines equal, the text shows up in-game, I haven't had problems with simple changes.

But your trouble sounds familiar. I've noticed a pattern to this game's programming that I couldn't possibly know, but I do suspect. It sounds very similar to the problem where if you delete a civ in your mod, all items in the game that depend on ownership get slipped down the filelist by one. Like all units are now owned by the player one more down the list, since you've shortened the list by 1.

I have a hunch that the text files will work the same. Perhaps in your case, some change you've made causes a reference to the next line, which you didn't expect.

It's even possible that if you changed the mod in the editor (added or deleted a civ for instance) it will affect the text as well...?
 
One problem can be that you type something like $PLAYER when you should type $PLAYER0, or whatever it may be. This can cause text to fail to display.

If you enter precisely the number of lines that the original had, it ought to work. I don't know why you're entering different numbers of lines. If you want to do this, you have to fiddle with the numbers that come at the start of each section. For reference, this is how they work:

civ - if this is a 1, then the strings will be civ-specific. If it's a 0, they will not.

power - if this is a 1, then the strings will vary according to the ai's power relative to the player. If it's a 0, they will not.

mood - if this is a 1, then the strings will vary according to the ai's mood towards the player. If it's a 0, they will not.

random - this gives the number of strings in each sub-category.

So, say you've got civ=1 and the rest are 0. This means that there will be one string for each civ in the game. An example is the "first contact" string that comes at the start of the file.

Say, though, that you've got power=1 and the rest are 0. This means there will be precisely three strings, because the AI can be weaker than you, the same strength, or stronger. So in the first text, the AI should be speaking as though it is weak, and in the third as if it is strong.

Again, if mood is the only one to have a 1, there will be only three strings. The first will be friendly, the second neutral, and the third angry.

Finally, if the random variable is the only one to have a 1, this is simply the number of strings there are, and it could choose any one of them at random.

It gets complicated when things are combined. Say that civ=1 and mood=1, but the others are 0. This means that for each civ there will be three strings, each corresponding to a mood. So first you will have three strings for the first civ, then three for the second, and so on. The same would apply if it's civ=1 and power=1 - each civ would have three strings, each one corresponding to a mood. If you have civ=1 and power=1 *and* mood=1, then you have nine strings for every civ. The mood ones will be "nested" within the power ones, which in turn are "nested" within the civ ones.

The random number multiplies everything else. Say that you have civ=1 and random=3, but the others are 0. This means that you will have three strings for civ 1, then three strings for civ 2, and so on. But the game will select one of the three at random, not according to power or mood. An example is the "peace greetings" section - when you meet with an AI that you already know, it may say one of three strings, at random. Again, imagine that you have civ=1, mood=1, and random=2. Now each civ will have six strings - two friendly ones, two neutral ones, and two angry ones.

Hope all that helps! Basically, if you get anything wrong, the results are unpredictable. For example, if you don't provide all the strings that you have specified, the result is likely to be just a blank string being returned (ie, the AI appears to say nothing). However, problems with one section shouldn't affect another. For example, if you screw up the "peace greetings" section, I don't think this should have ramifications elsewhere, because each section is headed by the codes that tell the program where it begins.
 
It would sound better in person, and if I could do a better Sammy Davis Jr. impression, but...

:cool: Like, wow, man... You've absolutely... like, blown me away, man...

Plot, that's very useful information! I'll have to study it, but THANKS!:goodjob:
 
Yes, thanks, Plotinus. I found a stray "$" -- even after proof reading the who diplomacy file. I fixed that, but unfortunately that didn't change the game's mixing up the dialogue of what appears to be only a couple of my 31 civs. I still have no idea why, but may actually try to restructure the diplomacy file, i.e., switch the order. Other than that, I'm out of ideas.
 
Here's where my idea about file position changes could be the cause. I've found that if there's a problem and I fix it, sometimes the gameplay doesn't fix it, so I just start from scratch and re-create a NEW biq using the info I've got written in the previous text folder...

For example, the playable civs. If I've deleted one civ, all lists are now bogus. So I have to start over, and just delete the civ FIRST, before I create any more lists that depend on playable civs (like units, etc.)

By the way, you have to keep in mind that you can't change some parts of the biq if you've already loaded a startup with the old version. Some entries, like Civilopedia, can be changed and will show up in an old startup, but my hunch is that an extra "$" won't update...
 
Finn et al,
I think I just solved the problem. Since only the last five or so of my 31 created civs were scrambling their diplomacy.txt lines, I looked at those civs in the Editor to see if anything was different between them and the other civs that were displaying the correct diplomacy lines. I am stupid, of course, for not doing this in the first place.
There in the Editor I found the little box labeled "Diplomacy Text Index." And there in that box were the numbers 27, 28, 29, etc., for the civs that were displaying incorrect lines. All the other civs that were working correctly had "-1" in their Diplomacy Text Index boxes. I just changed the 27, 28... all to -1, and the text for all my civs is now displaying correctly (so far). Anyway, it seems I've solved my problem, with some help from your ideas. Maybe this can help others who may be having the same problem.
 
Yes, if they have -1 in that box it means they simply use the string in the order that the civs appear in the Editor. If there is a different number there, that points them to a different string.
 
I wonder if you could enlighten us, Plotinus, as to how this particular number affects the specific line referenced in the diplomacy.txt file? I've been curious about this for a long while, but haven't been brave enough to spend the effort changing and testing out each and every index...
 
Well, if the civ is the first in the list, then if it has -1 in its box then it will use the first string (or set of strings) in any part of the Diplomacy file where civ=1. If it's the second, it will use the second, and so on. So if you look at the "initial contact" section of the Diplomacy file, you will see that the strings are in the same order as the civs in the Editor - Rome's string comes first, then Egypt, then Greece, and so on. If you want to make a civ use a different set of strings, you just enter a number other than -1 into its box in the Editor, and this directs it to which one to use.
 
I was hoping you could supply the kind of precision you did with your earlier contribution, but I understand the concept. It's just hard to imagine actually using this feature for the really fun stuff, like directing your Scottish highlanders to the brogue index, only to find some other civ ends up using it too.

Still, I haven't seen anyone but the Celts use Gaelic, so it might be a pattern I could figure out...
 
Back
Top Bottom