PopochiuICharacter

Extends: Node

Description

Property Descriptions

player

var player: PopochiuCharacter
  • Setter: @player_setter

Access to the PopochiuCharacter that is the current Player-controlled Character (PC).

camera_owner

var camera_owner: PopochiuCharacter

Access to the PopochiuCharacter that is owning the camera.

characters_states

var characters_states: Dictionary

Stores data about the state of each PopochiuCharacter in the game. The key of each entry is the [member PopochiuCharacter.script_name] of the character.

Method Descriptions

walk_to_clicked

func walk_to_clicked(offset: Vector2 = "(0, 0)") -> void

Makes the Player-controlled Character (PC) move (NON-BLOCKING) to the [member PopochiuClickable.walk_to_point] position of the last clicked [PopochiuClickable] (i.e. a PopochiuProp) in the room. You can set an [param offset] relative to the target position.

queue_walk_to_clicked

func queue_walk_to_clicked(offset: Vector2 = "(0, 0)") -> Callable

Makes the Player-controlled Character (PC) move (NON-BLOCKING) to the [member PopochiuClickable.walk_to_point] position of the last clicked [PopochiuClickable] (i.e. a PopochiuProp) in the room. You can set an [param offset] relative to the target position. [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i]

walk_to_clicked_blocking

func walk_to_clicked_blocking(offset: Vector2 = "(0, 0)") -> void

Similar to [method walk_to_clicked] but BLOCKING the GUI to prevent players from clicking other objects or any point in the room.

queue_walk_to_clicked_blocking

func queue_walk_to_clicked_blocking(offset: Vector2 = "(0, 0)") -> Callable

Similar to [method walk_to_clicked] but BLOCKING the GUI to prevent players from clicking other objects or any point in the room.

face_clicked

func face_clicked() -> void

Makes the Player-controlled Character (PC) look at the last clicked [PopochiuClickable].

queue_face_clicked

func queue_face_clicked() -> Callable

Makes the Player-controlled Character (PC) look at the last clicked [PopochiuClickable].[br][br] [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i]

change_camera_owner

func change_camera_owner(c: PopochiuCharacter) -> void

Makes the camera follow [param c].

queue_change_camera_owner

func queue_change_camera_owner(c: PopochiuCharacter) -> Callable

Makes the camera follow [param c].[br][br] [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i]

get_runtime_character

func get_runtime_character(script_name: String) -> PopochiuCharacter

Returns the instance of the PopochiuCharacter. If the character doesn't exists, then [code]null[/code] is returned.[br][br] This method is used by [b]res://game/autoloads/c.gd[/b] to load the instace of each character (present in that script as a variable for code autocompletion) in runtime.

is_valid_character

func is_valid_character(script_name: String) -> bool

Returns [code]true[/code] if [param script_name] is equal to [code]player[/code] or exist in [member characters].

get_character

func get_character(script_name: String) -> PopochiuCharacter

Gets a PopochiuCharacter. If the instance doesn't exist in [member characters], then one is created, added to the array, and returned.

get_instance

func get_instance(script_name: String) -> PopochiuCharacter

Gets the instance of the PopochiuCharacter.

set_player

func set_player(value: PopochiuCharacter) -> void

Signals

  • signal character_spoke(character, message): Emitted when [param character] says [param message].