top of page

Custom Dialogues Triggers

To create custom triggers for your dialogues, you need to add an activation script to your NPC, collider, or any object that should start a dialogue. When your conditions are met, simply call StartDialogue and pass the required parameters.

BaseActivation class

Attach this script wherever you want to activate a dialogue (e.g., NPCs, colliders, triggers, etc).

Attributes
Description
DialogusContainer container
The dialogue container to trigger
KeyCode InteractionKey
Key that, when pressed, triggers the dialogue
bool KeyOrMouseToContinue
Enable to continue with a key or mouse
SkipBind ContinueTriggerType
Enum: Mouse, Keyboard, Both
MouseButton MouseToContinue
Enum: MouseLeftClick, MouseRighteClick, MouseMiddleClick
KeyCode KeyToContinue
Key to continue to next dialogue

To inherit this class, follow this example:

 
 public class {NameOfClass} : BaseActivation
 {
     // Add custom logic here
 }
 

imagem_2025-06-07_172309939.png

StartDialogue

To start a dialogue from your custom trigger, call:

   
   DialogusManager.singleton.StartDialogue(parameters);

Parameters
Description
DialogusContainer container
The Dialogue Container to trigger
BaseActivation activation
The activation component to activate the dialogue

Trigger Example

This example shows how to trigger a dialogue when the player stays in a collider and presses the interaction key, thats how a Collision Activation is made:

   
 public class ColliderActivation : BaseActivation

 {

    void OnTriggerStay(Collider other)

    {

       if (Input.GetKeyDown(InteractionKey))

       {

          DialogusManager.singleton.StartDialogue(dialogusContainer, this);

       }

    }

 }

Vars

You can use the Set Var node to set variables in your dialogues.
If you want to connect a script variable to your dialogue, you need to do this via scripting.

All functions below are accessed via:

   
   DialogusManager.singleton.{nameOfMethod}(parameters);

CheckVarDefined

Checks if a variable is defined in the Dialogus Manager Instance/Singleton.

Parameter
Description
string varName
Name of the variable to search for
DialgousContainer container
The container where your variable is located (optional)
  • If container is null, creates/checks a universal variable.

  • Universal and local variable names should be unique to avoid conflicts.

GetAllFloatVars

Returns a list with all float variables in the Dialogus Manager Instance/Singleton.

GetAllFloatVarsByName

Returns the Float Var with the providen name. Note that if you have the same name variable in two differents container, it will return the first found one. If you want to specify where the value is, use GetFloatVarData().

Parameter
Description
string name
Name of the variable to get
  • If two containers have variables with the same name, returns the first one found.

GetFloatVarData

Returns the float variable with the provided name and container.

Parameters
Description
string name
Name of the variable to find
DialogusManager container
Container where your var is located (null = universal)
  • For universal variables, set the container to null.

GetAllBooleanVars

Returns a list with all boolean variables in the Dialogus Manager Instance/Singleton.

GetAllBooleanVarsByName

Returns a boolean variable list with the provided name.

Parameter
Description
string name
Name of the variable to get
  • If two containers have variables with the same name, returns the first one found.

GetBoolVarData

Returns the boolean variable with the provided name and container.

Parameters
Description
string name
Name of the variable to find
DialogusManager container
Container where your var is located (null = universal)
  • For universal variables, set the container to null.

CreateFloatVar

Creates a float variable in the Dialogus Manager Instance/Singleton.

Parameters
Description
string VarName
Name of the variable to create
float value
Initial value of the variable
DialogusContainer container
The container where your var will be (null = universal)
  • If container is null, creates a universal variable.

  • Avoid duplicate names for universal/local variables.

CreateBoolVar

Creates a boolean variable in the Dialogus Manager Instance/Singleton.

Parameters
Description
string name
Name of the variable to create
bool value
Initial value of the variable
DialogusContainer container
The container where your var will be (null = universal)
  • If container is null, creates a universal variable.

  • Avoid duplicate names for universal/local variables.

SetFloatVar

Sets the value of a float variable.


Overloaded function: You can pass the variable object, or the name and container.
 

Option 1: Pass a FloatVar object.

Parameters
Description
FloatVar varToBeSet
The FloatVar object to modify
FloatOperations operation
Enum: Set / Add / Subtract
float desiredValue
Value to use with the operation

Option 2: Pass name and container.

Parameters
Description
string VarName
Name of the variable to modify
DialogusContainer container
The container that your var is located (null = universal)
FloatOperations operation
Enum: Set / Add / Subtract
float desiredValue
Value to use with the operation

FloatOperations Enum:

  • Set: Sets the variable to the desired value.

  • Add: Adds the value to the variable.

  • Subtract: Subtracts the value from the variable.

SetBoolVar

Sets the value of a boolean variable.


Overloaded function: You can pass the variable object, or the name and container.

Option 1: Pass a BoolVar object.

Parameters
Description
BoolVar varToBeSet
The BoolVar object to modify
bool desiredValue
The value to assign

Option 2: Pass name and container

Parameters
Description
string VarName
Name of the variable to modify
DialogusContainer container
The container that your var is located (null = universal)
bool desiredValue
The value to assign

SetOrCreateFloatVar

Sets or creates a float variable.

Parameters
Description
string VarName
Name of the variable to set or create
FloatOperations operation
Enum: Set / Add / Subtract
float Value
Value to use with the operation
DialogusContainer container
The container that your var is located /created (null = universal)
  • If the variable does not exist, creates it.

  • If you want a universal variable, use null as the container.

SetOrCreateBoolVar

Sets or creates a boolean variable.

Parameters
Description
string VarName
Name of the variable to set or create
bool SetDesiredValue
Value if the variable already exists
bool CreateValue
Value if the variable does not exist
DialogusContainer container
The container that your var is located/created (null = universal)
  • If the variable does not exist, creates it.

  • If you want a universal variable, use null as the container.

bottom of page