QuestIndicatorManager with singleton QuestGiver
-
- Posts: 5
- Joined: Sun Sep 11, 2022 7:30 pm
QuestIndicatorManager with singleton QuestGiver
I’d like to attach a QuestGiver script to my QuestMachine prefab singleton, and use it as the sole source for giving quests. There’s a couple reasons for this:
1. Simplifies how we give quests. GiveQuest(“global”, “questName”), instead of having to put down the NPC name directly.
2.Only two places where data needs to be saved. The player, and the QuestGiver on the QuestMachine prefab (instead of having to save each QuestGiver NPC)
Of course there are several downsides to this system, but the one I want to address is that using this pattern disables my ability to use the QuestIndicatorManager/QuestIndicatorUI to highlight NPCs of interest. Is there any good way of getting this functionality back while using the singleton QuestGiver?
1. Simplifies how we give quests. GiveQuest(“global”, “questName”), instead of having to put down the NPC name directly.
2.Only two places where data needs to be saved. The player, and the QuestGiver on the QuestMachine prefab (instead of having to save each QuestGiver NPC)
Of course there are several downsides to this system, but the one I want to address is that using this pattern disables my ability to use the QuestIndicatorManager/QuestIndicatorUI to highlight NPCs of interest. Is there any good way of getting this functionality back while using the singleton QuestGiver?
Re: QuestIndicatorManager with singleton QuestGiver
Hi,
You can still use Quest Indicator Managers on NPCs of interest. You just need to use Set Indicator quest actions manually to tell those NPCs to show indicators.
You can still use Quest Indicator Managers on NPCs of interest. You just need to use Set Indicator quest actions manually to tell those NPCs to show indicators.
-
- Posts: 5
- Joined: Sun Sep 11, 2022 7:30 pm
Re: QuestIndicatorManager with singleton QuestGiver
Hi Tony,
I have a quest with a WaitingToStart SetIndicator action, but I think it's being intercepted when the scene starts by this line in MessageSystem.cs
I have a quest with a WaitingToStart SetIndicator action, but I think it's being intercepted when the scene starts by this line in MessageSystem.cs
Code: Select all
if (x.frameAdded == Time.frameCount) continue;
-
- Posts: 5
- Joined: Sun Sep 11, 2022 7:30 pm
Re: QuestIndicatorManager with singleton QuestGiver
I... kind of gave up on trying to do the single QuestGiver instance implementation, so I added a QuestGiver component to the applicable NPCs, and everything works except for one thing.
I'm using EasySave3, and quest indicators seem like they always load to their initial state when returning to the scene (like it's our first time visiting). The save system seems to be working because the NPC no longer has quests to offer. The indicator does goes away after talking to the NPC.
Edit: Occasionally it won't happen. possible race condition somewhere...
I'm using EasySave3, and quest indicators seem like they always load to their initial state when returning to the scene (like it's our first time visiting). The save system seems to be working because the NPC no longer has quests to offer. The indicator does goes away after talking to the NPC.
Edit: Occasionally it won't happen. possible race condition somewhere...
Last edited by PopQuizHotshot on Thu Sep 15, 2022 3:35 pm, edited 3 times in total.
Re: QuestIndicatorManager with singleton QuestGiver
Hi,
Sorry I haven't had a chance to reply. I'm working on a patch that makes that line no longer necessary. I'll try to post it here by the end of the day.
Sorry I haven't had a chance to reply. I'm working on a patch that makes that line no longer necessary. I'll try to post it here by the end of the day.
-
- Posts: 5
- Joined: Sun Sep 11, 2022 7:30 pm
Re: QuestIndicatorManager with singleton QuestGiver
I'm now preventing this from happening with a CustomQuestIndicatorManager subclass:PopQuizHotshot wrote: ↑Thu Sep 15, 2022 3:12 pm I... kind of gave up on trying to do the single QuestGiver instance implementation, so I added a QuestGiver component to the applicable NPCs, and everything works except for one thing.
I'm using EasySave3, and quest indicators seem like they always load to their initial state when returning to the scene (like it's our first time visiting). The save system seems to be working because the NPC no longer has quests to offer. The indicator does goes away after talking to the NPC.
Edit: Occasionally it won't happen. possible race condition somewhere...
Code: Select all
private IEnumerator DelayedRepaintCoroutine() {
yield return null;
Repaint();
}
protected override void OnDestroy() {
StopAllCoroutines();
base.OnDestroy();
}
Re: QuestIndicatorManager with singleton QuestGiver
Hi,
Are you using a QuestIndicatorSaver component on your QuestIndicatorManager? (And changing scenes using the save system?)
The Dialogue System Extras page has a SaveSystemPrefabs package that also works with Quest Machine, since they use the same save system. It has a preconfigured Save System prefab that handles scene transitions with a fade out -> loading screen -> fade in if that's any help.
Are you using a QuestIndicatorSaver component on your QuestIndicatorManager? (And changing scenes using the save system?)
The Dialogue System Extras page has a SaveSystemPrefabs package that also works with Quest Machine, since they use the same save system. It has a preconfigured Save System prefab that handles scene transitions with a fade out -> loading screen -> fade in if that's any help.
-
- Posts: 5
- Joined: Sun Sep 11, 2022 7:30 pm
Re: QuestIndicatorManager with singleton QuestGiver
Oh, I wasn't aware of the QuestIndicatorSaver! I'm currently on QuestMachine v1.2.17. Sorry, I probably should've started off with that.
Re: QuestIndicatorManager with singleton QuestGiver
Hi,
Please try backing up your project (just to be on the safe side) and then updating to the latest Quest Machine version so you can get QuestIndicatorSaver and all of the other improvements to Quest Machine. If that doesn't resolve the issue, let me know.
Please try backing up your project (just to be on the safe side) and then updating to the latest Quest Machine version so you can get QuestIndicatorSaver and all of the other improvements to Quest Machine. If that doesn't resolve the issue, let me know.