Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

PowerQuest

A Nifty 2D Adventure Toolkit for Unity · By Powerhoof

An extension to 9Verbs interface to support scrollable dialog trees

A topic by StickGrinder created Feb 26, 2021 Views: 263 Replies: 4
Viewing posts 1 to 5
(3 edits) (+1)

Admin edit: This is now included as standard in the PowerQuest template projects! 

Hello everyone, first post here on the board.

I'm pretty new to Unity and PowerQuest, but I started getting the hang of it and I "extended" PQ 0.12.4 a bit to support a fixed-height scrollable GUI for dialogs, useful for sword-fighting-like long lists of options.

The result should be something like this:

Caveats

  1. This package can be imported over a fresh PQ 0.12.4 installation, still untested on newer version (should probably work but you risk to overwrite some newer functions)
  2. The package contains an extended dialog tree between Dave and Barney for demo purposed. I did it pretty quickly and it may have rough edges.
  3. It is my very first time exporting a package for Unity, let alone doing something with the framework, let alone working on someone else's project so it may be perfectly possible that this will explode setting your house on fire... I would suggest to try it out on a brand new project OR version your code before trying it out.

You can download the updated package here.
For a quick how-to, see this post.

Feedback and criticism more than welcome!
Thanks

(1 edit)

Basic how-To

NOTE: This howto is for an updated version, please read further posts for fresh info.

----------

Setting the number of lines to display

Select the DialogTree GUI in PowerQuest Main tab. You should see this section in the inspector:

An extension to the GuiDialogTreeComponent script allows you to set a "Max visible item" property.
Leave it to 0 to get the standard behavior; set it to a non-zero positive integer to set the maximum number of lines you want displayed.

How to switch between cut-text and wrapped text for long lines

An extension to QuestText script that allows you to activate a "Cut long text" function. This option is attached to the Text element in the DialogTree GUI prefab (edit it!):


Select the Text item and search for this in the inspector:

When the "Cut long text" option is active, all the lines that exceed "Wrap width" (above) will be truncated (words-safe) and an ellipsis will be added at the end. The default behavior would be for the lines to wrap, which it totally an option but may change the height of the GUI area in unwanted ways. The options is on by default, but you can disable it editing the DialogTree GUI prefab, selecting the Text gameobject and setting the option there.

(+1)

Update

Here is an updated 0.2 version of the package, addressing some feedback I got on Discord.

If fixes a couple bugs that may occur when you switched dialog trees options on and off, plus it has a cleaner implementation that should have less problems with future PQ updates.

This also introduce a simpler way to select the wrap/cut text behavior without the need to open and change the GUI prefab. Now you can select the preferred behavior for long lines directly from the GUI options:



The default behavior is to cut long texts and keep the interface vertical size. You can just activate "Wrap Text" option to make the text wrap instead (in that case, the GUI height will increase depending on the total lines to be shown.

Hopefully I'll be able to release a new version that will be 100% update-safe.
Many thanks to Dave for his support :)

Feedback welcome!

Awesome stuff! Great to see some community contributions :D

Note: This is now included as standard in the PowerQuest template projects!