Hello,
We have implemented Quest Machine into our project and have been running with it for a while. However, we are adding new features that trigger events through script and not user input. I am attempting to figure out how to change the currently selected "Active Quest" in the opened Quest Journal through script, instead of mouse input. If I can nail down the function that is called to pass the item's array ID to the change function that displays newly selected Active Quest details on the right and changes the highlighted Active on the left, I should be able to handle the rest.
Thanks in advance!
Change Active Quest Selection With Script
Re: Change Active Quest Selection With Script
Hi,
The UnityUIQuestJournalUI has a protected property selectedQuest:
You can make a subclass of UnityUIQuestJournalUI and add a method to set selectedQuest and repaint the UI:
The UnityUIQuestJournalUI has a protected property selectedQuest:
Code: Select all
protected Quest selectedQuest { get; set; }
Code: Select all
public class MyQuestJournalUI : UnityUIQuestJournalUI
{
public SelectQuest(Quest quest)
{
selectedQuest = quest;
Repaint();
}
// Alternate version:
public SelectQuest(int i)
{
if (questJournal != null && 0 <= i && i < questJournal.questList.Count)
{
selectedQuest = questJournal.questList[i];
Repaint();
}
}
}
Re: Change Active Quest Selection With Script
This is more than I expected, Tony. You have the best product support and always go above and beyond.
Re: Change Active Quest Selection With Script
Thanks! Glad to help!
Note: I typed the example above directly into my reply. It's missing niceties such as "using" statements at the top, and it may have typos.
Note: I typed the example above directly into my reply. It's missing niceties such as "using" statements at the top, and it may have typos.