Logics between quest and item?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
joeylu
Posts: 111
Joined: Sun May 17, 2020 1:07 pm

Logics between quest and item?

Post by joeylu »

Hi Tony, I'm trying to figure out how does Quest and Item in dialogue system relates to each other, based on your documentations, I'm able to create an Item and a Quest in "Quests/Items" tab from the dialogue editor.
But there's nothing to be configured between a quest and an item, for instance, set a quest to collect 5 coins(coin item)
Does that means that there's nothing really binding a quest to item(s) in logic? we have to keep track a quest (set its state, displaying how many coins has been collected toward a quest, etc) manually, like using lua CurrentQuestState or any other methods?
Does dialogue system tracks a quest with items? tks
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Logics between quest and item?

Post by Tony Li »

Hi,

That's correct -- there's nothing binding quests and items. In a dialogue database, items are just data records. If your project uses an actual inventory system such as Opsive's Ultimate Inventory System, or More Mountains' Inventory Engine, or your own set of scripts, you'll typically use Lua functions to access that inventory system. The Dialogue System has integrations with several assets that have inventory systems, not just UIS and IE mentioned above, but also inventory systems in game framework assets such as RPG Builder, ORK RPG Framework, and Adventure Creator.

If your project doesn't use an inventory system, you can use the item data records in the dialogue database. For example, define a Boolean field named "Owned" that you can set true when the player owns an item, or a Number field named "Count" that you can increment when the player picks up an item.
joeylu
Posts: 111
Joined: Sun May 17, 2020 1:07 pm

Re: Logics between quest and item?

Post by joeylu »

got it, how about Quest Machine? I have brought that asset as well, does Quest Machine have the same implementation or any differences that I should be noted?
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Logics between quest and item?

Post by Tony Li »

Hi,

Quest Machine also works similarly. It has integrations with other inventory systems. It doesn't include an inventory system of its own. You can also write your own integration if you've written your own inventory system.
joeylu
Posts: 111
Joined: Sun May 17, 2020 1:07 pm

Re: Logics between quest and item?

Post by joeylu »

I have the corgi engine so instead purchase another inventory plugin, I'm going to give the "Inventory Engine" a try.
In general, can you help me to sort it out all the basis setup procedures? My guess is that I need to import one of the Inventory Engline third part support package from dialogue system? then use lua in conversation or use DialogueLua class in script to access (set, get) the Inventory Engline item values? tks
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Logics between quest and item?

Post by Tony Li »

Hi,

You got the idea. Here are the setup instructions: Inventory Engine Integration

Briefly, import two "Inventory Engine.unitypackage" packages. They're in these folders in your project:
  • Plugins > Pixel Crushers > Common > Third Party Support
  • Plugins > Pixel Crushers > Dialogue System > Third Party Support
Then see the How To Set Up Scenes section to set up the components.

And use the Inventory Engine Lua Functions in your conversation nodes' Conditions and Script fields to work with Inventory Engine. You can also use the [lua(code)] tag in quest text to show item counts in the quest HUD and quest log window. For example:
  • Quest Name: Pick 5 Apples
  • Entry 1: [lua( mmGetQuantity("MainInventory", "Apple") )] / 5 Picked
Also helpful:

How To: Set Up Quests Without Conversations
joeylu
Posts: 111
Joined: Sun May 17, 2020 1:07 pm

Re: Logics between quest and item?

Post by joeylu »

Perfect, that helps a lot, thanks Tony
User avatar
Tony Li
Posts: 22133
Joined: Thu Jul 18, 2013 1:27 pm

Re: Logics between quest and item?

Post by Tony Li »

Glad to help!
Post Reply