Rog Support

This page describes how to set up the Dialogue System with Rog by Fred Vasquez. (Rog 1.51+ is required.)

Rog copyright © Fred Vasquez.

Rog Setup

This integration package requires Rog 1.5+, which requires Unity 5.5+. The example scene is built for Rog 1.5 - 1.51.

The integration scripts also work with Rog 1.52, but the example actor prefabs will need to be updated to run in Rog 1.52. To update them, inspect the non-player prefabs (QuestBat, Skeldon, and SkeltonJohn) and delete the unused Actions on the Actor component. Then delete Actor_PlayerDS. Copy Rog's original Actor_Player to Actor_PlayerDS and add a Pause Rog On Conversation component.

  1. Import the package Third Party Support ► Rog Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► Rog.
  2. Play the example scene in the Example subfolder to familiarize yourself with the integration. The skeleton to the player's right demonstrates barks. The skeleton to the player's left offers a quest through a conversation.
  3. To your own scene, add the special Dialogue Manager prefab located in the Rog Support ► Prefabs folder. This prefab is set up to work with Rog. You can customize its appearance. The quest log window is bound to the L key; to change this, inspect the Rog Quest Log Window's Pause Rog On Quest Log Window script.
  4. Add the Pause Rog On Conversation script to your player prefab. For an example, see the Example ► Resources ► Actors ► Actor_PlayerDS prefab.
  5. To set up an actor to bark when the player steps next to it:
    • Set the actor's Map Object > Script Object to DialogueActorScript.
    • Add a Dialogue System Trigger or Bark Trigger. Set the trigger to OnUse and select your bark conversation.
    • Optional: Add a Dialogue Actor if you want to show the actor's name in the bark UI but don't want to use its GameObject name.
    • For an example, see the Example ► Resources ► Actors ► Actor_SkeltonJohn prefab.
  6. To set up an actor to play a conversation when the player steps next to it:
    • Set the actor's Map Object > Script Object to DialogueActorScript.
    • Add a Dialogue System Trigger or Conversation Trigger. Set the trigger to OnUse and select your conversation.
    • Optional: Add a Dialogue Actor if you want to show the actor's name in the but don't want to use its GameObject name.
    • For an example, see the Example ► Resources ► Actors ► Actor_Skeldon prefab.
  7. To set up a kill target, add an Increment On Destroy to the actor. Assuming you've already created a variable to track kills in your dialogue database, specify the variable. The example scene uses a variable "batsKilled".
  8. To set up a pickup target, add an Increment On Destroy to the actor, and set Increment On to Disable. Assuming you've already created a variable to track the amount picked up in your dialogue database, specify the variable. The example uses a variable "bonesFound".

Rog Lua Functions

You can use the Lua functions below in your dialogue entry Scripts and Conditions (or anywhere you use Lua). Note the exact number and type of parameters required for each function.

RogMessage( message:string )

Description: Prints a message to Rog's message box.

Example: RogMessage("Quest Completed: Sheldon's Bones")


RogHasItem( itemName:string )

Returns: (Boolean) True if the player has the named item.

Example: RogHasItem("Bone")


RogTakeItem( itemName:string )

Description: Removes an item from the player's inventory.

Example: RogTakeItem("Bone")


RogGiveItem( prefabName:string )

Description: Gives the player an item specified by its prefab name.

Example: RogGiveItem("Health Potion")


RogHasItems( itemName:string, amount:number )

Returns: (Boolean) True if the player has a minimum amount of the named item.

Example: RogHasItems("Bone", 3)


RogTakeItems( itemName:string, amount:number )

Description: Removes amount items from the player's inventory.

Example: RogTakeItems("Bone", 3)


RogGiveItems( prefabName:string, amount:number )

Description: Gives the player amount items specified by its prefab name.

Example: RogGiveItems("Health Potion", 2)


RogGetFaction( actorName:string )

Description: (string) Returns an actor's faction:

  • "Good"
  • "Bad"
  • "Unknown"

Example: RogGetFaction("Skeldon")


RogReplaceActor( actorName:string, prefabName:string )

Description: Description: Replaces all actors matching the specified name with a different prefab. Actually changing an actor's faction involves changing its AI behaviour and map object script(s), which can get quite messy. It's much cleaner to set up two different prefabs, one for each faction type, and use this function to swap one prefab instance for the other.

Example: RogReplaceActor("Skeldon", "Actor_Bat")


RogReplaceSprite( actorName:string, spriteName:string )

Description: Replaces the sprite of all actors matching the specified name. The sprite must be located in a Resources folder. If it's in a subfolder, you can specify the subfolder with the spriteName (e.g., "Monsters/Green Lizard").

Example: RogReplaceSprite("Skeldon", "Golden Skeleton")

Saving and Loading

The Rog developer recommends using Easy Save with Rog:

Easy Save is also easy to use with the Dialogue System: How do I save and load using Moodkie's Easy Save?

Inventory Engine Integration

The Extras folder contains an integration package that makes Rog work with More Mountains' Inventory Engine. For information about Inventory Engine support, see Inventory Engine Support.


<< Third Party Integration