Skip to content
smartargs
VantageDocumentation

Progression reference

The component that tracks talent ranks and attribute points, and the talent tree and talent assets. For how to use it, see Progression.

VtUnitProgression

Component. Add it with Add Component → Vantage → Progression → VtUnitProgression. Adds VtUnit automatically.

Talent ranks and attribute points for one unit, earned from its level through the VtTalentTreeDefinition. Learning a talent pushes its grants into the unit’s modifiers, attributes, traits and abilities under a source per talent; a reset pulls them all out. Attached by VtUnit when the definition has a tree.

Inspector fields

Field Type Default Description
Tree (tree) VtTalentTreeDefinition None The class or specialization this unit progresses through. Required.

Scripting API

Member Description
IReadOnlyDictionary<VtTalentDefinition, int> Ranks { get; } Rank per learned talent.
IReadOnlyDictionary<VtAttributeDefinition, int> AttributePoints { get; } Points spent per attribute.
int TalentPointsTotal { get; } Talent points earned so far, spent or not.
int TalentPointsSpent { get; } Talent points spent on learned ranks. Auto-learned talents are free and count nothing.
int TalentPointsAvailable { get; } Talent points left to spend.
int AttributePointsTotal { get; } Attribute points earned so far, spent or not.
int AttributePointsSpent { get; } Attribute points spent.
int AttributePointsAvailable { get; } Attribute points left to spend.
int BonusTalentPoints { get; } Bonus talent points granted so far.
int BonusAttributePoints { get; } Bonus attribute points granted so far.
event Action<VtTalentDefinition, int> OnTalentLearned Fires after a rank was learned: (talent, new rank).
event Action<VtAttributeDefinition, int> OnAttributePointSpent Fires after a point went into an attribute: (attribute, points in it).
event Action OnReset Fires after every rank and point was refunded.
event Action OnPointsChanged Fires whenever the available point counts may have changed.
void Initialize() Cache siblings, subscribe to level-ups and run the auto-learn pass. Idempotent; public for the late-attach path.
int GetRank(VtTalentDefinition talent) Current rank of talent, 0 when not learned.
int GetAttributePoints(VtAttributeDefinition attribute) Points spent in attribute.
bool CanLearn(VtTalentDefinition talent, out VtProgressionFailureReason reason) Whether the next rank of talent could be learned now. Pure query.
bool TryLearn(VtTalentDefinition talent, out VtProgressionFailureReason reason) Learn the next rank of talent. Forwards on a predicting client.
bool TrySpendAttributePoint(VtAttributeDefinition attribute, out VtProgressionFailureReason reason) Put one point into attribute. Forwards on a predicting client.
bool Reset() Refund every rank and attribute point. Auto-learn talents come back at once. Forwards on a predicting client.
void GrantBonusTalentPoints(int amount) Add talent points beyond what the level gives, for quest rewards or books.
void GrantBonusAttributePoints(int amount) Add attribute points beyond what the level gives.
void ApplyProgressionFromNet(IReadOnlyList<KeyValuePair<VtTalentDefinition, int>> talentRanks, IReadOnlyList<KeyValuePair<VtAttributeDefinition, int>> spentAttributePoints, int bonusTalent, int bonusAttribute) Replace every rank and point. Used by loading and replication; not authority-gated.

VtTalentTreeDefinition

Asset. Create it with Create → Vantage → Progression → Talent Tree.

A class or specialization: the talents a unit can learn and how many talent and attribute points it earns per level. Assign to VtUnitDefinition.talentTree; VtUnit attaches a VtUnitProgression that tracks ranks and points.

Inspector fields

General

Field Type Default Range Description
Id (id) string Empty Stable string identifier. Convention: ‘tree.’.
Display Name (displayName) string Empty Name shown as the class or specialization.
Talents (talents) VtTalentDefinition[] Empty Every talent in this tree. Order is presentation only; prerequisites define the shape.

Talent points

Field Type Default Range Description
Starting Talent Points (startingTalentPoints) int 0 ≥ 0 Points available at level 1.
Talent Points Per Level (talentPointsPerLevel) int 1 ≥ 0 Points gained per level after the first.

Attribute points

Field Type Default Range Description
Starting Attribute Points (startingAttributePoints) int 0 ≥ 0 Attribute points available at level 1.
Attribute Points Per Level (attributePointsPerLevel) int 0 ≥ 0 Attribute points gained per level after the first. 0 = no manual attribute allocation.
Spendable Attributes (spendableAttributes) VtAttributeDefinition[] Empty Attributes points may go into. Empty = any attribute.

Scripting API

Member Description
bool Contains(VtTalentDefinition talent) True when talent belongs to this tree.
bool AllowsAttribute(VtAttributeDefinition attribute) True when points may go into attribute.

VtTalentDefinition

Asset. Create it with Create → Vantage → Progression → Talent.

One node of a talent tree: what it costs, what it needs, and what each rank grants. Ranks stack the modifiers and attribute grants; abilities and trait overrides apply once at the first rank. Author the asset, drag it into a VtTalentTreeDefinition, and the player’s VtUnitProgression does the rest.

Inspector fields

General

Field Type Default Range Description
Id (id) string Empty Stable string identifier for save files and network payloads. Convention: ‘talent..’.
Display Name (displayName) string Empty Name shown in the tree.
Description (description) string Empty What it does, shown in the tooltip.
Icon (icon) Sprite None Icon for the tree.

Requirements

Field Type Default Range Description
Required Level (requiredLevel) int 1 ≥ 1 Minimum unit level for the first rank.
Prerequisites (prerequisites) VtTalentPrerequisite[] Empty Talents that must be learned first, each at the given rank.

Ranks

Field Type Default Range Description
Max Rank (maxRank) int 1 ≥ 1 How many times it can be learned. Grants below scale with the rank.
Point Cost (pointCost) int 1 ≥ 0 Talent points each rank costs. 0 with Auto Learn = a free unlock.
Auto Learn (autoLearn) bool Off Learn automatically, at no cost, as soon as the level and prerequisites allow.

Grants

Field Type Default Range Description
Abilities (abilities) VtAbilityDefinition[] Empty Abilities granted at the first rank and revoked on reset.
Modifiers Per Rank (modifiersPerRank) VtItemModifier[] Empty Stat modifiers per rank. Rank 3 applies three times the value.
Attribute Grants Per Rank (attributeGrantsPerRank) VtAttributeGrant[] Empty Attribute grants per rank. Rank 3 applies three times the value.
Trait Overrides (traitOverrides) VtTraitOverride[] Empty Trait overrides applied while any rank is learned.

VtTalentPrerequisite

Serializable struct.

A talent that must be learned before another, at least to the given rank.

Inspector fields

Field Type Default Range Description
Talent (talent) VtTalentDefinition None Talent required first.
Rank (rank) int 0 ≥ 1 Rank it must have reached.

Enums

VtProgressionFailureReason

Why a VtUnitProgression.CanLearn, VtUnitProgression.TryLearn or VtUnitProgression.TrySpendAttributePoint call refused.

Value Description
None Nothing refused; the call succeeded.
NoTree The unit has no talent tree.
NotInTree The talent is not part of the unit’s tree, or is null.
MaxRank Every rank is already learned.
LevelTooLow The unit’s level is below the talent’s requirement.
MissingPrerequisite A prerequisite talent is missing or below the required rank.
NoPoints Not enough unspent points.
AttributeNotAllowed The tree does not allow points in that attribute, or the attribute is null.
AuthorityNotLocal Not the authority; the request was forwarded.