Page 1 of 1

Using Quests to Gain Access to Doors

Posted: Sun Jul 28, 2019 1:01 pm
by nitrox32
I would like to use quests to allow doors to open. For instance, I have a trigger that opens a new scene however I only want the trigger to be active only after a quest is complete. Is there a way to do this?

Re: Using Quests to Gain Access to Doors

Posted: Sun Jul 28, 2019 1:52 pm
by Tony Li
If your doors have no special visual indicators -- for example, they just have a Dialogue System Trigger set to OnTriggerEnter, and they use the LoadLevel() sequencer command to switch to a new scene -- then configure the Condition > Quest Conditions section to require specific quest state(s).

If it has a visual indicator -- such as a Usable component that can be selected with the player's Selector, or an open door vs. closed door model -- then you'll need to change the component or GameObject when you update the quest. For example, say the player has a quest to bring an access key to the security engineer so she can lower the force field and let your team into the enemy base. The force field is a GameObject that can be active (raised) or inactive (lowered). When the player turns in the quest, use the SetActive() sequencer command:
  • Dialogue Text: "Here's the access key."
  • Script: SetQuestState("Get Access Key", "success")
  • Sequence: SetActive(Force Field, false)
In this case, you'll probably also want to add a saver component, such as an Active Saver, to remember the force field state in saved games and scene changes.

Re: Using Quests to Gain Access to Doors

Posted: Sun Jul 28, 2019 2:42 pm
by nitrox32
Thanks. I'll give it a try.