ORK Framework

This page describes how to set up the Dialogue System with ORK Framework and how to use them together. (ORK Framework is required.)

ORK Framework copyright © Gaming is Love.


ORK Framework Setup

Follow these steps to set up the Dialogue System with ORK Framework.

Import and Setup Files

The example uses modified versions of the tutorial demo's scenes 0 Main Menu and 1 Town.

  1. Import ORK Framework and the Dialogue System.
  2. Import the package ORK Framework/demo. If you want to play the example, you must import this before the next step. You may also need to add the tutorial scenes in Tutorial Resources/Scenes to your project's build settings.
  3. Import the package Third Party Support/ORK Framework Support. This will unpack files into the folder Third Party Support/ORK Framework. It will also overwrite the following ORK demo files in Tutorial Resources\Scenes:
    • 0 Main Menu (scene)
    • 1 Town (scene)

Setup Dialogue Manager

Add a Dialogue Manager to your main menu scene. (This has already been added to the example's 0 Main Menu.)

  • Use the Dialogue Manager Setup Wizard (Window > Dialogue System > Wizards > Dialogue Manager) or create the Dialogue Manager GameObject manually.
  • Select the Dialogue Manager GameObject and add a Dialogue System ORK Bridge component (Component > Dialogue System > Third Party > ORK Framework > ORK Bridge (Dialogue Manager)). This component handles data exchange between ORK Framework and the Dialogue System.
  • If you're going to use the "New UI" (i.e., Unity UI) in ORK, also add a Unity UI Dialogue UI ORK Bridge component if you intend to support keyboard or joystick navigation.

Saving and Loading Games

The Dialogue System ORK Bridge component hooks into ORK Framework's save and load system. It automatically saves and loads Dialogue System data in your ORK saved games.

Setup Barks

Set up barking NPCs the usual way in the Dialogue System. See How to Play Barks.

Setup Conversations

Set up conversations through the ORK event system, using the Dialogue System Steps -> Start Conversation step.


Example Scene

To run the example, play Tutorial Resources\Scenes\0 Main Menu.

In the example, Green Pants barks using the Dialogue System. When you interact with him, he runs a Dialogue System conversation. In this conversation, you can donate gold in exchange for a faction boost, and you can donate blood (which reduces HP) in exchange for a Magic Potion. The conversation demonstrates how to use the ORK Lua Functions to control ORK within conversations.


ORK Lua Functions

The Dialogue System ORK Bridge component registers several functions with the Lua environment. These functions provide an interface into ORK. You can use them in your dialogue entry Scripts and Conditions to control ORK during conversations.

Function Returns Description Example
Variables - - -
ORKGetBool(variable) Boolean Gets the value of a Boolean variable b = ORKGetBool("tokenDropped")
ORKGetFloat(variable) Number Gets the value of a float variable f = ORKGetFloat("generatorWatts")
ORKGetString(variable) String Gets the value of a string variable s = ORKGetString("passcode")
ORKSetBool(variable, value) (nothing) Sets the value of a Boolean variable ORKSetBool("tokenDropped", true)
ORKSetFloat(variable, value) (nothing) Sets the value of a float variable ORKSetFloat("generatorWatts", 2.1)
ORKSetString(variable, value) (nothing) Sets the value of a string variable ORKSetString("passcode", "happymeal")
Status - - -
ORKGetStatus(combatant, value) Number Gets a combatant's status value hp = ORKGetStatus("Player", "HP")
ORKSetStatus(combatant, value) (nothing) Gets a combatant's status value ORKGetStatus("Player", "HP", hp - 10)
Faction - - -
ORKChangeFaction(combatant, faction) (nothing) Changes a combatant's faction ORKChangeFaction("NPC_green", "Enemies")
ORKGetFactionSympathy(combatant, faction) Number Gets a combatant's sympathy to a faction s = ORKGetFactionSympathy("NPC_blue", "Orcs")
ORKSetFactionSympathy(combatant, faction, value) (nothing) Sets a combatant's sympathy to a faction ORKSetFactionSympathy("NPC_blue", "Orcs", -100)
ORKAddFactionSympathy(combatant, faction, value) (nothing) Adds to a combatant's sympathy ORKAddFactionSympathy("NPC_blue", "Elves", 10)
ORKSubFactionSympathy(combatant, faction, value) (nothing) Subtracts from a combatant's sympathy ORKSubFactionSympathy("NPC_blue", "Orcs", 10)
Quests - - -
ORKHasQuest(quest) Boolean Returns true if the player has a quest b = ORKHasQuest("Kill Evil Pants")
ORKAddQuest(quest) (nothing) Adds a quest to the player ORKAddQuest("Find the Underpants")
ORKRemoveQuest(quest) (nothing) Removes a quest from the player ORKRemoveQuest("Find the Underpants")
ORKChangeQuestStatus(quest, status) (nothing) Changes the status of a quest ORKChangeQuestStatus("Find the Underpants", "failed")
ORKChangeQuestTaskStatus(quest, status) (nothing) Changes the status of a quest task ORKChangeQuestStatus("Open the Pants Drawer", "finished")
Inventory - - -
ORKHasItem(combatant, item) Boolean Returns true if a combatant has an item b = ORKHasItem("Player", "Underpants")
ORKAddItem(combatant, item) (nothing) Adds an item to a combatant ORKAddItem("Player", "Magic Potion")
ORKRemoveItem(combatant, item) (nothing) Removes an item from a combatant ORKRemoveItem("Player", "Underpants")
ORKHasItemQuantity(combatant, item, quantity) Boolean Returns true if a combatant has N items b = ORKHasItemQuantity("Player", "Wolfskins", 5)
ORKAddItemQuantity(combatant, item, quantity) (nothing) Adds N items to a combatant ORKAddItemQuantity("Player", "Magic Potion", 3)
ORKRemoveItemQuantity(combatant, item, quantity) (nothing) Removes N items from a combatant ORKRemoveItemQuantity("Player", "Wolfskins", 5)
ORKGetMoney(combatant, currency) Number Gets the amount of currency gold = ORKGetMoney("Player", "Gold")
ORKSetMoney(combatant, currency, quantity) (nothing) Sets the amount of currency gold = ORKSetMoney("Player", "Gold", 500)
Events - - -
ORKStartEvent(event, startingObject) (nothing) Starts an ORK event on a GameObject ORKStartEvent("bigCutsceneObject", "Player")

Notes:

  • Combatants: The special string "Player" (case-insensitive) always refers to the player combatant.
  • Quest Status: Can be "inactive", "active", "finished", or "failed".

ORK Event Steps

You can use the following event steps in your ORK events:

Event Description
Conversations -
Start Conversation Starts a Dialogue System conversation
Barks -
Barks Makes a character bark
Sequences -
Play Sequence Plays a Dialogue System sequence
Alerts -
Show Alert Shows a Dialogue System alert message
Show Variable Alert Shows a Dialogue System alert message using an ORK string value, which lets you use ORK variables
Quests -
Get Quest State Gets the state of a quest or quest entry
Set Quest State Sets the state of a quest or quest entry
Variables -
Get DS Variable Gets the value of a Dialogue System variable and stores it in an ORK variable
Set DS Variable Sets the value of a Dialogue System variable
Lua -
Lua Runs Lua code in the Dialogue System's Lua environment, optionally storing the result in an ORK variable

<< Third Party Support