Making a skill selection screen with Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 194
Joined: Mon Jul 01, 2019 1:21 pm

Making a skill selection screen with Dialogue System

Post by lostmushroom »

Hey, I'm wondering if it's possible to use Dialogue System for a skill selection screen. Say you have a variable for total number of points, and you want to assign those points to a variety of skills; strength, intelligence, dexterity, etc. Basically the kind of thing you'd find in most RPGs.

Is it possible to make this out of the box or would it require some custom coding?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a skill selection screen with Dialogue System

Post by Tony Li »

Someone did this with the Dialogue System; I don't remember where I saw it, though. I think this is how they did it:

- Added Number variables "SkillPointsLeft", "Str", "Int", "Dex", etc.

- Dialogue Text:

Code: Select all

Skill Points Left: [var=SkillPointsLeft]
Strength: [var=Str]
Intelligence: [var=Int]
Dexterity: [var=Dex]
They used a custom dialogue UI with response buttons positioned next to "Strength:", "Intelligence:", etc. The first two were positioned next to "Strength: [var=Str]" and looked like this:
  • Response 0:
    • Menu Text: "-"
    • Description: "Subtracts 1 from Str and adds it to SkillPointsLeft."
    • Conditions: Variable["Str"] > 3
    • Script: Variable["Str"] = Variable["Str"] - 1; Variable["SkillPointsLeft"] = Variable["SkillPointsLeft"] + 1
  • Response 1:
    • Menu Text: "+"
    • Description: "Adds 1 to Str and subtracts it from SkillPointsLeft."
    • Conditions: Variable["Str"] < 18 and Variable["SkillPointsLeft"] > 0
    • Script: Variable["Str"] = Variable["Str"] + 1; Variable["SkillPointsLeft"] = Variable["SkillPointsLeft"] - 1
lostmushroom
Posts: 194
Joined: Mon Jul 01, 2019 1:21 pm

Re: Making a skill selection screen with Dialogue System

Post by lostmushroom »

Great, this looks like pretty much what I had in mind.

I'm not entirely sure how to make a custom UI...but I'll figure it out :D Thanks!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making a skill selection screen with Dialogue System

Post by Tony Li »

You might start with the Basic Standard Dialogue UI. Add an instance to the Dialogue Manager's Canvas, and assign it to the Dialogue Manager's Dialogue UI field. Remove the Scroll Rect and layout elements from the Response Menu Panel GameObjects. Then duplicate 2 copies of the response button template for each skill (one for +, one for -). Inspect the Standard UI Menu Panel component. Unassign the Button Template. Instead, assign the duplicates to the Buttons list. You'll want to move the buttons around so they line up with the skills. If you have questions about any of it, just let me know.
Post Reply