QM version of Quest State Listener

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Ollymuk
Posts: 39
Joined: Wed Oct 14, 2020 12:59 pm

QM version of Quest State Listener

Post by Ollymuk »

Hi

I've been working with DS and using the Quest State Listener to listen for status changes to a quest (going Active) and then using On Enter State to enable a prefab on a quest item. Making a bit arrow appear above the quest item.

Now that I've moved to QM, the Quest State Listener doesnt work. I guess because it's using a DS database and doesn't support a QM database.

If I want a prefab to appear above a quest object, what's the right way of doing it in QM?

Olly
Ollymuk
Posts: 39
Joined: Wed Oct 14, 2020 12:59 pm

Re: QM version of Quest State Listener

Post by Ollymuk »

Well, I've found that I can use the Scene Event > On Execute inspector element of the Dialogue Entry to trigger the prefab enabled state to True.

That works, but some how it doesn't feel nice.

I'd like to do it via quest triggers so that I can save my mind.

Olly
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QM version of Quest State Listener

Post by Tony Li »

Hi,

Here's how to do it in Quest Machine:

The quest object should have a Quest Machine ID. If it doesn't have a Quest Giver or Quest Entity component, add a Quest Machine ID component and set the ID.

Add a Quest Indicator Manager component to the quest object. Assign the Quest Indicator UI prefab to it.

In the quest's States > Active > Actions list, add a Set Indicator action. Specify the quest object's ID, and select a quest indicator state from the list (e.g., the Talk indicator).

When you accept the quest, it will send a message to all objects that have the quest object's ID to tell its Quest Indicator Manager to show the specified indicator.

If you want to use a different image than the ones in the Quest Indicator UI prefab, make a copy of the Quest Indicator UI prefab, customize its images, and assign the copy to the quest object's Quest Indicator Manager.
Ollymuk
Posts: 39
Joined: Wed Oct 14, 2020 12:59 pm

Re: QM version of Quest State Listener

Post by Ollymuk »

Thanks for that Tony.

What if my prefab is sprite based? Is there a way to assign a gameobject prefab rather than a UI prefab? Sorry, should have made that clear originally.

Olly
Ollymuk
Posts: 39
Joined: Wed Oct 14, 2020 12:59 pm

Re: QM version of Quest State Listener

Post by Ollymuk »

Dont worry Tony. I'll recreate the sprite as a UI object.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: QM version of Quest State Listener

Post by Tony Li »

The Quest Journal UI prefab uses SpriteRenderers, not UI Images. They can use anything, though. Each indicator is just a child GameObject. It can be a animated 3D model if you want.
Post Reply