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:
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!