Hello!
I was wondering if you wouldn't mind helping me sort out the coding of the quest log window?
I wanted to make a tab in the window that also listed the player's inventory, but I wasn't sure the best practice for setting that up. I have been able to successfully make new tabs before that properly displayed different groups of quests, but I'm not quite sure how to configure it to display item information instead of quest information.
I assume it's a matter of changing the showActiveQuests to something referencing the items, but I'm unsure what that would be.
Thank you in advance <3
Listing Items in the Quest Window
Re: Listing Items in the Quest Window
Hi,
There are two ways to approach it:
1. Put the quest log window inside a larger set of UIs. This is the most common way to do it. Here's an example screenshot from Tortured Hearts, which uses the Dialogue System:
The quest log window is a child of a more general Journal window. The two tabs on the left are the quest log window's Active Quests and Completed Quests buttons. When either one is active, the quest log window is open. If the player clicks Companion Tracker or Notebook, it closes the quest log window and opens the corresponding different UI instead.
2. Alternatively, you could leave the quest log window as its own thing, and add an inventory tab to it. This would require a little more scripting. You could make a subclass of StandardUIQuestLogWindow and override the Repaint() method. (You may already have a subclass you can expand on.) If the player has selected the newly-defined inventory tab, Repaint() can draw the inventory. Otherwise you can call base.Repaint() to draw quests.
There are two ways to approach it:
1. Put the quest log window inside a larger set of UIs. This is the most common way to do it. Here's an example screenshot from Tortured Hearts, which uses the Dialogue System:
The quest log window is a child of a more general Journal window. The two tabs on the left are the quest log window's Active Quests and Completed Quests buttons. When either one is active, the quest log window is open. If the player clicks Companion Tracker or Notebook, it closes the quest log window and opens the corresponding different UI instead.
2. Alternatively, you could leave the quest log window as its own thing, and add an inventory tab to it. This would require a little more scripting. You could make a subclass of StandardUIQuestLogWindow and override the Repaint() method. (You may already have a subclass you can expand on.) If the player has selected the newly-defined inventory tab, Repaint() can draw the inventory. Otherwise you can call base.Repaint() to draw quests.
-
- Posts: 95
- Joined: Sun May 03, 2020 2:17 pm
Re: Listing Items in the Quest Window
Oh that is a good way to do it!
What then is the proper wording/coding to call the item information for the inventory UI?
Like how the quest tab has the showActiveQuests etc. what's that version for items. Is it just showItems?
What then is the proper wording/coding to call the item information for the inventory UI?
Like how the quest tab has the showActiveQuests etc. what's that version for items. Is it just showItems?
Re: Listing Items in the Quest Window
Which way were you thinking of going (1 or 2)?
-
- Posts: 95
- Joined: Sun May 03, 2020 2:17 pm
Re: Listing Items in the Quest Window
I think 1 would probably work well if I can configure the panels of the quest log window to fit right in the UI and all. That way I'll have more space for additional things as well.
Re: Listing Items in the Quest Window
It might require a little scripting to get it to look exactly the way you want, but the general idea is that the quest log window is a child of the larger UI. When the player clicks the active quests button, call the quest log window's Open() and ClickShowActiveQuestsButton() methods. When the player clicks the completed quests button, call Open() and ClickShowCompeltedQuestsButton(). When the player clicks the inventory button, call Close(), and show the inventory UI.
-
- Posts: 95
- Joined: Sun May 03, 2020 2:17 pm
Re: Listing Items in the Quest Window
Hi there, sorry, I'm still having trouble with this.
I added the basic standard UI quest log window to the dialogue manager canvas. To make it part of a bigger UI that would have the items and what not, do I need to ungroup all the bits and pieces and move them around into a different panel that will act as the final UI? Will that screw anything up in how everything is mapped and how the viewports and what not draw their information?
I added the basic standard UI quest log window to the dialogue manager canvas. To make it part of a bigger UI that would have the items and what not, do I need to ungroup all the bits and pieces and move them around into a different panel that will act as the final UI? Will that screw anything up in how everything is mapped and how the viewports and what not draw their information?
Re: Listing Items in the Quest Window
Hi,
As long as you move around the GameObjects instead of deleting them and adding them new, the quest log window will keep its references to them.
In general, you can move them wherever you want. If your own larger UI controls when they're visible, you can remove the quest log window's Animator and set the Show Animation Trigger and Hide Animation Trigger to blank strings. You'll still need to call the quest log window's Open() method when you make the quest log UI elements visible. The Open() method will tell the quest log window that it should show quest content.
As long as you move around the GameObjects instead of deleting them and adding them new, the quest log window will keep its references to them.
In general, you can move them wherever you want. If your own larger UI controls when they're visible, you can remove the quest log window's Animator and set the Show Animation Trigger and Hide Animation Trigger to blank strings. You'll still need to call the quest log window's Open() method when you make the quest log UI elements visible. The Open() method will tell the quest log window that it should show quest content.