//Check task progression void CheckTasks() { if (player.demo_ItemInventory.Count == 5) { QuestChartDemo.SetQuest(2, false); } QuestChartDemo.CheckTaskCompletion(VD.nodeData); }
//The dialogue uses an Action Node to call this function //This method retrieves the Extra Variables of a node //Then uses its contents to modify the default comment of a Dialogue node before we get to it //GetExtraVariables and Update Comment: Remember the dialogue doesn't necessarily require to be active, only loaded. public void ModifyText() { string newText; Dictionary <string, object> options = VD.GetExtraVariables(VD.assigned.assignedDialogue, 0); List <string> keys = new List <string>(options.Keys); int randomPick = Random.Range(0, keys.Count); newText = (string)options[keys[randomPick]]; VD.SetComment(VD.assigned.assignedDialogue, 0, 0, newText); QuestChartDemo.CylinderGuyAddInteraction(randomPick); }
//Unsuscribe from everything, disable UI, and end dialogue //Called automatically because we subscribed to the OnEnd event public void EndDialogue(VD.NodeData data) { CheckTasks(); VD.OnActionNode -= ActionHandler; VD.OnNodeChange -= UpdateUI; VD.OnEnd -= EndDialogue; dialogueContainer.SetActive(false); VD.EndDialogue(); VD.SaveState("VIDEDEMOScene1", true); //Saves VIDE stuff related to EVs and override start nodes QuestChartDemo.SaveProgress(); //saves OUR custom game data }