Dialogue system interfacing with gameobjects

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ombra
Posts: 1
Joined: Sat Jan 04, 2020 12:32 am

Dialogue system interfacing with gameobjects

Post by Ombra »

Hi,
I recently purchased Dialogue system and am trying to familiarize myself with it. Looking over the documentation and example I am a little confused as to what the best practice is for interfacing with game objects that are already in the scene. Looking at the Events section of a dialog entry, it only takes scriptable objects/prefabs since it doesn't exist within a scene. Do I need to write a custom script/sequence to for example turn on a light in the scene or call a method on another game object?

Regards,

Ombra
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue system interfacing with gameobjects

Post by Tony Li »

Hi Ombra,

Thanks for buying the Dialogue System!

You're correct about the UnityEvent in dialogue entry nodes. Since the dialogue database exists outside of any particular scene, it can't reference scene objects.

Instead, the Dialogue System provides a cutscene sequence system. (More info: Cutscene Sequences Tutorials) Cutscene sequences are a series of text commands such as:

Code: Select all

SetActive(ForceField, true);
Audio(Beep)
(The sequence above activates a GameObject named "ForceField" and plays an audio clip named "Beep".) In most cases, you can drag scene objects or project assets into the dialogue entry node's Sequence field, and the editor will automatically generate the text command for you.

There are several advantages to text-based sequencer commands:

1. You can stay in the flow of writing dialogue text without having to switch mindsets into, for example, a scrubbing timeline editor. (However, the Dialogue System does support timeline editors such as Unity Timeline, SLATE, and Cinema Director; and you can even mix and match within the same conversation.)

2. You can use text substitution. For example, say you set a Dialogue System variable named "choice" to the name of a GameObject that the player has chosen in dialogue. Then you can write a command like this:

Code: Select all

SetActive([var=choice], true)
3. You can import and export your entire database to other text-based formats, such as CSV (Excel) for localization, or import from articy:draft or Chat Mapper.

---

In addition sequences, you can also use Dialogue System Trigger components. These components perform actions when a specified event occurs, such as when the player enters a trigger area or interacts with the object or when the scene starts. Since the Dialogue System Trigger is in the scene, it does offer a UnityEvent that you can hook up to scene objects. More info: Interaction Tutorial
Post Reply