So I am currently using both Quest Machine and Dialogue System for a split-screen game. I have followed most of the logic I could find on the forums, specifically this thread: https://www.pixelcrushers.com/phpbb/vie ... f=3&t=4349
My basic setup is that each player has their own UI panel, which is where they have the necessary individual dialogue and quest related components. I am using Rewired for inputs which is all working great. That forum thread above didn't quite cover the quest machine components so I thought I would ask a few questions here. So far I have Player 1, Player 2, NPC 1 for P1, and NPC 1 for P2 as actors.
To start, I want the game to have shared bigger quests, and then smaller individual quests that they could get from various NPCs. The game starts by giving a shared quest to both players. Now I found this code to give each player the quest:
Code: Select all
public Quest questAsset;
public QuestJournal questJournal;
void Start()
{
// Make a copy of the quest for the quester:
var questInstance = questAsset.Clone();
// Add the copy to the quester and activate it:
var questerTextInfo = new QuestParticipantTextInfo(questJournal.id, questJournal.displayName, questJournal.image, null);
questInstance.AssignQuester(questerTextInfo);
questInstance.timesAccepted = 1;
questJournal.deletedStaticQuests.Remove(StringField.GetStringValue(questInstance.id));
questJournal.AddQuest(questInstance);
questInstance.SetState(QuestState.Active);
QuestMachineMessages.RefreshUIs(questInstance);
}
Code: Select all
SetQuestNodeState("LeavingHome","Find Sarah","success")
I will likely have a few more questions as I continue integrating this!
Thanks!