Skip to content

SkillNode ​

Inherits: Resource

Inherited by: ChoiceSkillNode, RankedSkillNode

Base class for all skill node types

Properties ​

intid
Stringdisplay_name"":
Stringdescription"":
CompressedTexture2Dicon
intrequired_point_pool0 # Which pool to spend from (0 = no pool required)
boolcan_refundtrue
Array[int]required_nodes[] # Node IDs that must be unlocked first
intrequired_level1
intrequired_points_in_tree0
Array[int]mutually_exclusive_nodes[]
Vector2editor_positionVector2.ZERO
Colornode_colorColor.WHITE

Methods ​

intget_max_ranks()
intget_point_cost_for_rank( rank: int )
boolapply_rewards_for_rank( player: Player, rank: int )
Arrayget_rewards_for_rank( rank: int )
intget_total_point_cost_through_rank( target_rank: int )
boolhas_node_prerequisite( node_id_to_check: int )
voidadd_node_prerequisite( prereq_node_id: int )
boolremove_node_prerequisite( prereq_node_id: int )
voidadd_mutually_exclusive_node( exclusive_node_id: int )
boolremove_mutually_exclusive_node( exclusive_node_id: int )
Stringget_summary()
Array[Dictionary]validate()
boolis_valid()

Property descriptions ​

int id ​

========== BASIC PROPERTIES ==========

String display_name = "": ​

The name of the node.

String description = "": ​

The text of the node.

CompressedTexture2D icon ​

The icon of the node.

int required_point_pool = 0 # Which pool to spend from (0 = no pool required) ​

========== POINT COST SYSTEM ==========

bool can_refund = true ​

Whether this node can be refunded

Array[int] required_nodes = [] # Node IDs that must be unlocked first ​

========== PREREQUISITES ==========

int required_level = 1 ​

The level the player must have to take the node.

int required_points_in_tree = 0 ​

Minimum points spent in this tree to unlock

Array[int] mutually_exclusive_nodes = [] ​

Can't have both

Vector2 editor_position = Vector2.ZERO ​

========== VISUAL (for future editor) ==========

Color node_color = Color.WHITE ​

The color of the node in the tree window.

Method descriptions ​

int get_max_ranks() ​

Override in child classes to return maximum ranks for this node

int get_point_cost_for_rank( rank: int ) ​

Override in child classes to return point cost for specific rank

bool apply_rewards_for_rank( player: Player, rank: int ) ​

Override in child classes to apply rewards for specific rank

Array get_rewards_for_rank( rank: int ) ​

Override in child classes to return rewards for specific rank

int get_total_point_cost_through_rank( target_rank: int ) ​

Calculate total cost to reach a specific rank (uses child class implementation)

bool has_node_prerequisite( node_id_to_check: int ) ​

========== PREREQUISITE HELPERS ==========

void add_node_prerequisite( prereq_node_id: int ) ​

Adds a node that must be taken before this one.

bool remove_node_prerequisite( prereq_node_id: int ) ​

Removes a prerequisite. False when it was not there.

void add_mutually_exclusive_node( exclusive_node_id: int ) ​

Adds a node that cannot be taken together with this one.

bool remove_mutually_exclusive_node( exclusive_node_id: int ) ​

Removes a mutual exclusion. False when it was not there.

String get_summary() ​

========== UTILITY METHODS ==========

Array[Dictionary] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).

bool is_valid() ​

Is it free of errors?