Modifying Quest Journal

Announcements, support questions, and discussion for Quest Machine.
Post Reply
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Modifying Quest Journal

Post by timbecile »

Hey Tony,

Now that I got Quest Machine working in my game, I wanted to expand the quest journal.

I'm trying to move the quest title out of the journal's Scroll Rect, and I'd like to add a spot where I can put the name of the quest giver on the UI.

looks like the quest journal script is a wrapper, so I'm not sure how to make that happen...
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modifying Quest Journal

Post by Tony Li »

Hi,

Don't let the wrapper throw you. It's just a subclass of the real class. Right-click on the real class name and select Go To Definition:
wrapper.png
wrapper.png (25.75 KiB) Viewed 1944 times

I strongly recommend making your own subclass. Don't modify UnityUIQuestJournalUI directly. Otherwise you'll lose your modifications when you update Quest Machine. (A new update with some bug fixes is pending release on the Asset Store even as I write this.)
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Modifying Quest Journal

Post by timbecile »

perfect! Thanks again Tony!
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modifying Quest Journal

Post by Tony Li »

Happy to help!
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Modifying Quest Journal

Post by timbecile »

ok, so I created a complete copy of the UnityUIQuestJournalUI, and added it to the JournalUI instead of the original, but now the journal won't open.

looks like the QuestMachineConfiguration script is looking for IQuestJournalUI (which my new method inherits from), but I can't add the new Journal UI to it. Also, FWIW, I can't add the original script there either now.
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modifying Quest Journal

Post by Tony Li »

Hi,

Please see: How To Assign Quest Machine UIs

As long as it's assigned, it should work.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Modifying Quest Journal

Post by timbecile »

wow! learn something new every day...
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modifying Quest Journal

Post by Tony Li »

Well, this is an obscure one. It's really just a shortcoming of the Unity editor, and a workaround for it.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Modifying Quest Journal

Post by timbecile »

one more question....how do I increment a counter through script?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modifying Quest Journal

Post by Tony Li »

Hi,

Get the quest, get its counter, and increment it:

Code: Select all

Quest quest = QuestMachine.GetQuestInstance("peskyRabbits");
QuestCounter counter = quest.GetCounter("numCarrots");
counter.currentValue++;
API References:
Post Reply