void InformQuestTurnInPoint() { QuestGiver target = quest.QuestTurnInPoint.GetComponent <QuestGiver>(); if (target.Quest != null) //if the target has a quest to give { string questTurnInPointName = quest.QuestTurnInPoint.name; GameObject questTurnInPointGo = quest.QuestTurnInPoint.gameObject; //Below will construct the path of the Conversation_NAME-5 string result = StringHelperClass.ConstructConversationPath(questTurnInPointName); //Below will load a QuestGiver's (that is the QuestTurnInPoint of this Quest) Conversation_NAME-5, dialogueManager.SetupNewDialogue(questTurnInPointGo, result); //We then need to change the TurnInPoint's QuestGiver's NPC_UI to show a question mark... NPC_UI turnInPointNPC_UI = questTurnInPointGo.GetComponentInChildren <NPC_UI>(); turnInPointNPC_UI.ChangeQuestStatus("?", true); Debug.Log("Changed ? to true from QuestGiver"); //...and update boolean value so he can act correctly target.amTurnInPoint = true; //...and send him the Quest that this object is holding. target.ForeignQuest = quest; } }
/*All Conversation_NAME-5's are to load a conversation that acknowledges * that it is the Turn-in point of a Quest. Thus, you must turn in a Quest * before you can start a Quest on the same QuestGiver. */ void InformQuestTurnInPoint() { if (Quest.QuestTurnInPoint.name != "Bird") //the bird is special => he dies and never comes back. { QuestGiver target = Quest.QuestTurnInPoint.GetComponent <QuestGiver>(); if (target.Quest != null && this.Quest.QuestStatus) //if the target has a quest to give && the assigning QuestGiver's quest is complete(just needs to be turned in) { string questTurnInPointName = Quest.QuestTurnInPoint.name; GameObject questTurnInPointGo = Quest.QuestTurnInPoint.gameObject; //Below will construct the path of the Conversation_NAME-5 which acknowledges that this is the turn in point of another's completed quest string result = StringHelperClass.ConstructConversationPath(questTurnInPointName); //Below will load a QuestGiver's (that is the QuestTurnInPoint of this Quest) //Conversation_NAME-5, dialogueManager.SetupNewDialogue(questTurnInPointGo, result); //We then need to change the TurnInPoint's QuestGiver's NPC_UI to show a question mark NPC_UI turnInPointNPC_UI = questTurnInPointGo.GetComponentInChildren <NPC_UI>(); turnInPointNPC_UI.ChangeQuestStatus("?", true); //Debug.Log("Changed ? to true from QuestGiver"); //And update boolean value so he can act correctly target.amTurnInPoint = true; } } }
void Start() { #region Systems HUD = GameObject.FindWithTag("HUD").GetComponent <HUD>(); //Debug.Log(this + " found HUD? => " + HUD); QuestLog = GameObject.FindWithTag("QuestLog").GetComponent <QuestList>(); //Debug.Log(this + " found Questlist? => " + QuestLog); EndlessPlatformSystem = GameObject.FindWithTag("EndlessPlatformSystem").GetComponent <EndlessPlatformSystem>(); #endregion #region PLAYER PlayerGameObject = GameObject.FindWithTag("Player"); //Debug.Log(this + " found Player's GO? => " + PlayerGameObject.name); PlayerController = PlayerGameObject.GetComponent <PlayerController>(); //Debug.Log(this + " found Player's controller? => " + PlayerController.name); PlayerTransform = PlayerGameObject.GetComponent <Transform>(); PlayerRigidBody = PlayerGameObject.GetComponent <Rigidbody>(); PlayerAnimator = PlayerGameObject.GetComponent <Animator>(); #endregion #region NPC's CarlTransform = GameObject.FindWithTag("Carl").GetComponent <Transform>(); //Debug.Log(this + " found Carl's Transform? => " + CarlTransform.name); BirdTransform = GameObject.FindWithTag("Bird").GetComponent <Transform>(); //Debug.Log(this + " found Bird's Transform? => " + BirdTransform.name); IpTransform = GameObject.FindWithTag("Ip").GetComponent <Transform>(); //Debug.Log(this + " found Ip's Transform? => " + IpTransform.name); EdTransform = GameObject.FindWithTag("Ed").GetComponent <Transform>(); //Debug.Log(this + " found Ed's Transform? => " + EdTransform.name); #endregion #region NPC's UI Carl_UI = CarlTransform.GetComponentInChildren <NPC_UI>(); Bird_UI = BirdTransform.GetComponentInChildren <NPC_UI>(); Ip_UI = IpTransform.GetComponentInChildren <NPC_UI>(); Ed_UI = EdTransform.GetComponentInChildren <NPC_UI>(); #endregion }