Page 1 of 1

Modifying Quest Journal

Posted: Mon Nov 30, 2020 3:10 pm
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...

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 4:38 pm
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 1953 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.)

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 4:52 pm
by timbecile
perfect! Thanks again Tony!

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 5:01 pm
by Tony Li
Happy to help!

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 6:35 pm
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.

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 7:55 pm
by Tony Li
Hi,

Please see: How To Assign Quest Machine UIs

As long as it's assigned, it should work.

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 8:28 pm
by timbecile
wow! learn something new every day...

Re: Modifying Quest Journal

Posted: Mon Nov 30, 2020 8:48 pm
by Tony Li
Well, this is an obscure one. It's really just a shortcoming of the Unity editor, and a workaround for it.

Re: Modifying Quest Journal

Posted: Tue Dec 01, 2020 4:33 pm
by timbecile
one more question....how do I increment a counter through script?

Re: Modifying Quest Journal

Posted: Tue Dec 01, 2020 4:49 pm
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: