Skip to content

SkillPointPoolInstance ​

Inherits: RefCounted

Runtime instance tracking state of a skill point pool for a player

Variables ​

SkillPointPoolpool_definition
inttotal_points_earned0
intpoints_spent0

Methods ​

SkillPointPoolInstancecreate_from_definition( pool_def: SkillPointPool ) static
intget_available_points()
intget_pool_id()
Stringget_pool_name()
Colorget_pool_color()
boolis_at_cap()
intget_remaining_capacity()
boolcan_add_points( amount: int )
booladd_points( amount: int )
boolcan_spend_points( amount: int )
boolspend_points( amount: int )
boolrefund_points( amount: int )
boolremove_points( amount: int )
voidreset_spent_points()
Stringget_summary()
floatget_progress_percentage()
Dictionaryto_save_data()
voidrestore_from_save_data( save_data: Dictionary )
SkillPointPoolInstancefrom_save_data( save_data: Dictionary, pool_def: SkillPointPool ) static
Array[Dictionary]validate()
boolis_valid()

Variable descriptions ​

SkillPointPool pool_definition ​

The pool definition this instance tracks

int total_points_earned = 0 ​

Total points ever earned for this pool

int points_spent = 0 ​

Points currently spent from this pool

Method descriptions ​

SkillPointPoolInstance create_from_definition( pool_def: SkillPointPool ) ​

Factory method to create a new instance from a pool definition

int get_available_points() ​

Get unspent points currently available

int get_pool_id() ​

Get the pool ID this instance tracks

String get_pool_name() ​

Get the display name of this pool

Color get_pool_color() ​

Get the display color for this pool

bool is_at_cap() ​

Check if pool has reached its maximum capacity

int get_remaining_capacity() ​

Get how many more points can be earned (-1 if unlimited)

bool can_add_points( amount: int ) ​

Check if points can be added without exceeding cap

bool add_points( amount: int ) ​

Add points to the pool (increases total_points_earned)

bool can_spend_points( amount: int ) ​

Check if enough points are available to spend

bool spend_points( amount: int ) ​

Spend points from available pool

bool refund_points( amount: int ) ​

Refund spent points back to available

bool remove_points( amount: int ) ​

Take earned points away again (an unapplied reward): only points that are not spent can go

void reset_spent_points() ​

Reset all spent points (full respec of this pool)

String get_summary() ​

Get a summary string for display

float get_progress_percentage() ​

Get percentage of pool capacity used (0.0 to 1.0), returns -1.0 if unlimited

Dictionary to_save_data() ​

Convert instance to save data

void restore_from_save_data( save_data: Dictionary ) ​

Restore state from save data into this existing instance

SkillPointPoolInstance from_save_data( save_data: Dictionary, pool_def: SkillPointPool ) ​

Create instance from save data (legacy/factory method) Prefer using restore_from_save_data() on existing instances

Array[Dictionary] validate() ​

Validate the instance state

bool is_valid() ​

Check if instance is in a valid state