PopochiuRoomData

Extends: Resource

Description

Property Descriptions

script_name

@export var script_name: String = ""

The identifier of the object used in scripts.

scene

@export var scene: String = ""

The path to the scene file to be used when adding the character to the game during runtime.

visited

@export var visited: bool = false

Whether the room was already visited by the player.

visited_first_time

@export var visited_first_time: bool = false

Whether this is the first time the player visits the room.

visited_times

@export var visited_times: int = 0

The number of times the player has visited this room.

props

var props: Dictionary

Stores data about the PopochiuProps in the room.

hotspots

var hotspots: Dictionary

Stores data about the PopochiuHotspots in the room.

walkable_areas

var walkable_areas: Dictionary

Stores data about the [PopochiuWalkableArea]s in the room.

regions

var regions: Dictionary

Stores data about the [PopochiuRegion]s in the room.

characters

var characters: Dictionary

Stores data about the PopochiuCharacters in the room. To see the stored data by default, check [method save_characters].

Method Descriptions

on_save

func on_save() -> Dictionary

Use this to store custom data when saving the game. The returned [Dictionary] must contain only JSON supported types: [bool], [int], [float], [String].

on_load

func on_load(data: Dictionary) -> void

Called when the game is loaded. [param data] will have the same structure you defined for the returned [Dictionary] by [method _on_save].

save_children_states

func save_children_states() -> void

Stores the data of each of the childrens inside [b]$WalkableAreas[/b], [b]$Props[/b], [b]$Hotspots[/b], [b]$Regions[/b], and [b]$Characters[/b].

save_characters

func save_characters() -> void

Save room data related to the characters in the room. The stored data contains: [codeblock]{ x = PopochiuCharacter.position.x y = PopochiuCharacter.position.y facing = PopochiuCharacter._looking_dir visible = PopochiuCharacter.visible modulate = PopochiuCharacter.modulate self_modulate = PopochiuCharacter.self_modulate light_mask = PopochiuCharacter.light_mask }[/codeblock]