Event / Message on quest tracked / untracked in Journal

Announcements, support questions, and discussion for Quest Machine.
Post Reply
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

Event / Message on quest tracked / untracked in Journal

Post 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!
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

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

Post 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!
User avatar
Tony Li
Posts: 21928
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.)
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

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

Post 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?
User avatar
Tony Li
Posts: 21928
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

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

Post by mroshaw »

You really are amazing, thank you once again! :)
User avatar
Tony Li
Posts: 21928
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Glad to help!
Post Reply