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
current_timelineDialogicTimelinenull
current_timeline_eventsArray[]
current_event_idxint0
current_state_infoDictionary{}
current_stateint0
pausedboolfalse
AudioModules/Audio/subsystem_audio.gdnew()
BackgroundsModules/Background/subsystem_backgrounds.gdnew()
PortraitsModules/Character/subsystem_portraits.gdnew()
PortraitContainersModules/Character/subsystem_containers.gdnew()
ChoicesModules/Choice/subsystem_choices.gdnew()
ExpressionsModules/Core/subsystem_expression.gdnew()
AnimationsModules/Core/subsystem_animation.gdnew()
InputsModules/Core/subsystem_input.gdnew()
GlossaryModules/Glossary/subsystem_glossary.gdnew()
HistoryModules/History/subsystem_history.gdnew()
JumpModules/Jump/subsystem_jump.gdnew()
SaveModules/Save/subsystem_save.gdnew()
SettingsModules/Settings/subsystem_settings.gdnew()
StylesModules/Style/subsystem_styles.gdnew()
TextModules/Text/subsystem_text.gdnew()
TextInputModules/TextInput/subsystem_text_input.gdnew()
VARModules/Variable/subsystem_variables.gdnew()
VoiceModules/Voice/subsystem_voice.gdnew()

Methods

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

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 state_changed ( new_state: int )

Emitted when current_state change.


signal dialogic_paused ( )

Emitted when paused changes to true.


signal dialogic_resumed ( )

Emitted when paused changes to false.


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.


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 text_signal ( argument: String )

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


Property Descriptions

var current_timeline = null

Reference to the currently executed timeline.


var current_timeline_events = []

Copy of the current_timeline's events.


var current_event_idx = 0

Index of the event the timeline handling is currently at.


var current_state_info = {}

Contains all information that subsystems consider relevant for the current situation


var current_state = 0

Current state (see States enum).


var paused = false

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


var Audio = new()

No description available.


var Backgrounds = new()

No description available.


var Portraits = new()

No description available.


var PortraitContainers = new()

No description available.


var Choices = new()

No description available.


var Expressions = new()

No description available.


var Animations = new()

No description available.


var Inputs = new()

No description available.


var Glossary = new()

No description available.


var History = new()

No description available.


var Jump = new()

No description available.


var Save = new()

No description available.


var Settings = new()

No description available.


var Styles = new()

No description available.


var Text = new()

No description available.


var TextInput = new()

No description available.


var VAR = new()

No description available.


var Voice = new()

No description available.


Method Descriptions

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.


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 end_timeline ( ) ⇒ void

Clears and stops the current timeline.


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

Handles the next event.


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 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 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 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 has_subsystem ( subsystem_name: String ) ⇒ bool

Returns true if a subystem with the given subsystem_name exists.


func get_subsystem ( subsystem_name: String ) ⇒ DialogicSubsystem

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


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

Adds a subsystem node with the given subsystem_name and script_path.


func print_debug_moment ( ) ⇒ void

No description available.