SkillNode ​
Inherits: Resource
Inherited by: ChoiceSkillNode, RankedSkillNode
Base class for all skill node types
Properties ​
int | id | |
String | display_name | "": |
String | description | "": |
CompressedTexture2D | icon | |
int | required_point_pool | 0 # Which pool to spend from (0 = no pool required) |
bool | can_refund | true |
Array[int] | required_nodes | [] # Node IDs that must be unlocked first |
int | required_level | 1 |
int | required_points_in_tree | 0 |
Array[int] | mutually_exclusive_nodes | [] |
Vector2 | editor_position | Vector2.ZERO |
Color | node_color | Color.WHITE |
Methods ​
int | get_max_ranks() |
int | get_point_cost_for_rank( rank: int ) |
bool | apply_rewards_for_rank( player: Player, rank: int ) |
Array | get_rewards_for_rank( rank: int ) |
int | get_total_point_cost_through_rank( target_rank: int ) |
bool | has_node_prerequisite( node_id_to_check: int ) |
void | add_node_prerequisite( prereq_node_id: int ) |
bool | remove_node_prerequisite( prereq_node_id: int ) |
void | add_mutually_exclusive_node( exclusive_node_id: int ) |
bool | remove_mutually_exclusive_node( exclusive_node_id: int ) |
String | get_summary() |
Array[Dictionary] | validate() |
bool | is_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?