PopochiuInventoryItemData

Inherits: Resource

Description

Stores persistent data for an inventory item across save/load operations.

This resource maintains state throughout gameplay and handles serialization when saving and loading the game.


Properties

Type Name Default
Variant scene ''
Variant script_name ''

Methods

Return Type Method
void _on_load(_data: Dictionary) virtual
Dictionary _on_save() virtual

Property Descriptions

scene

@export_file("*.tscn") var scene = ''

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


script_name

@export var script_name = ''

The identifier of the object used in scripts.


Method Descriptions

_on_load

func _on_load(_data: Dictionary) -> void

This is a virtual method. Override it in your subclass.

Called when the game is loaded. The structure of data matches that returned by _on_save().

Implement this to restore the custom properties you persisted in [_on_save].


_on_save

func _on_save() -> Dictionary

This is a virtual method. Override it in your subclass.

Called when the game is saved.

Implement this to persist custom properties that you added to this resource. Should return a Dictionary containing the data to be saved.

The returned Dictionary must contain only JSON-supported types: [bool], [int], [float], String.