Page 1 of 1
Update quest by reading a book?
Posted: Tue Nov 24, 2020 1:09 am
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?
Re: Update quest by reading a book?
Posted: Tue Nov 24, 2020 8:28 am
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).
Re: Update quest by reading a book?
Posted: Tue Nov 24, 2020 8:06 pm
by joshbk2
Thank you, I got it working using the script method. Thanks for the quick reply.
Re: Update quest by reading a book?
Posted: Tue Nov 24, 2020 8:14 pm
by Tony Li
Glad to help!