Page 1 of 1

RPG Kit Quest Tutorial

Posted: Sat Feb 13, 2016 8:27 pm
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

Re: RPG Kit Quest Tutorial

Posted: Sun Feb 14, 2016 8:18 am
by wioluskaelk
Thanks ;D

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 1:57 pm
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.

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 2:20 pm
by terrymorgan
I'm not seeing where the 'ui.toggle' function is

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 2:21 pm
by terrymorgan
pic

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 3:38 pm
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?

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 7:54 pm
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.

Re: RPG Kit Quest Tutorial

Posted: Thu Feb 18, 2016 8:07 pm
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.

Re: RPG Kit Quest Tutorial

Posted: Wed Feb 24, 2016 9:57 am
by terrymorgan
My player collected the taxes but pocketed them. :--}