RPG Kit Quest Tutorial

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

RPG Kit Quest Tutorial

Post by Tony Li »

This is the first version of a tutorial that will probably be in the next release of the Dialogue System documentation.

In this tutorial, we'll make a quest in Unitycoding's RPG Kit using the Dialogue System's RPG Kit Support features. It assumes that you've already:
  • Imported and configured RPG Kit.
  • Imported the Dialogue System.
  • Imported and configured the Dialogue System's RPG Kit Support package.
In the quest, the player must help the King's Tax Collector to collect 50 gold from a Merchant.

The script for the Tax Collector is:
  • Tax Collector: (If quest is unassigned) "Collect taxes from the merchant."
    • Player: "I'll return with the gold." (Activate the quest)
  • Tax Collector: (If quest is active) "Do you have the gold?"
    • Player: (If the player has 50 gold) "Here is the gold." (Remove 50 gold; finish the quest)
    • Player: (If the player doesn't have 50 gold) "Not yet."
  • Tax Collector: (If quest is over) "Thank you for helping the King."
    • Player: "You're welcome."
The script for the Merchant is:
  • Merchant: Hello."
    • Player: (If the quest is active) "I'm here to collect 50 gold for the King."
  • Player: (If the quest is unassigned or done) "Bye."

Tutorial Steps

1. In your dialogue database, add a quest:

Image

2. Create the Tax Collector conversation:

Image

In this conversation, set the Sequence, Conditions, and Script fields as shown below:

Image

Notes:
  • Use SetOverheadIcon() to change the Tax Collector's and Merchant's overhead icons.
  • You can use the Lua wizard to get and set quest states.
  • This example uses the new CurrentQuestState() and SetQuestState() Lua functions, but you can also set them manually: Quest["Taxes_for_the_King"].State = "active".
  • You can't use the Lua wizard to add RPG Kit Lua functions such as PlayerHasItem() and PlayerRemoveItem(), so you will have to add those manually.
3. Create the Merchant conversation:

Image

In this conversation, set the Sequence, Conditions, and Script fields as shown below:

Image

4. Add the Tax Collector and Merchant NPCs to the scene. Add an Overhead Icon UI. Configure an RPG Kit Conversation Trigger to run the NPC's conversation:

Image

They'll look similar to this in the game:

Image

And conversations will look similar to this:

Image


Testing & Debugging

If you set the Dialogue Manager's Debug Level to Info, the Console view will give you information as you talk with NPCs:

Image

The screenshot above was taken after collecting gold from the Merchant. You can see:
  • The RPG Kit Lua function PlayerAddItem("Gold", 50) gave 50 gold to the player.
  • The sequencer command SetOverheadIcon(none, Merchant) turned off the Merchant's overhead icon.
  • The sequencer command SetOverheadIcon(Exclamation, Tax Collector) changed the Tax Collector's overhead icon to the Exclamation icon.
If your conversation isn't using the correct dialogue entries, the Console may indicate the reason.

You can test RPG Kit Lua functions by adding a Lua Console to the scene:

Image

If your quest isn't working, the Lua Console can help you figure out why.

You can also use the Lua Console to reset the quest so you can run it again:

Image
wioluskaelk
Posts: 31
Joined: Fri Oct 02, 2015 6:01 pm
Location: Netherland/Poland
Contact:

Re: RPG Kit Quest Tutorial

Post by wioluskaelk »

Thanks ;D
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG Kit Quest Tutorial

Post by terrymorgan »

Ditto that, If you don't want these quests on screen go to the quest button and 'track' it, makes it disappear from screen.
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG Kit Quest Tutorial

Post by terrymorgan »

I'm not seeing where the 'ui.toggle' function is
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG Kit Quest Tutorial

Post by terrymorgan »

pic
Attachments
wheres_ui_toggle.jpg
wheres_ui_toggle.jpg (134.5 KiB) Viewed 2399 times
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPG Kit Quest Tutorial

Post by Tony Li »

Terry,

It looks like your Generic Unity UI Quest Log Window GameObject is missing its Unity UI Quest Log Window script. Can you compare your scene to the Loading scene in Assets/Dialogue System/Third Party Support/RPG Kit/Example?
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG Kit Quest Tutorial

Post by terrymorgan »

There are 2 dialog manager prefabs, the one in dialog system/prefabs and the one in /dialog system/3rd party/rpg kit,
had the wrong one.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPG Kit Quest Tutorial

Post by Tony Li »

Got it. Glad it was a quick thing to fix. If you notice any issues as you go through the tutorial, please let me know.
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG Kit Quest Tutorial

Post by terrymorgan »

My player collected the taxes but pocketed them. :--}
Post Reply