Skip to content
smartargs
VantageDocumentation

Summons reference

The components on a caster and its summons, the companion AI, and the ability effect that summons units. For how to use it, see Summons.

VtUnitSummons

Component. Add it with Add Component → Vantage → Summons → VtUnitSummons. Adds VtUnit automatically.

The summons a unit currently controls. Added to the caster by VtSummonEffect the first time it summons. Your pet bar reads Active and calls DismissAll or SetStance; both forward on a networked client.

Scripting API

Member Description
IReadOnlyList<VtSummon> Active { get; } Live summons in the order they were summoned.
event Action<VtSummon> OnSummoned Fires after a summon was bound to this unit.
event Action<VtSummon> OnSummonEnded Fires after a summon ended.
int CountFrom(VtSummonEffect source) Live summons created by source, not counting ones already ending.
VtSummon OldestFrom(VtSummonEffect source) The earliest live summon created by source, or null.
bool DismissAll() End every summon. False when there were none, or on a networked client.
bool SetStance(VtCompanionStance stance) Set the stance of every summon with a companion AI. False when none has one, or on a networked client.

VtSummon

Component. Add it with Add Component → Vantage → Summons → VtSummon. Adds VtUnit automatically.

Marks a unit as summoned by an owner: fights for the owner’s faction, earns kill credit for the owner, counts as the owner’s party, and ends when its lifetime runs out, when it dies, when the owner dies, or when dismissed. Added by VtSummonEffect; you rarely add it by hand.

Scripting API

Member Description
VtUnit Unit { get; } The summoned unit.
VtUnit Owner { get; } The unit this summon fights for, or null when it is gone.
VtSummonEffect Source { get; } The effect that created this summon, or null for a replicated or hand-bound one.
bool IsPermanent { get; } True when the summon has no lifetime and lasts until it dies or is dismissed.
float SecondsRemaining { get; } Seconds of lifetime left; 0 for permanent summons.
bool DismissOnOwnerDeath { get; } True when the owner’s death ends this summon.
bool IsEnding { get; } True once the summon is ending or has ended.
event Action<VtSummon> OnEnded Fires once when the summon ends, just before it is despawned.
void Bind(VtUnit newOwner, VtSummonEffect fromEffect, float lifetimeSeconds, bool inheritOwnerFaction, bool dismissWhenOwnerDies) Tie this unit to newOwner. Called by the summon effect on the authority.
void ApplySummonFromNet(VtUnit newOwner, bool inheritOwnerFaction) Mirror the owner link on a replica. Not authority-gated.
bool Dismiss() End the summon now. On the owner’s networked client the request is forwarded.
void Tick(float deltaTime) Count down the lifetime and finish a pending end. Authority only.
static VtUnit ResolveCreditUnit(VtUnit unit) The unit that earns credit for unit’s kills: its owner when it is a summon, following chains of summons, otherwise the unit itself.
static VtUnitId ResolveCreditId(VtUnitId id) Id form of ResolveCreditUnit. Unknown ids come back unchanged.

VtCompanionAi

Component. Add it with Add Component → Vantage → Summons → VtCompanionAi. Adds VtSummon automatically.

Brain for a summon or pet: follows its owner, fights by VtCompanionStance, and teleports back when left too far behind. Added by VtSummonEffect; it switches off a VtHostileAi on the same unit so the two never fight over the target.

Inspector fields

Field Type Default Range Description
Stance (stance) VtCompanionStance Defensive How the companion fights.
Follow Distance (followDistance) float 3 ≥ 0 The companion stops following once it is this close to its owner.
Leash Distance (leashDistance) float 30 ≥ 0 Farther than this from its owner, the companion drops its target and teleports back. 0 = never.
Assist Range (assistRange) float 20 ≥ 0 Targets farther than this from the owner are ignored or dropped.
Think Interval (thinkInterval) float 0.25 ≥ 0.05 Seconds between target decisions while idle.

Scripting API

Member Description
IVtAttackable CurrentTarget { get; } The unit the companion is attacking, or null.
void Initialize() Cache siblings and switch off a hostile AI on the same unit. Idempotent.
void SetStance(VtCompanionStance newStance) Change how the companion fights. Passive drops the current target. Authority only.
void Tick(float deltaTime) Advance one decision step. Authority only.

VtSummonEffect

Asset. Create it with Create → Vantage → Abilities → Effects → Summon. Inherits VtAbilityEffect.

Ability effect: summon units that fight for the caster. Each summon gets a VtSummon tying it to the caster and, by default, a VtCompanionAi that follows and fights. Put it on a Self or Ground Point ability; ground point casts spawn around the point.

Inspector fields

What

Field Type Default Range Description
Prefab (prefab) GameObject None Prefab with a VtUnit. Required.
Definition Override (definitionOverride) VtUnitDefinition None Definition to give the summon. Empty = the prefab’s own.
Count (count) int 1 ≥ 1 Units spawned per cast.

Limits

Field Type Default Range Description
Max Active (maxActive) int 1 ≥ 0 Most summons from this effect the caster may have at once. The oldest is dismissed to make room. 0 = no limit.
Lifetime Seconds (lifetimeSeconds) float 0 ≥ 0 Seconds each summon lasts. 0 = until it dies or is dismissed.
Dismiss On Owner Death (dismissOnOwnerDeath) bool On End the summons when the caster dies.

Behaviour

Field Type Default Range Description
Spawn Radius (spawnRadius) float 1.5 ≥ 0 Distance from the caster or ground point at which summons appear, spread in a circle.
Inherit Owner Faction (inheritOwnerFaction) bool On Summons fight for the caster’s faction instead of their definition’s.
Add Companion Ai (addCompanionAi) bool On Add a VtCompanionAi so the summon follows and fights on its own.
Stance (stance) VtCompanionStance Defensive Stance the companion AI starts in.

Scripting API

Member Description
override void Execute(in VtAbilityContext ctx) Summon count units around the caster, or around the ground point for a ground point ability, dismissing the oldest first when maxActive is reached.

Enums

VtCompanionStance

How a VtCompanionAi fights.

Value Description
Passive Follows the owner and never attacks.
Defensive Attacks what the owner attacks and whatever hurts the owner or the companion.
Aggressive Like Defensive, and also attacks hostiles that come inside its aggro range.