Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0007831Dwarf FortressDwarf Mode -- Diplomacypublic2014-08-04 02:592014-08-05 10:46
Toady One 
normalminorhave not tried
0007831: No elf diplomat comes to fort
Checking C
there is an elf diplomat listed
My fortress is a Duchy.

It's been 2 years since being elevated to barony.

Elves come every year to trade, but no diplomat.

This is a 40.05 save moved to 40.06, but I was a barony before coming to 40.06 and the diplomat didn't come then either.

See these notes for specifics:
No tags attached.
related to 0007295confirmed Dwarfu Site has many barons/baronesses 
related to 0007977confirmed Footkerchief Justice, Sleep Pretension, and Menial Work Exemption ignored for CIV-level nobles 
Issue History
2014-08-04 02:59crossmrNew Issue
2014-08-04 11:56QuietustNote Added: 0028299
2014-08-04 17:09crossmrNote Added: 0028327
2014-08-04 17:15ButtonNote Added: 0028329
2014-08-04 17:15ButtonNote Edited: 0028329bug_revision_view_page.php?bugnote_id=0028329#r10752
2014-08-04 17:16ButtonNote Edited: 0028329bug_revision_view_page.php?bugnote_id=0028329#r10753
2014-08-04 17:22crossmrNote Added: 0028330
2014-08-04 21:20QuietustNote Added: 0028348
2014-08-04 21:21QuietustNote Edited: 0028348bug_revision_view_page.php?bugnote_id=0028348#r10764
2014-08-04 22:27DwarfuNote Added: 0028358
2014-08-04 22:27DwarfuRelationship addedrelated to 0007295
2014-08-04 22:27DwarfuAssigned To => Dwarfu
2014-08-04 22:27DwarfuStatusnew => needs feedback
2014-08-04 22:27DwarfuNote Added: 0028359
2014-08-05 04:26QuietustNote Added: 0028369
2014-08-05 06:06QuietustNote Edited: 0028369bug_revision_view_page.php?bugnote_id=0028369#r10790
2014-08-05 06:30crossmrNote Added: 0028378
2014-08-05 06:30crossmrStatusneeds feedback => assigned
2014-08-05 07:07DwarfuAdditional Information Updatedbug_revision_view_page.php?rev_id=10800#r10800
2014-08-05 07:07DwarfuStatusassigned => confirmed
2014-08-05 08:284maskwolfIssue Monitored: 4maskwolf
2014-08-05 10:36Toady OneStatusconfirmed => resolved
2014-08-05 10:36Toady OneFixed in Version => Next Version
2014-08-05 10:36Toady OneResolutionopen => fixed
2014-08-05 10:36Toady OneAssigned ToDwarfu => Toady One
2014-08-05 10:464maskwolfIssue End Monitor: 4maskwolf
2014-08-12 14:14FootkerchiefRelationship addedrelated to 0007977

2014-08-04 11:56   
Looking at the relevant code, this ought to be working.

At the very beginning of the year, after it checks that you've satisfied the PROGRESS_TRIGGERs, it summons the caravan, then it checks the TREE_CAP_DIPLOMACY raw flag. If it's set, it then examines every history event to see if the civilization has established first contact with you - if it has, it queues up a normal diplomat visit (within a few weeks of the caravan), otherwise it attempts to initiate first contact by summoning the diplomat immediately (and silently) at the map edge.

The only reason I can see this failing would be if one of the following was true:
1. there was no valid map entry point
2. the Elven civilization didn't have a diplomat (position with MAKE_INTRODUCTIONS) assigned and wasn't able to appoint a new one
3. you didn't have a LAND_HOLDER (i.e. a baron, count, or duke) appointed at your fortress

Could you post your savegame?
2014-08-04 17:09   
1. I get caravans every year, so not an issue
2. They have a diplomat
3. I have a duke

Save: http://dffd.wimbli.com/file.php?id=9285 [^]
2014-08-04 17:15   
(edited on: 2014-08-04 17:16)
crossmr, did you get the duke via appointment and subsequent elevation, or did one of your dwarves inherit the title?

2014-08-04 17:22   
He was appointed as a baron and then elevated.
2014-08-04 21:20   
(edited on: 2014-08-04 21:21)
I've just attempted to trace through the first contact code, and it failed at the "find dwarf assigned to land_holder position" check.

Looking more closely, it appears that the first contact code is looking for a land holder specific to your local government (civ 2460), but your duke was apparently assigned to your parent civilization (civ 265) instead; your local government does not have those positions, let alone appointment slots for them.

I don't have a 0.34.11 savegame handy at the moment, so I'll have to find one tomorrow to see how it was assigning land holder positions.

2014-08-04 22:27   
That (assigning SITE leadership to the parent civ) makes it sound like it could be the cause of 0007295.
2014-08-04 22:27   
Relevant thread:
http://www.bay12forums.com/smf/index.php?topic=141763.0 [^]
2014-08-05 04:26   
(edited on: 2014-08-05 06:06)
The root of this bug is that the BARON, COUNT, and DUKE positions were changed from [SITE] positions (with a limit of 1) to global positions (which are appointed AS_NEEDED) - back in version 0.34 (and 0.31), the various land holder positions were all site-specific, so the diplomat fix actually worked correctly.

In a fortress from version 0.34.11:
"He is a citizen of The Watchful Rags. He is a member of The Destined Beards of Laboring. He is the baron of The Destined Beards of Laboring."

In the 0.40 savegame posted above:
"He is a citizen of The Ink of Virtues. He is a member of The Bodice of Direction. He is the duke of The Ink of Virtues."

2014-08-05 06:30   
However you want to go about it, the diplomat isn't showing up. Either the diplomat code needs to be changed or the noble code needs changed so the diplomat knows he's there.