This page describes how to set up the Dialogue System with BLINK's RPG Builder. (RPG Builder is required.)
RPG Builder copyright © BLINK.
The RPG Builder integration requires RPG Builder 2.0.7.1+ and Dialogue System 2.2.33+ or the integration package on the Dialogue System Extras page.
Check the Dialogue System Extras page for updated integration packages.
Import two unitypackages:
This will unpack files into:
The RPG Builder integration provides these features:
Follow these steps to add the Dialogue System integration to the RPG Builder editor window:
Follow these steps to edit the Main Menu scene for Dialogue System integration:
Optional: A very basic quest log window named Basic Standard UI Quest Log Window Variant is in the UI Prefabs subfolder. You can duplicate this prefab, customize its appearance, and assign it to the DialogueManager_RPGBuilder's Instantiate Prefabs component > Prefabs list in place of the original. If you use a different prefab instead of this one, add a StandardUIQuestLogWindowDisplayPanel component to it, add a Canvas Group to the main panel, and assign the Canvas Group to the component.
Notes about Dialogue Manager: The DialogueManager_RPGBuilder prefab is a variant of the Dialogue System's default Dialogue Manager prefab. It has the following changes:
You may want to make a new prefab variant of the DialogueManager_RPGBuilder prefab, and add your prefab variant to the Main Menu scene instead of the original. This way you can customize it without worrying about overwriting your customizations if you import an updated integration package. If you plan to use RPG Builder's Character Loader feature, also add the prefab variant to your gameplay scenes.
RPGB UIs need a Display Panel component. This includes dialogue UIs with the DS integration. The Basic Standard Dialogue UI Variant prefab included with the integration is already set up with a Display Panel. If you want to use a different UI as a starting point instead of customizing Basic Standard Dialogue UI Variant:
Similarly, if you don't want to use the Basic Standard UI Quest Log Window Variant prefab, add a Display Panel to your quest log window, and untick Add Event System If Needed.
After setting up the editor and Main Menu scene, if you want to quickly see basic Dialogue System functionality in action in RPG Builder's default Demo scene, see the Demo Objects section. Then return to Gameplay Scene Setup below to set up your own scenes.
Note: John Stairs RPG Camera & Controller
If you're using John Stairs' MMO controller, you'll also need to add a Dialogue System Events component to your player prefab. Configure the OnConversationStart() event to disable the RPGControllerMMO component. Configure OnConversationEnd() to re-enable it. If you're using the ARPG controller, you don't need to use Dialogue System Events.
In your gameplay scenes, you can set up InteractableObjects, NPCs, etc., to play barks or conversations, and to check and update quest states. In your conversation and Dialogue System Triggers, you can use RPG Builder Lua Functions to interact with RPG Builder.
Use InteractableObjects for objects such as signs or NPCs that the player can talk to directly. (For NPCs that will use RPG Builder's NPC Interaction Panel, see NPC Setup.)
To see an example, add the Signpost_Bubble_Trigger_CautionBears prefab to your gameplay scene. It's configured like this:
When the player enters its trigger collider, it will show a one-line conversation in an overhead text bubble:
If you want to run RPG Builder Game Actions in conversations, you can do the following:
To add a "Play Conversation" Game Action to RPG Builder – for example to configure items to play conversations when they're used – see RPG Builder Code Customization.
To configure an NPC to play a Dialogue System conversation or bark instead of RPG Builder dialogue:
Interactive Conversation
If you select Has Interaction Conversation, the NPC will play a Dialogue System conversation when the player selects the NPC Interaction Panel's dialogue option. By default, it will use the dialogue UI assigned to the Dialogue Manager's Display Settings. You can override this by adding an Override Dialogue UI component to the NPC prefab.
Interactive Bark
If you select Has Interaction Bark, the NPC will play a bark when the player selects the NPC Interaction Panel's dialogue option. Make sure to add a bark UI to the NPC prefab so it's spawned with a bark UI. You can add a Dialogue Actor component and assign a bark UI to it, or add a bark UI child directly to the prefab.
Idle Bark
If you select Has Idle Bark, the NPC will bark lines from a conversation at a specified frequency. This occurs independently from interactive barks or conversations. You must add a Dialogue System For Entity component to the NPC prefab. Make sure to also add a bark UI to the NPC prefab so it's spawned with a bark UI. You can add a Dialogue Actor component and assign a bark UI to it, or add a bark UI child directly to the prefab.
The integration provides these helper components to facilitate setting up Dialogue System quests:
Combat Entity Event: Add to a CombatEntity to expose an OnDeath() UnityEvent. You can connect this UnityEvent to a Dialogue System Trigger to do things such as updating a quest state or incrementing a variable.
Dialogue System Item Events: Exposes UnityEvents when the player gains or loses a specific type of item. You can also specify a list of items that will trigger a quest UI update when the player gains or loses an item in the list.
If you want to quickly see some basic Dialogue System functionality after completing RPG Builder Support Setup and Main Menu Scene Setup, follow these steps:
The NPC offers these quests:
You can type the following Lua functions directly into Conditions and Script fields, or use the "..." dropdown wizards to access them from the Custom → RPG Builder dropdown submenu.
In Lua functions, all names refer to entry names, not display names, unless otherwise specified.
Lua Function | Description |
---|---|
PLAYER | - |
rpgGetPlayerName() | Returns the player's display name. |
rpgGetPlayerRace() | Returns the display name of the player's race. |
rpgGetPlayerGender() | Returns the name of the player's gender. |
rpgGetPlayerClass() | Returns the display name of the player's class. |
rpgGetPlayerLevel() | Returns the player's level. |
rpgAddCharacterExperience(amount) | Adds character experience. |
STATS | - |
rpgGetStat(statName) | Returns the current value of a stat. |
FACTION | - |
rpgGetEntityStanceToFaction(entityName, otherFactionName) | Given an entity's name (or blank for player) and other faction, returns the name of the entity's stance toward the other faction. |
rpgChangeFaction(entityName, factionName) | Changes an entity's faction. |
rpgAddFactionPoints(factionName, amount) | Adds points to a faction's stance to the player. |
rpgRemoveFactionPoints(factionName, amount) | Removes points to a faction's stance to the player. |
rpgResetFactionPoints(factionName) | Resets a faction's points. |
INVENTORY | - |
rpgGetEmptySlotsCount() | Returns the number of empty slots in the player's inventory. |
rpgGetItemAmount(itemName) | Returns the amount of an item that the player has. |
rpgAddItem(itemName, amount, automaticallyEquip:bool) | Adds an amount of an item to the player's inventory. |
rpgRemoveItem(itemName, amount) | Removes an amount of an item from the player's inventory. |
rpgAddCurrency(currencyName, amount) | Adds an amount of a type of currency to the player. |
rpgRemoveCurrency(currencyName, amount) | Removes an amount of a type of currency from the player. |
ABILITIES | - |
rpgIsAbilityKnown(abilityName) | Returns true if an ability is known, otherwise false. |
rpgGetAbilityRank(abilityName) | Returns the current rank of an ability. |
rpgAddAbility(abilityName) | Adds an ability. |
rpgRankUpAbility(abilityName, talentTreeName) | Ranks up an ability in a talent tree. |
TALENT TREES | - |
rpgGetTreePoints(talentTree) | Returns the current number of points available in a talent tree. |
rpgAddTreePoints(talentTree, amount) | Adds points to a talent tree. |
SKILLS | - |
rpgIsSkillKnown(skillName) | Returns true if a skill is known, otherwise false. |
rpgGetSkillLevel(skillName) | Returns the current level of a skill. |
rpgAddSkill(skillName) | Adds a skill. |
rpgGainLevel(skillName, amount) | Gives the player levels in a skill. |
rpgAddSkillExperience(skillName, amount) | Gives the player experience points in a skill. |
RECIPES | - |
rpgGetRecipeRank(recipeName) | Returns the player's current rank with a recipe (or zero if not learned yet). |
rpgCanRankUpRecipe(recipeName, treeName) | Returns true if player can rank up recipe (has points, ranks available, & meets requirements). |
rpgRankUpRecipe(recipeName, treeName) | Ranks up a recipe in a talent tree. If the player doesn't know the recipe yet, this teaches the recipe. |
ENTITIES | - |
rpgEnterCombat(entityName) | Makes an entity enter combat mode. |
rpgPlayCombatEffect(entityName, effectName, rank) | Starts an RPG Effect on an entity, where effectName is the effect's entry name and rank is a number. |
RPG BUILDER QUESTS | - |
rpgProposeQuest(questName) | Opens RPG Builder's quest proposal window. |
rpgAcceptQuest(questName) | Accepts an RPG Builder quest. |
rpgTurnInQuest(questName) | Turns in an RPG Builder quest. |
rpgAbandonQuest(questName) | Abandons an RPG Builder quest. |
rpgIsQuestOnGoing(questName) | Returns true if a quest is ongoing. (Note capitalization of function name.) |
rpgIsQuestCompleted(questName) | Returns true if a quest is in the completed state. |
rpgIsQuestTurnedIn(questName) | Returns true if a quest is in the turned-in state. |
rpgIsQuestAbandoned(questName) | Returns true if a quest is in the abandoned state. |
INTERACTABLE OBJECTS | - |
rpgSetInteractableObjectState(objectName, state) | On a GameObject named objectName, set Interactable Object's state to Ready, OnCooldown, or Unavailable. |
rpgUseInteractableObject(objectName) | Uses an Interactable Object on the named GameObject. |
INTERACTABLE OBJECTS | - |
rpgOpenPanel(panelName) | Opens an RPG Builder panel (see below). |
rpgClosePanel(panelName) | Closes an RPG Builder panel (see below). |
rpgOpenCharacterTab(tabName) | Opens Character panel to a specified tab (see below). Use rpgClosePanel("Character") to close. |
rpgOpenTalentTreePanel(talentTree) | Opens the Talent_Tree panel, showing a specified talent tree. |
Notes:
Panel Name | Description |
---|---|
Character | Character window (Equipment, Stats, Talents, Factions) |
Weapon_Templates | Weapon Templates |
Inventory | Inventory |
Spellbook | Spell book |
Skill_Book | Skills book |
Enchanting | Enchanting |
Socketing | Socketing |
Quest_Log | Quest log (RPG Builder quests, not Dialogue System quest log window) |
Stats_Allocation | Stats allocation |
Options | Options |
— DEVELOPER UI — | Developer UI |
Character Tab Name | Description |
---|---|
GEAR | Character inventory tab |
STATS | Character stats tab |
TALENTS | Character talents tab |
FACTIONS | Character factions tab |
These sequencer commands are available:
rpgCraft(stationName)
Opens the Crafting UI, where stationName is a GameObject name or name of a crafting station as defined in the RPG Builder window. It will look for a GameObject first. If it doesn't find it by name, it will use the first crafting station GameObject that is assigned to the named crafting station type.
rpgMerchant()
Opens the Merchant window of the NPC that the player is currently interacting with.
rpgTeleport(spawnpoint, [scene], [subject])
Parameters:
To add a "Play Conversation" Game Action: