ChoiceSkillNode ​
Inherits: SkillNode < Resource
Single-rank skill node where player chooses between multiple reward options
Properties ​
int | point_cost | 1 # Single cost since max rank is always 1 |
Array[Array] | choice_options | [] |
Array[CompressedTexture2D] | choice_icons | [] |
Methods ​
int | get_max_ranks() |
int | get_point_cost_for_rank( rank: int ) |
int | get_choice_count() |
Array[Array] | get_choice_options() |
Array | get_choice_option( choice_index: int ) |
CompressedTexture2D | get_choice_icon( choice_index: int ) |
void | set_choice_icon( choice_index: int, icon: CompressedTexture2D ) |
void | add_choice_option( rewards: Array, icon: CompressedTexture2D = null ) |
bool | remove_choice_option( choice_index: int ) |
void | clear_choice_options() |
bool | apply_choice( player: Player, choice_index: int ) |
String | get_choice_summary( choice_index: int ) |
Array[Dictionary] | validate() |
Property descriptions ​
int point_cost = 1 # Single cost since max rank is always 1 ​
========== CHOICE NODE PROPERTIES ==========
Array[Array] choice_options = [] ​
Each element is an array of rewards for that choice
Array[CompressedTexture2D] choice_icons = [] ​
Icon for each choice option
Method descriptions ​
int get_max_ranks() ​
========== IMPLEMENTATION OF ABSTRACT METHODS ==========
int get_point_cost_for_rank( rank: int ) ​
The skill points the node costs (a choice node has one rank).
int get_choice_count() ​
========== CHOICE-SPECIFIC METHODS ==========
Array[Array] get_choice_options() ​
The options of the node: the rewards of each.
Array get_choice_option( choice_index: int ) ​
The rewards of one option.
CompressedTexture2D get_choice_icon( choice_index: int ) ​
The icon of one option.
void set_choice_icon( choice_index: int, icon: CompressedTexture2D ) ​
Sets the icon of one option.
void add_choice_option( rewards: Array, icon: CompressedTexture2D = null ) ​
Adds an option with its rewards and icon.
bool remove_choice_option( choice_index: int ) ​
Removes an option. False when the number is not valid.
void clear_choice_options() ​
Removes every option.
bool apply_choice( player: Player, choice_index: int ) ​
Old way to give an option to a player (use SkillTreeInstance.apply_node_rewards).
String get_choice_summary( choice_index: int ) ​
A short text about what an option gives.
Array[Dictionary] validate() ​
========== VALIDATION ==========