DialogicGameHandler

This contains the source code documentation of the class DialogicGameHandler.

DialogicGameHandler

Inherits: Node

Autoload script that allows you to interact with all of Dialogic's systems:

  • Holds all important information about the current state of Dialogic.
  • Provides access to all the subsystems.
  • Has methods to start/end timelines.

Properties

NameTypeDefault
AnimationsModules/Core/subsystem_animation.gd
AudioModules/Audio/subsystem_audio.gd
BackgroundsModules/Background/subsystem_backgrounds.gd
ChoicesModules/Choice/subsystem_choices.gd
ExpressionsModules/Core/subsystem_expression.gd
GlossaryModules/Glossary/subsystem_glossary.gd
HistoryModules/History/subsystem_history.gd
InputsModules/Core/subsystem_input.gd
JumpModules/Jump/subsystem_jump.gd
PortraitsModules/Character/subsystem_portraits.gd
SaveModules/Save/subsystem_save.gd
SettingsModules/Settings/subsystem_settings.gd
StylesModules/Style/subsystem_styles.gd
TextModules/Text/subsystem_text.gd
TextInputModules/TextInput/subsystem_text_input.gd
VARModules/Variable/subsystem_variables.gd
VoiceModules/Voice/subsystem_voice.gd
current_event_idxint0
current_stateint0
current_state_infoDictionary
current_timelineDialogicTimelinenull
current_timeline_eventsArray
pausedboolfalse

Methods

ReturnsMethod
DialogicSubsystemadd_subsystem ( subsystem_name: String, script_path: String )
voidclear ( clear_flags: int = 0 )
voidend_timeline ( )
Dictionaryget_full_state ( )
DialogicSubsystemget_subsystem ( subsystem_name: String )
voidhandle_event ( event_index: int )
voidhandle_next_event ( _ignore_argument: Variant = "" )
boolhas_subsystem ( subsystem_name: String )
voidload_full_state ( state_info: Dictionary )
Variantpreload_timeline ( timeline_resource: Variant )
voidprint_debug_moment ( )
Nodestart ( timeline: Variant, label: Variant = "" )
voidstart_timeline ( timeline: Variant, label_or_idx: Variant = "" )

Constants

const IDLE = 0

No description available.


const REVEALING_TEXT = 1

No description available.


const ANIMATING = 2

No description available.


const AWAITING_CHOICE = 3

No description available.


const WAITING = 4

No description available.


const FULL_CLEAR = 0

No description available.


const KEEP_VARIABLES = 1

No description available.


const TIMELINE_INFO_ONLY = 2

No description available.


Signals

signal dialogic_paused ( )

Emitted when paused changes to true.


signal dialogic_resumed ( )

Emitted when paused changes to false.


signal event_handled ( resource: DialogicEvent )

Emitted when an event starts being executed. The event may not have finished executing yet.


signal signal_event ( argument: Variant )

Emitted when a SignalEvent event was reached.


signal state_changed ( new_state: int )

Emitted when current_state change.


signal text_signal ( argument: String )

Emitted when a signal event gets fired from a TextEvent event.


signal timeline_ended ( )

Emitted when the timeline ends. This can be a timeline ending or end_timeline being called.


signal timeline_started ( )

Emitted when a timeline starts by calling either start or start_timeline.


Property Descriptions

var Animations =

No description available.


var Audio =

No description available.


var Backgrounds =

No description available.


var Choices =

No description available.


var Expressions =

No description available.


var Glossary =

No description available.


var History =

No description available.


var Inputs =

No description available.


var Jump =

No description available.


var Portraits =

No description available.


var Save =

No description available.


var Settings =

No description available.


var Styles =

No description available.


var Text =

No description available.


var TextInput =

No description available.


var VAR =

No description available.


var Voice =

No description available.


var current_event_idx = 0

Index of the event the timeline handling is currently at.


var current_state = 0

Current state (see States enum).


var current_state_info =

Contains all information that subsystems consider relevant for the current situation


var current_timeline = null

Reference to the currently executed timeline.


var current_timeline_events =

Copy of the current_timeline's events.


var paused = false

When true, many dialogic processes won't continue until it's false again.


Method Descriptions

func add_subsystem ( subsystem_name: String, script_path: String ) ⇒ DialogicSubsystem

Adds a subsystem node with the given subsystem_name and script_path.


func clear ( clear_flags: int = 0 ) ⇒ void

Resets Dialogic's state fully or partially. By using the clear flags from the ClearFlags enum you can specify what info should be kept. For example, at timeline end usually it doesn't clear node or subsystem info.


func end_timeline ( ) ⇒ void

Clears and stops the current timeline.


func get_full_state ( ) ⇒ Dictionary

Returns a dictionary containing all necessary information to later recreate the same state with load_full_state. The Save subsystem might be more useful for you. However, this can be used to integrate the info into your own save system.


func get_subsystem ( subsystem_name: String ) ⇒ DialogicSubsystem

Returns the subsystem node of the given subsystem_name or null if it doesn't exist.


func handle_event ( event_index: int ) ⇒ void

Handles the event at the given index event_index. You can call this manually, but if another event is still executing, it might have unexpected results.


func handle_next_event ( _ignore_argument: Variant = "" ) ⇒ void

Handles the next event.


func has_subsystem ( subsystem_name: String ) ⇒ bool

Returns true if a subystem with the given subsystem_name exists.


func load_full_state ( state_info: Dictionary ) ⇒ void

This method tries to load the state from the given state_info. Will automatically start a timeline and add a layout if a timeline was running when the dictionary was retrieved with get_full_state.


func preload_timeline ( timeline_resource: Variant ) ⇒ Variant

Preloader function, prepares a timeline and returns an object to hold for later timeline_resource can be either a path (string) or a loaded timeline (resource)


func print_debug_moment ( ) ⇒ void

No description available.


func start ( timeline: Variant, label: Variant = "" ) ⇒ Node

Method to start a timeline AND ensure that a layout scene is present. For argument info, checkout start_timeline. -> returns the layout node


func start_timeline ( timeline: Variant, label_or_idx: Variant = "" ) ⇒ void

Method to start a timeline without adding a layout scene. @timeline can be either a loaded timeline resource or a path to a timeline file. @label_or_idx can be a label (string) or index (int) to skip to immediatly.