ORK Framework Support

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

ORK Framework copyright © Gaming is Love.

ORK Framework Integration Setup

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

Import and Setup Files

  1. Import ORK Framework and the Dialogue System.
  2. Import the package Third Party Support ► Makinom Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► Makinom Support. For details on Makinom integration, see Makinom Support.
  3. Import the package Third Party Support ► ORK Framework Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► ORK Framework Support.

Dialogue Manager Setup

Add a Dialogue Manager to your main menu scene.

  • The easiest way is to add the prefab from the Prefabs folder. You can customize it in the inspector or using the Dialogue Manager Setup Wizard (Tools → Pixel Crushers → Dialogue System → Wizards → Dialogue Manager).
  • Select the Dialogue Manager GameObject and add a Dialogue System ORK Bridge component (Component → Pixel Crushers → Dialogue System → Third Party → ORK Framework → Dialogue System ORK Bridge (Dialogue Manager)). This component handles data exchange between ORK Framework and the Dialogue System. It also enables the EventSystem's Send Navigation Events checkbox during conversations. This component has two functions:
    • It provides the integration's ORK Lua Functions, and
    • During conversations in which the player is the conversation actor, it pauses player controls. Recommended: Add a Dialogue Actor component to the player prefab, and set the Actor dropdown to Player.

Unity UI Event System

The MakinomEventSystem doesn't implement joystick or keyboard navigation. If you want to be able to navigate general Unity UI menus such as the Dialogue System's menus, there are settings to manage if Makinom adds an event system or not in ‘UI > UI System’ when the Unity UI system type is selected. You can either use Makinom’s default event system, not create one or spawn one using a prefab.

If you want to be able to navigate non-ORK menus with a joystick or keyboard, use a standard event system, not Makinom's event system. Makinom's event system sets itself up to use Makinom's Accept/Cancel keys. But you can accomplish the same thing by using a standard event system and assigning the same Accept/Cancel inputs to it.

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 Barks.

Setup Conversations

Set up conversations through the Makinom schematic system, using the Dialogue System → Start Conversation node.

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. You can enter them manually or select them through the "..." dropdown wizards in the section Custom > ORK.

Function Returns Description Example
Status - - -
orkGetStatus(combatant, value) Number Gets a combatant's status value Variable["hp"] = orkGetStatus("Player", "HP")
orkSetStatus(combatant, value) (nothing) Gets a combatant's status value orkSetStatus("Player", "HP", Variable["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")
orkGetQuestStatus(quest) String Returns the current status of a quest orkGetQuestStatus("Find the Underpants")
orkChangeQuestStatus(quest, status) (nothing) Changes the status of a quest orkChangeQuestStatus("Find the Underpants", "failed")
orkGetQuestTaskStatus(task) String Returns the current status of a quest task orkGetQuestTaskStatus("Open the Pants Drawer")
orkChangeQuestTaskStatus(task, 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")
orkGetItemQuantity(combatant, item) Number Returns true if a combatant has N items n = orkGetItemQuantity("Player", "Wolfskins")
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)
orkGetCurrency(combatant, currency) Number Gets the amount of currency gold = orkGetCurrency("Player", "Gold")
orkSetCurrency(combatant, currency, quantity) (nothing) Sets the amount of currency orkSetCurrency("Player", "Gold", 500)
Events - - -
orkStart(machine, startingObject) (nothing) Starts an Auto Machine on a GameObject* orkStart("bigCutsceneObject", "Player")

Notes:

  • Combatants: The special string "Player" (case-insensitive) always refers to the player/active leader combatant. You can also specify a blank string for the active leader.
  • Quest Status: Can be "inactive", "active", "finished", or "failed".
  • *orkStart: The first parameter must be the name of a GameObject that has an Auto Machine component. The second parameter is optional and may specify the name of the GameObject that is involved in the interaction. If the second parameter is a blank string, it will assume the player. For example, use this: orkStart("Rock", "") to start the Auto Machine on the GameObject named "Rock" and involve the player.

<< Third Party Integration