The value of HUD Text -> Body Text in the active node of the active quest through the script
The value of HUD Text -> Body Text in the active node of the active quest through the script
Is it possible to get the value of HUD Text -> Body Text in the active node of the active quest through a script?
Re: The value of HUD Text -> Body Text in the active node of the active quest through the script
Hi,
It's possible for more than one node to be active at a time. For example, if the quest asks the player to collect 3 apples or 5 strawberries, the apples and strawberries nodes would both the active at the same time.
To get a list containing all of the active HUD content, use Quest.GetContentList():
Then you can loop through the list to get just the body text:
It's possible for more than one node to be active at a time. For example, if the quest asks the player to collect 3 apples or 5 strawberries, the apples and strawberries nodes would both the active at the same time.
To get a list containing all of the active HUD content, use Quest.GetContentList():
Code: Select all
QuestJournal journal = QuestMachine.GetQuestJournal();
Quest quest = journal.FindQuest("Your Quest ID");
List<QuestContent> hudContent = quest.GetContentList(QuestContentCategory.HUD);
Code: Select all
foreach (QuestContent content in hudContent)
{
if (content is BodyTextQuestContent)
{
Debug.Log("Body Text: " + content.runtimeText);
}
}