Dialogue Sytem Demo Changes

v1.0

We have added various things to the demo scene to demonstrate how you may use the integration between Dialogue System for Unity and Juicy Actions.

Some changes are functional, and actually do things like play audio, shake the camera, etc.

Others are there with debug logging so you can see how various components are triggered β€” this is most often used with various "Action On Event" classes, which can be used to execute Actions based on Dialogue System events.

Global Dialogue System Action on Event Examples

The object of this name in the demo scene has the following components on it with the Debug Logging toggled on. These classes will place a console log when they are initially triggered, with some additional details.

Some actions may have actions added as well.

Conversation Effects

When the Player enters a conversation, we use a ActionOnConversationStart component to change the Post Processing settings to visually focus on the Conversant. We also use an ActionOnConversationEnd component to change them back.

But the effects need to be set differently for interactions with the Terminal than other characters. So we can use the Conditionals feature along with the DialogueSystemConditionalValue component. This component, added to the Dialogue System Juicy Actions Bridges object in the scene, will query the Dialogue System variables and check the value against the Conditionals settings.

circle-info

Because the Conditional checks an object in the scene, we need to ensure the DialogueSystemConditionalValue component is on an object that does not get destroyed. Otherwise, the reference may be lost when scenes change.

The DialogueSystemConditionalValue can be on any object otherwise, and you can have multiple in the scene.

This way we can apply different actions based on who the Conversant is β€” in this case different depth of field focal distances, and vignette intensity.

Turning Off Weapon Effects

When we are in a conversation, we don't want the weapon effects to take hold. Those are explained later, but they use an ActionOnInput component. We use the EnableComponentAction to disable that component when a conversation starts, and enable it again when the conversation ends.

Terminal Actions

When the Terminal comes up in the game, the user can type. We added an ActionOnInputText component to play a sound when the player types.

Password Entered

When the player inputs the string, there's a slight delay before the success or failure. We can add some audio and visual effects here via Juicy Actions. In the <Get Player Input> node for the Terminal graph, navigate to the "Scene Event" section, and we've added a call to the ExecutePasswordEntered method on the TerminalActions class.

This calls a method we added to TerminalActions which calls Execute(this) on the ActionExecutor.

Password Success & Failure

Dialogue System "Sequence" Lua code can call ActionExecutors from components on objects. Here we will add a Sequence line on both nodes which occur after the password is submitted by the player.

This will call the ActionExecutor field passwordSuccessActions on a component attached to the Terminal object. Tthe class TerminalActions has been added to the object in the demo scene.

Weapon Effects

The demo scene uses the input Fire1 for the weapon. We have an ActionOnInput component on the Player character. When Fire1 is pressed, we have a short delay to match the animation, and then shake the camera and add a bloom effect.

Enemy Attacks

We added DialogueEnemy with a single ActionExecutor with the field name enemyAttack.

We call this via the Dialogue System graph for Enemy Barks.

For each of the dialogue options, we can add one line to the Sequence, below the Audio() call.

The call will search for enemyAttack field in the speakers components. Since we did not specify a speaker via a second parameter, it will attempt to automatically resolve, which is what we want for our multiple Enemy objects.

Last updated