Diegetic Quest Log UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Alex95
Posts: 6
Joined: Tue Mar 23, 2021 8:13 pm

Diegetic Quest Log UI

Post by Alex95 »

Hello!
Apologies if this question has been covered, but I didn't see anything in the forums.
I am trying to let the player trigger and interact with the quest log that is displayed on a worldspace canvas. The idea is to have the quest log display on an in-game terminal.
Specifically, I would like the following to happen after the player selects the in-game terminal (selection would be handled with the Usable component, if possible, as I have other terminals in the world for conversations that use this method and I would like to keep interactions consistent ):
1. The camera zooms in to the terminal screen.
2. The quest log appears (using Basic Standard Quest Log UI) on the terminal screen and can be interacted with by the player.
3. IF the player clicks the Close button of the Basic Standard Quest Log UI, the quest log closes.
4. The camera returns to its default position (I am using the camera that is attached to the "Player" prefab from the example project, FYI)
I feel like this would be easy to achieve if I were starting a conversation, as I can use the Dialogue System Trigger component and conversation sequence commands and such, but I am not exactly sure what to do in the case where I am displaying a Quest Log. I saw that there are commands I can use if I wanted to create a script to find the quest log in the scene and use the Open function. But I am not sure how to put it all together to make it work.
Any advice would be appreciated!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Diegetic Quest Log UI

Post by Tony Li »

Hi,

Here's an example scene: (exported from Unity 2020)

DS_DiegeticQuestLogWindowExample_2021-04-08.unitypackage

It's based on DemoScene1, but when you interact with the Terminal it shows the quest log window instead of the regular terminal conversation.

A few notes about how I set it up:
  • Since the Terminal already had a world space canvas set up over its screen, I just added the quest log window to it.
  • The Terminal's Usable > OnUse() event tells the quest log window to Open().
  • The quest log window's OnOpen() event disables the player's controls and runs a Dialogue System Trigger named "Move Camera To Screen".
  • Move Camera To Screen plays a sequence that uses the MoveTo() command to move the camera to the screen. Using MoveTo() allows us to get around the restriction that the Camera() command always resets the camera when the sequence ends.
  • The quest log window's OnClose() event runs a Dialogue System Trigger named "Move Camera To Player".
  • Move Camera To Player uses MoveTo() to move the camera back. Then it re-enables the player's controls.
  • Alternatively, you could use Cinemachine to control the camera. In this case, just bump up the priority of the vcam that points to the terminal screen. This will make Cinemachine switch to that vcam and move the camera there.
Alex95
Posts: 6
Joined: Tue Mar 23, 2021 8:13 pm

Re: Diegetic Quest Log UI

Post by Alex95 »

Hello Tony,
Thank you so much for the example scene. It makes a lot of sense! It really helps me to learn the possibilities of the system. I've not found it easy, so I appreciate the help on this. Cheers!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Diegetic Quest Log UI

Post by Tony Li »

Glad to help! If any other questions come up, just let me know.
Post Reply