Hi there,
As the title says I still have a quest tracking even after it's been failed/completed. What do I need to set to make it dissapear?
I'm triggering the fail/success with the following code:
PixelCrushers.DialogueSystem.DialogueLua.SetQuestField(questName, "State", "failure");
Thanks for the help.
BB
Quest tracker still there after failure/success
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: Quest tracker still there after failure/success
Hi,
Use this code instead:
QuestLog.SetQuestState() also updates the tracker, whereas DialogueLua.SetQuestField only sets the Lua field. More info: Setting Quest State.
Use this code instead:
Code: Select all
using PixelCrushers.DialogueSystem;
QuestLog.SetQuestState(questName, QuestState.Failure);
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: Quest tracker still there after failure/success
Great! Thanks Tony.
While I'm at it is there a way to stop failed quests turning up in the completed tab?
While I'm at it is there a way to stop failed quests turning up in the completed tab?
Re: Quest tracker still there after failure/success
The quest log window considers quests in the "success" or "failure" states as completed. The easiest way not show failed quests is to set their state to a string that the quest log window doesn't recognize. QuestLog.SetQuestState() also accepts string values. For example:bluebuttongames wrote:While I'm at it is there a way to stop failed quests turning up in the completed tab?
Code: Select all
QuestLog.SetQuestState(questName, "hiddenFailed");
Code: Select all
public class MyQuestLogWindow : UnityUIQuestLogWindow {
public override OnQuestListUpdated() {
// Rebuild the Quests[] array without failed quests:
var list = new List<QuestInfo>(Quests);
list.RemoveAll(q => QuestLog.IsQuestFailed(q.Title));
Quests = list.ToArray();
// Then update the window with the new Quests[] array:
base.OnQuestListUpdated();
}
}