Skip to content

SkillHolders ​

Inherits: RefCounted

The owners of skill trees and skill points that are not a character: the professions and the factions. A pool (SkillPointPool.scope) and the trees that spend it are kept by the same owner, so a tree of a profession spends the points of a profession pool wherever the player is, and a faction tree spends the points of the party.

Description ​

  • PROFESSION: the owner is the one of the professions (Gameplay Config > Professions belong to): the party (key 0) or each character (the unique id of the player)
  • FACTION: the party (key 0). The key is asked from key_for so that factions of each character can be added without changing the callers

A holder is made the first time it is asked for. The party manager has one of these (PartyManager.skill_holders) and it is saved with the game.

Methods ​

intkey_for( scope: SkillPointPool.Scope, player: Entity = null )
SkillHolderholder_for( scope: SkillPointPool.Scope, player: Entity = null )
Array[SkillHolder]all_holders()
Dictionarysource_availability( instance: SkillTreeInstance, player: Entity )
voidreset_for_new_game()
Arrayto_save_data()
voidrestore_from_save_data( data: Array, player: Player = null )

Constants ​

  • int PARTY_KEY = 0 - The key of the party

Method descriptions ​

int key_for( scope: SkillPointPool.Scope, player: Entity = null ) ​

The key of the owner for a kind of points: who keeps them for this player

SkillHolder holder_for( scope: SkillPointPool.Scope, player: Entity = null ) ​

The holder of this kind of points for this player (made when first asked for). Null for the points of a character

Array[SkillHolder] all_holders() ​

Every holder made so far

Dictionary source_availability( instance: SkillTreeInstance, player: Entity ) ​

Can the player spend points in a tree of a profession or a faction? The profession has to be learned, the faction has to have met the party. {"available", "reason"}

void reset_for_new_game() ​

A new game: every owner starts again

Array to_save_data() ​

The owners (professions, factions) for a save.

void restore_from_save_data( data: Array, player: Player = null ) ​

Restores the owners from a save.