Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.7k stars 327 forks source link

1.0: Person fails to appear in "where is" talk UI for quest #2604

Closed JayH2971 closed 2 months ago

JayH2971 commented 6 months ago

Problem description:

User reports playing Azura's quest (t0c00y00) and Meridia's quest (10c00y00) and being unable to find the reward giver. Reward giver does not show up in Talk UI when asking peasants for location. The quest journal does not say where the reward giver is (which could be an alternate fix but this is a deeper engine issue). Not known when this problem began occurring, but this quest did function properly back during quest fixing, around 0.11.

Steps to reproduce:

  1. startquest t0c00y00 or 10c00y00

  2. Go to dungeon and kill enemy, then travel to indicated town in travel log.

  3. Ask peasants to find person who gives reward. Person does not appear in the Talk UI options. Person does appear in Talk UI after you enter the reward giver's house once.

John-Leitch commented 6 months ago

I've reproduced this locally. Not familiar with this code, but it looks (indirectly) related to this in TalkManager:

// only make it available for talk if...
if (!dialogPartnerIsSamePersonAsPersonResource &&   // Dialog partner is not the same person as the person resource talked about
    questResourceInfo.Value.availableForDialog &&   // It is not "hidden" by dialog link command
    questResourceInfo.Value.hasEntryInWhereIs &&    // It is meant to have an entry in the where is section (currently this is always true, TODO: check if we can get rid of this)
    IsPlayerInSameLocationWorldCell)                // If person resource is in same world map location as player
{
    listTopicPerson.Add(item);
}

Every condition evaluates to true, except IsPlayerInSameLocationWorldCell, which is false. Here's the code where I would expect it to be set to true:

/* - note: found a different way to do it via mapId
try
{
    IsPlayerInSameLocationWorldCell = ((Questing.Person)questResourceInfo.Value.questResource).IsPlayerInSameLocationWorldCell();
}
catch (Exception e)
{
}*/

Symbol assignedPlaceSymbol = person.GetAssignedPlaceSymbol();

if (assignedPlaceSymbol != null)
{
    Quest quest = GameManager.Instance.QuestMachine.GetQuest(questID);
    Place assignedPlace = quest.GetPlace(assignedPlaceSymbol);  // Gets actual place resource
    if (assignedPlace.SiteDetails.mapId == GameManager.Instance.PlayerGPS.CurrentMapID)
        IsPlayerInSameLocationWorldCell = true;
}

The commented out code is especially of interest. I haven't confirmed, but it seems like this might be the regression. Finally, to elaborate on the erroneous state, IsPlayerInSameLocationWorldCell is not set to true because GetAssignedPlaceSymbol returns null. I'd like to dig further into this and submit a PR, but it might be a couple days.

John-Leitch commented 6 months ago

Okay, turns out reverting to the commented out code does not work. IsPlayerInSameLocationWorldCell calls Quest.GetPlace with lastAssignedPlaceSymbol, which is null. In turn, GetPlace returns null, resulting in IsPlayerInSameLocationWorldCell returning false.

JayH2971 commented 2 months ago

It turns out the named NPC shows up in the "Tell Me About," not in the "Where Is" section. The "Tell Me About" provides the building name where the NPC is placed.

It's an unusual setup, but the quest works fine. No fix needed.

KABoissonneault commented 2 months ago

The NPC appears just fine, but it appears in the "Tell Me About" section rather than the usual "Where Is? -> People" section.

image

It's not terribly intuitive, but it matches classic. It's not really a DFU issue.

There is one issue I think where the NPC does appear under Where Is if the zone is loaded once, as mentioned in the OP

image

That part we could fix, but it's pretty minor