Update quest by reading a book?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
joshbk2
Posts: 2
Joined: Tue Nov 24, 2020 12:28 am

Update quest by reading a book?

Post by joshbk2 »

Hello, I am new to qm, I managed to get it integrated with dialogue system thanks to the docs but I'm making a quest to read a ledger when I read the ledger I want to update the quest state but I don't see anywhere in the docs how to do that can anyone help me?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Update quest by reading a book?

Post by Tony Li »

Hi,

Thanks for using Quest Machine! Use Quest Machine message system.

Your quest presumably has a quest node named something like "Read Book". Add a Message quest condition. Set it to Message:"Read", Parameter:"Book" (without quotes).

When the player reads the book, use PixelCrushers.MessageSystem() to send that message. In C#:

Code: Select all

PixelCrushers.MessageSystem.SendMessage(this, "Read", "Book");
If you don't want to do any scripting, you can add a Quest Control component to the scene. It has a method SendToMessageSystem that you can hook up in the inspector -- for example, to a UnityEvent such as a UI Button's OnClick event. Set its string field to "Read:Book" (without quotes).
joshbk2
Posts: 2
Joined: Tue Nov 24, 2020 12:28 am

Re: Update quest by reading a book?

Post by joshbk2 »

Thank you, I got it working using the script method. Thanks for the quick reply.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Update quest by reading a book?

Post by Tony Li »

Glad to help!
Post Reply