Page 1 of 1

Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 3:52 pm
by mroshaw
Hi again!

I have a minimap and "Quest Givers" show up at icons when I enable or disable a Game Object on the NPC. I was looking at the APIs and Messaging to try to find an event or message that I could use to activate/deactivate that Game Object on a Quest Giver, based on whether they had any active quests being tracked in the journal.

I couldn't find anything that would serve the purpose. Any ideas?

Sincere thanks again for your help!

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 3:54 pm
by mroshaw
Annnnd of course, the moment I send this, I come across "Quest Track Toggle Changed"!

Do pardon me - move along, nothing to see here!

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 4:14 pm
by Tony Li
Ain't that always the way it happens? :-)

(BTW, you can use QuestMachineMessages.QuestTrackToggleChangedMessage to avoid using a string literal in your code.)

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 4:28 pm
by mroshaw
Actually, I do have a follow on question, if that's okay?

I've added a "Message Events" component to my Quest Giver. In there, I've set:

Code: Select all

Required Sender: None
Required Target: None
Message: Quest Track Toggle Changed
Parameter: None
And added in OnMessage(MessageArgs) a handler function.

This doesn't ever get triggered. If, however, I set the "Parameter" property of the "Message Events" to a valid Quest Id StringAsset, it DOES get triggered.

I thought all properties of "Message Events" were optional, bar "Message" of course?

I just want to put a listener on my NPC to keep an ear out for changes that impact him / her and perform some function.

Is that not how it works?

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 4:50 pm
by Tony Li
It was an oversight in MessageEvents. Here's a patch that allows the parameter to be blank:

PixelCrushers_MessageEventsPatch_2022-03-12.unitypackage

This fix will also be in the next regular Quest Machine release.

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 4:53 pm
by mroshaw
You really are amazing, thank you once again! :)

Re: Event / Message on quest tracked / untracked in Journal

Posted: Sat Mar 12, 2022 7:31 pm
by Tony Li
Glad to help!