This article explains how to set up overhead quest indicators for NPCs. To see an example in action, examine the NPC named Sergeant Graves in DemoScene2.
1. Add some overhead bubbles (SpriteRenderers, UI images, whatever you like) as children of the NPC and set them inactive. Add a Quest State Indicator component to the NPC and assign the overhead bubbles. Make a note of their element number's -- for example, in the screenshot below Question Mark is Element 1.
Also note that the order of the indicators is important. Higher element numbers will take precedence over lower. So if the NPC has two quests and wants to show Question Mark for one quest but Exclamation Mark for another quest, it will show Exclamation Mark because its element number is higher.
2. Add a Quest State Listener component to the NPC. Set the Quest Name dropdown to a quest.
Then add elements to Quest State Indicator Levels. Each element specifies a quest state, optional conditions, and a quest indicator element number. When the quest is in the specified state and any optional conditions are true, the Quest State Listener will tell the Quest State Indicator to show the corresponding indicator. In the screenshot below, when the "Enemy Attack" quest's state is Grantable, it will show indicator number 1 (Question Mark):
There is also a similar section for specific quest entries (sub-tasks in quests) which you can set up in the same way.
[HOWTO] How To: Set Up Quest Indicators
[HOWTO] How To: Set Up Quest Indicators
- Attachments
-
- questStateListener.png (87.73 KiB) Viewed 1301 times
-
- Posts: 60
- Joined: Thu Mar 24, 2022 12:07 am
Re: [HOWTO] How To: Set Up Quest Indicators
This is amazing, thank you so much.
-
- Posts: 60
- Joined: Thu Mar 24, 2022 12:07 am
Re: [HOWTO] How To: Set Up Quest Indicators
Is there a way to set a quest indicator when the player has killed a certain amount of enemies?Tony Li wrote: ↑Wed Oct 19, 2022 9:55 am
1. Add some overhead bubbles (SpriteRenderers, UI images, whatever you like) as children of the NPC and set them inactive. Add a Quest State Indicator component to the NPC and assign the overhead bubbles. Make a note of their element number's -- for example, in the screenshot below Question Mark is Element 1.
I'm currently using the "Increment on Destroy" component and setting the quest state to "success" in a conversation on the condition that the player has killed enough monsters.
But it would be nice if the "completed quest" indicator could be there before the conversation started.
Thank you.