ORK Integration questions

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dlevel
Posts: 130
Joined: Wed Nov 16, 2016 6:17 pm

ORK Integration questions

Post by dlevel »

I have some questions regarding ORK Integration and Quests.

So I want to use Dialogue system to add all the quests of my game, my main framework is ORK, i have everything there. I understand how it handles the questions and how to give items. My question is, how do I make 1 NPC have multiple quests/dialogues in it, and give them to the play by order? some examples:

1. Quest1 - Find materials and craft a weapon

a) Player speaks with NPC1 and accepts the job to go find materials.
b) Player Comes back, gives materials and accepts a job to craft a weapon with the rewards he got.
c) Player comes back with the crafting weapon, gets gold. Quest finished.
(This is a problem because i see on your ORK Integration example, it just starts a conversation with GreeConversation, how do i start a quest there? what is the sequence?)
2. Quest2 - go hunt

a) NPC1 (again) gives him an other quest that unlocked because we finished the quest : 1. Quest - Find materials and craft a weapon
b) we take that quest and we finish that too.

3. Quest3 - Find Rabbit Quest4 - Kill Spiders

a) Now that we finished Quest2, we have 2 more quests that we can get them at once.
b) we accept both or 1 of them and we go do that quest.



So those are on top of my mind, i am very confused and i need some help on those :S
edit: Also just to mention, i m exporting the database from Articy and import the xml with the converter, so it has the dialogues separated (do i miss something here?)
thank you.
User avatar
Tony Li
Posts: 20544
Joined: Thu Jul 18, 2013 1:27 pm

Re: ORK Integration questions

Post by Tony Li »

Hi!
dlevel wrote:I have some questions regarding ORK Integration and Quests.

So I want to use Dialogue system to add all the quests of my game, my main framework is ORK, i have everything there. I understand how it handles the questions and how to give items. My question is, how do I make 1 NPC have multiple quests/dialogues in it, and give them to the play by order? some examples:

1. Quest1 - Find materials and craft a weapon

a) Player speaks with NPC1 and accepts the job to go find materials.
b) Player Comes back, gives materials and accepts a job to craft a weapon with the rewards he got.
c) Player comes back with the crafting weapon, gets gold. Quest finished.
(This is a problem because i see on your ORK Integration example, it just starts a conversation with GreeConversation, how do i start a quest there? what is the sequence?)
As with any new system, the first time is going to take the longest. I'll break it down here, but please let me know if you have any questions.

For (a): Let's say you've named the first quest "Find Materials". Since you're using articy, in the dialogue fragment where the player accepts the job, set the output pin's expresso code to:

Code: Select all

SetQuestState("Find Materials", "active")
This will set the quest's state to active. Although articy will highlight the expresso as invalid (since articy doesn't have a SetQuestState function), it will run just fine in the Dialogue System. (See here and here for a brief rundown of these functions.)

(Side note: In the next release, I'll add ORK event steps for controlling quests in ORK events. Currently this is the list of Dialogue System ORK events. So, currently, in an ORK event you'd add a Lua step and use SetQuestState as shown above. The rest of this post will continue to describe how to control quests in dialogue.)

For (b): Let's say the player must fetch 3 Iron Bars. In the dialogue fragment where the player trades the materials for the job to craft a weapon, set the input pin's expresso code to:

Code: Select all

ORKHasItemQuantity("player", "Iron Bar", 3)
This will only allow the NPC to use this dialogue fragment if the player has 3 Iron Bars.

Set the output pin's expresso code to:

Code: Select all

ORKRemoveItemQuantity("player", "Iron Bar", 3)
SetQuestState("Find Materials", "success")
SetQuestState("Craft a Weapon", "active")
This will remove 3 Iron Bars from the player, set the materials quest to success, and set the craft quest to active.

For (c): In the dialogue fragment where the player turns in the weapon (say, a Sword), set the input pin to:

Code: Select all

ORKHasItem("player", "Sword")
This will only allow the NPC to use this dialogue fragment if the player has a Sword.

You can combine conditions on the input pin. For example, you might only want to use this dialogue fragment if the "Craft a Weapon" quest is active. If so, change the expresso code to:

Code: Select all

ORKHasItem("player", "Sword") and CurrentQuestState("Craft a Weapon") == "active"
And set the output pin to:

Code: Select all

ORKRemoveItem("player", "Sword")
ORKSetMoney("player", "Gold", 50 + ORKGetMoney("player", "Gold"))
SetQuestState("Craft a Weapon", "success")
This will remove the Sword from the player, give him 50 gold, and set the craft quest to success.

There's so much more you can do with this, too, once you get comfortable with the basics. Here are some ideas:
  • Use the ShowAlert() Lua command to show a gameplay alert such as "Quest Accepted: Find Materials".
  • Combine "Find Materials and "Craft a Weapon" into a single quest where each part is a quest entry (sub-task).
  • Use a quest tracker HUD to show the player's progress in collecting iron bars (e.g., "1/3 Bars Collected").
dlevel wrote:2. Quest2 - go hunt

a) NPC1 (again) gives him an other quest that unlocked because we finished the quest : 1. Quest - Find materials and craft a weapon
b) we take that quest and we finish that too.
Here are two options. (Take your pick.)

Option #1:
In articy, put all of the NPC's dialogue fragments for all quests in a single dialogue. Use conditions on the input pins to route the conversation to the right dialogue fragment based on the current quest states.

Option #2:
  • Write two dialogues in articy: one for the find materials/craft weapon quests, another for the hunt quest.
  • In Unity, add a Conversation Triggers to your NPC. Select the find materials/craft weapon dialogue. Set the Condition > Quest Condition to "Craft a Weapon" + everything except success.
  • Add a second Conversation Trigger. Select the hunt dialogue. Set the Condition > Quest Condition to "Craft a Weapon" + success.
I just realized you're probably using the "Start Conversation" ORK event step. In this case, you won't use Conversation Triggers. Instead, use "Lua" event steps to get quest states using the CurrentQuestState() function, and then branch in your ORK event to 2 different "Start Conversation" event steps based on the returned value.
dlevel wrote:3. Quest3 - Find Rabbit Quest4 - Kill Spiders

a) Now that we finished Quest2, we have 2 more quests that we can get them at once.
b) we accept both or 1 of them and we go do that quest.
Use the same techniques as above. Use CurrentConversationState() on the input pins to make certain dialogue fragments available or unavailable, and use SetQuestState() on output pins to update quest states.

dlevel wrote:edit: Also just to mention, i m exporting the database from Articy and import the xml with the converter, so it has the dialogues separated (do i miss something here?)
thank you.
Before importing an Articy dialogue into Unity, make sure there's a connection from the dialogue's entry point to one or more dialogue fragments. The Dialogue System's Articy Converter will link the START node to these dialogue fragments. Take a look at the example articy project in Examples/Feature Demo/Articy Feature Demo. It's in a zip file. That articy project as a whole is a bit outdated -- the project in Prefabs/Articy Template is a much better starter template -- but the Feature Demo project demonstrates how to set up a dialogue so the START node is linked properly. If you open the resulting dialogue database file in Unity, you should be able to go to the Conversations tab and select the conversations from the dropdown menu in the upper left.


Sorry, I tend toward information overload. Take your time and get each piece down in turn. If you get stuck on anything or have any questions, please let me know. I'm here to help!
dlevel
Posts: 130
Joined: Wed Nov 16, 2016 6:17 pm

Re: ORK Integration questions

Post by dlevel »

Thank you for all this! Tomorow i will study al this step by step.

And I m so happy that you will add steps for ORK to control quests, because I havent started questing for my game yet and that will help a lot! that means that i will import from articy all the quests/dialogues, but i will control the status and progress of quest inside ORK? please explain to me how it will work because it will change my workflow :) Taht would be dreamy for me, i m so much more familiar with ORK
User avatar
Tony Li
Posts: 20544
Joined: Thu Jul 18, 2013 1:27 pm

Re: ORK Integration questions

Post by Tony Li »

I just added an updated ORK Framework Support package to the Dialogue System Extras page. It adds two event steps: Get Quest State and Set Quest State. You can use these to control quests in your ORK events.

I'm uploading the updated documentation now.
dlevel
Posts: 130
Joined: Wed Nov 16, 2016 6:17 pm

Re: ORK Integration questions

Post by dlevel »

Hi Tony,

Never seen a dev to support like this. really thank you.

Will get into this today and come back to you for reporting :)

edit: if understand correctly (so i start with the right boundaries), now i activate and deactivate the quest from ORK, and i can reward the player inside ork or remove items directly from the event in ORK?

also i let people in ORK Forum know about this addition :)
User avatar
Tony Li
Posts: 20544
Joined: Thu Jul 18, 2013 1:27 pm

Re: ORK Integration questions

Post by Tony Li »

Thanks! I'm afraid I often forget to visit the ORK Forum to keep up to date there.

Yes, you can control quests and rewards from ORK events. You'll probably want a passing familiarity with both ways of controlling quests -- through ORK events and through Lua functions inside conversations -- so you can choose which one(s) will best fit your workflow.

You have your work cut out for you to get a handle on articy:draft, the Dialogue System, integrating articy and the Dialogue System, and integrating the Dialogue System and ORK. It's a really powerful combination but a lot pipeline to work out at first. So if you have questions about any piece of the workflow, let me know and I'll try to help out.
Post Reply