Page 1 of 1

Makinom 2 & ORK 3 Integration Available

Posted: Sun Mar 06, 2022 7:20 pm
by Tony Li
The Dialogue System Extras page has updated integrations for Makinom 2 and ORK 3.

The online manual will be updated for Makinom 2 and ORK 3 in the Dialogue System version 2.2.26 release. In the meantime, here's the documentation for the updated integrations:


Makinom Setup
Follow these steps to set up the Dialogue System with Makinom:
  • 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.
  • Add a Dialogue System Makinom Bridge component to your Dialogue Manager.
    • If you want to use Makinom's language settings for the Dialogue System's localization language, tick Use Makinom Language.
    • If you want to tie into Makinom's save system, tick Use Makinom Save System. If a Dialogue System Save System component is present, it will use the Save System. Otherwise it will use PersistentDataManager.
  • Use Dialogue System Makinom Nodes in your schematics.
  • Use Makinom Lua Functions in your conversations.
  • If you're also using ORK Framework, see ORK Framework Support (below).

Makinom Nodes
Once you've imported the Makinom Support package, you can use these nodes when you write schematics:

Code: Select all

Schematic Node            | Description
--------------------------|------------
Bark                      | Makes a character bark a dialogue entry from a conversation.
Bark Text                 | Makes a character bark a text string, which can be localized.
Check Conversation Active | Checks if a conversation is currently active.
Check Lua                 | Checks if a Lua condition is true.
Lua                       | Runs Lua code, optionally storing the result in a Makinom variable. Use to set Lua variables, quest states, etc.
Play Sequence             | Plays a Dialogue System sequence.
Show Alert                | Shows a Dialogue System alert message.
Start Conversation        | Starts a conversation.

Makinom Lua Functions

The Dialogue Sysatem Makinom Bridge adds these Lua functions, which you can enter manually or select through the "..." dropdown wizards in the section Custom > Makinom.

Code: Select all

Lua Function                    | Description
--------------------------------|------------
makiGetBool(variable)           | Returns the value of a Makinom bool variable.
makiGetInt(variable)            | Returns the value of a Makinom int variable.
makiGetFloat(variable)          | Returns the value of a Makinom float variable.
makiGetString(variable)         | Returns the value of a Makinom string variable.
makiSetBool(variable, value)    | Sets the value of a Makinom bool variable.
makiSetInt(variable, value)     | Sets the value of a Makinom int variable.
makiSetFloat(variable, value)   | Sets the value of a Makinom float variable.
makiSetString(variable, value)  | Sets the value of a Makinom string variable.
makiStart(machine, startingObj) | Starts an Auto Machine with a specified starting object*.
In ORK, to start an Auto Machine with the player or a specific combatant, use orkStart.

Re: Makinom 2 & ORK 3 Integration Available

Posted: Sun Mar 06, 2022 7:25 pm
by Tony Li
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.