Escoria

Extends: Node

Description

The escoria main script

Enumerations

GAME_STATE

const GAME_STATE: Dictionary = {"DEFAULT":0,"DIALOG":1,"WAIT":2}

Current game state

  • DEFAULT: Common game function

  • DIALOG: Game is playing a dialog

  • WAIT: Game is waiting

Constants Descriptions

BUS_MASTER

const BUS_MASTER: String = "Master"

Audio bus indices.

BUS_MUSIC

const BUS_MUSIC: String = "Music"

BUS_SFX

const BUS_SFX: String = "SFX"

BUS_SPEECH

const BUS_SPEECH: String = "Speech"

CAMERA_SCENE_PATH

const CAMERA_SCENE_PATH: String = "res://addons/escoria-core/game/scenes/camera_player/camera.tscn"

Property Descriptions

logger

var logger: ESCLogger

Logger used

utils

var utils: ESCUtils

Several utilities

inventory_manager

var inventory_manager: ESCInventoryManager

The inventory manager instance

action_manager

var action_manager: ESCActionManager

The action manager instance

esc_compiler

var esc_compiler: ESCCompiler

ESC compiler instance

event_manager

var event_manager: ESCEventManager

ESC Event manager instance

globals_manager

var globals_manager: ESCGlobalsManager

ESC globals registry instance

room_manager

var room_manager: ESCRoomManager

ESC room manager instance

object_manager

var object_manager: ESCObjectManager

ESC object manager instance

project_settings_manager

var project_settings_manager: ESCProjectSettingsManager

ESC project settings manager instance

command_registry

var command_registry: ESCCommandRegistry

ESC command registry instance

resource_cache

var resource_cache: ESCResourceCache

Resource cache handler

room_terrain

var room_terrain

Terrain of the current room

dialog_player

var dialog_player: ESCDialogPlayer

Dialog player instantiator. This instance is called directly for dialogs.

inventory

var inventory

Inventory scene

settings

var settings: ESCSaveSettings

These are settings that the player can affect and save/load later

game_size

var game_size

The game resolution

main

var main

The main scene

current_state

var current_state

The current state of the game

inputs_manager

var inputs_manager: ESCInputsManager

The escoria inputs manager

save_manager

var save_manager: ESCSaveManager

Savegames and settings manager

game_scene

var game_scene: ESCGame

The game scene loaded

player_camera

var player_camera: ESCCamera

The main player camera

start_script

var start_script: ESCScript

The compiled start script loaded from ProjectSettings escoria/main/game_start_script

Method Descriptions

init

func init()

Called by Escoria’s main_scene as very very first event EVER. Usually you’ll want to show some logos animations before spawning the main menu in the escoria/main/game_start_script ‘s :init event

new_game

func new_game()

Called by Main menu “start new game”

apply_settings

func apply_settings(p_settings: ESCSaveSettings) -> void

Apply the loaded settings

Parameters

  • p_settings: Loaded settings

set_game_paused

func set_game_paused(p_paused: bool)

Pauses or unpause the game

Parameters

  • p_paused: if true, pauses the game. If false, unpauses the game.

run_event_from_script

func run_event_from_script(script: ESCScript, event_name: String)

Runs the event “event_name” from the “script” ESC script.

Parameters

  • script: ESC script containing the event to run. The script must have been loaded.

  • event_name: Name of the event to run

register_ui

func register_ui(game_scene: String)

Register a user interface. This should be called in a deferred way from the addon’s _enter_tree.

Parameters

  • game_scene: Path to the game scene extending ESCGame

deregister_ui

func deregister_ui(game_scene: String)

Deregister a user interface

Parameters

  • game_scene: Path to the game scene extending ESCGame

register_dialog_manager

func register_dialog_manager(manager_class: String)

Register a dialog manager addon. This should be called in a deferred way from the addon’s _enter_tree.

Parameters

  • manager_class: Path to the manager class script

deregister_dialog_manager

func deregister_dialog_manager(manager_class: String)

Deregister a dialog manager addon

Parameters

  • manager_class: Path to the manager class script

quit

func quit()

Function called to quit the game.

is_ready_for_inputs

func is_ready_for_inputs() -> bool

Used by game.gd to determine whether the game scene is ready to take inputs from the _input() function. To do so, the current_scene must be set, the game scene must be set, and the game scene must’ve been notified that the room is ready.

Returns true if game scene is ready for inputs

Signals

  • signal paused():  Signal sent when Escoria is paused

  • signal resumed(): Signal sent when Escoria is resumed from pause