ORK Framework Support
Follow these steps to set up the Dialogue System with ORK Framework.
Import and Setup Files
- Import ORK Framework and the Dialogue System.
- Import the package <b>Third Party Support ► Makinom Support</b>. This will
unpack files into the folder <b>Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► Makinom Support</b>.
- Import the package <b>Third Party Support ► ORK Framework Support</b>. This will
unpack files into the folder <b>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 <b>Prefabs</b> 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 <b>Dialogue System ORK Bridge</b> 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.
- If you use Unity UI in ORK, you may also need to add a <b>Standard Dialogue UI ORK Bridge</b> component if you intend to support keyboard or joystick navigation. This fixes up the Unity UI EventSystem to support standard UI navigation during conversations, and then restores ORK's custom EventSystem settings when the conversation is done.
Saving and Loading Games
The <b>Dialogue System ORK Bridge</b> 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
Setup Conversations
Set up conversations through the Makinom schematic system, using the <b>Dialogue System → Start Conversation</b> .
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.
Code: Select all
Function | Returns | Description | Example
---------------------------------------------------|-----------|------------------------------------------|----------
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")`
`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")`
`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")`
`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 AutoMachine 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 AutoMachine on the GameObject named "Rock" and involve the player.