Using Quests to Gain Access to Doors

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Using Quests to Gain Access to Doors

Post 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?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Quests to Gain Access to Doors

Post 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.
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Re: Using Quests to Gain Access to Doors

Post by nitrox32 »

Thanks. I'll give it a try.
Post Reply