RPG Kit Support

This page will show you how to integrate the Dialogue System with Devion Games' RPG Kit 3 to add conversations, barks, cutscene sequences, and Dialogue System-managed quests. (RPG Kit 3 is required.)

RPG Kit copyright © Devion Games.

RPG Kit Support Features

The support package adds these features:

  • RPGKitLua component that adds Lua functions to interface with RPG Kit.
  • RPGKitPlayerDialogueActor component that replaces DialogueActor for the player to use its RPG Kit name and portrait.
  • RPGKitDialogueSystemData component to serialize data that RPG Kit can include in its save system.

RPG Kit integration also depends on the Devion Games Item & Inventory System integration package, so make sure to import that, too.

RPG Kit Setup

Use these steps to set up the Dialogue System in RPG Kit.

  1. Import these 3 packages:
  • Plugins ► Pixel Crushers ► Common ► Third Party Support ► Devion Inventory Support
  • Plugins ► Pixel Crushers ► Dialogue System ► Third Party Support ► Devion Inventory Support
  • Plugins ► Pixel Crushers ► Dialogue System ► Third Party Support ► RPG Kit Support
  1. Follow the integration instructions for Devion Games Item & Inventory System.
  2. Add a Dialogue Manager prefab to your Start scene.
  3. Add RPGKitPlayerDialogueActor components to your player character prefabs. This component will tell the Dialogue System to use the player character's RPG Kit name and portrait in dialogue UIs.
  4. The easiest way to set up dialogue is to add a Selector to the player, and a Usable and Dialogue System Trigger to the NPC. On the Dialogue System Trigger, tick Show Cursor During Conversation and Pause Game During Conversation.

Save System Setup

To incorporate the Pixel Crushers Save System to save the player's position, etc., follow these steps:

  • Import Plugins / Pixel Crushers / Dialogue System / Scripts / DialogueSystemAssemblyDefinitions.unitypackage.
  • Inspect the Assets / Devion Games / Inventory System / Scripts / Runtime / DevionGames.InventorySystem assembly definition file and add a reference to the PixelCrushers assembly definition:
  • In the RPG Kit window, enable the inventory system's Auto Save:
  • Edit InventoryManager.cs. At the end of the "public static void Save(string key)" method, add this line:
PlayerPrefs.SetString(key + ".PixelCrushers", PixelCrushers.SaveSystem.Serialize(PixelCrushers.SaveSystem.RecordSavedGameData()));
This is the main Save System class.
Definition SaveSystem.cs:17
static SavedGameData RecordSavedGameData()
Records the current scene's savers' data into the SaveSystem's internal saved game data cache.
Definition SaveSystem.cs:817
static string Serialize(object data)
Returns a serialized version of an object using whatever serializer is assigned to the SaveSystem (JS...
Definition SaveSystem.cs:1120
Definition MessageEventsEditor.cs:7

At the end of the "public static void Load(string key)" method, add this line:

PixelCrushers.SaveSystem.ApplySavedGameData(PixelCrushers.SaveSystem.Deserialize<PixelCrushers.SavedGameData>(PlayerPrefs.GetString(key + ".PixelCrushers")));
static void ApplySavedGameData(SavedGameData savedGameData)
Applies the saved game data to the savers in the current scene.
Definition SaveSystem.cs:855
Holds the data for a saved game.
Definition SavedGameData.cs:16
  • Configure the Dialogue Manager in the Start scene as shown below:
  • UNtick the Save System component's Save Current Scene checkbox.
  • Add Saver components. For example, inspect your player prefab and add a Position Saver. Set a unique Key value.

RPG Kit Lua Functions

The RPGKitLua component adds the following Lua functions. You can access them in Conditions and Script "..." wizards in the Custom/RPGKit submenu.

Lua Function Returns Description Example
dgGetPlayerName() String Get player's name dgGetPlayerName()
dgGetPlayerProfession() String Get player's profession dgGetPlayerProfession()
dgApplyDamage(subject, attribute, value) none Applies damage to a stat on a subject* dgApplyDamage("", "Health", 10)
dgAddModifier(subject, statName, value) none Adds a modifier to a stat on a subject* dgAddModifier("", "Strength", 3)
dgRemoveModifiers(subject, statName) none Removes modifiers from a stat on a subject* dgRemoveModifier("Skeleton King", "Dexterity")
dgAddEffect(subject, effect) none Adds an effect to a subject* dgAddEffect("", "Dazed")
dgRemoveEffect(subject, effect) none Removes an effect from a subject* dgRemoveEffect("Traveler", "Poisoned")

If subject is blank, uses the player character.


<< Third Party Integration