Inventory reference
The backpack and held-slot components, inventory areas and slot rules, and the slot addresses, stacks and refusals the inventory API works with. For how to use it, see Inventory.
VtUnitInventory
Component. Add it with Add Component → Vantage → Items → VtUnitInventory.
Opt-in backpack for a VtUnit. Pure storage — bagged items push no modifiers / attributes / traits onto the wearer. To activate stat bonuses the consumer transfers an item from inventory to VtUnitEquipment via TryEquip.
Inspector fields
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
Base Capacity (baseCapacity) |
int |
0 | ≥ 0 | Base maximum number of inventory entries (slots). 0 = unlimited. Stackable items count as one entry per stack — a stack of 20 potions occupies one entry, not twenty. Effective capacity = baseCapacity + modifiers on capacityStat (so a ‘bag’ item granting +6 slots is just another VtItemModifier on capacityStat). Ignored when Areas are listed. |
Capacity Stat (capacityStat) |
VtStatDefinition | None | Optional stat that scales the effective capacity. Author a custom VtStatDefinition (e.g. ‘stat.inventory_capacity’) and assign it here; bag-style items then grant flat / percent bonuses on it via the normal VtItemModifier channel. Leave null to use baseCapacity directly. Ignored when Areas are listed. | |
Areas (areas) |
VtInventoryAreaDefinition[] | Empty | Groups of slots, in the order new items fill them, such as a hotbar row and a backpack. Empty keeps one bag sized by Base Capacity. Set before the inventory is first used. |
Scripting API
| Member | Description |
|---|---|
IReadOnlyList<VtInventoryEntry> Entries { get; } |
The occupied slots in order, without the empty ones between them. |
int Count { get; } |
Number of occupied slots. Stackable items count as one slot per stack regardless of count. |
int AreaCount { get; } |
How many areas the inventory has: the listed ones, or 1. |
int EffectiveCapacity { get; } |
Resolved capacity: the sum of the open areas’ sizes. Without areas, baseCapacity plus modifiers on capacityStat. Returns 0 (unlimited) when an area has no limit. Rounded down — partial slots don’t make sense. |
bool IsFull { get; } |
True when EffectiveCapacity is bounded and no further slots can be filled without merging into an existing stack. |
event Action OnInventoryChanged |
Fired after any successful mutation. Subscribers (UI panels) typically re-render the entire inventory from Entries. |
event Action<VtInventorySlotRef> OnSlotChanged |
Fired for each slot a change touched, before OnInventoryChanged. A slot grid redraws just those. |
event Action OnLimitsChanged |
Fired when an area’s size or unit limit changed, such as when a backpack goes on or a buff that raised a limit runs out. A HUD redraws counts and locked slots. |
event Action<VtWorldItem> OnDropped |
Fired on the authority after TryDropSlot put items on the ground, with the spawned world item. |
string AreaId(int areaIndex) |
Ids of the areas in order: the listed areas’ ids, or VtInventorySlotRef.DefaultArea. |
bool IsOpen(string area) |
Whether area exists and is open. An area is shut while its size is 0 or while the equipment slot that opens it is empty. |
VtInventoryEntry GetSlot(VtInventorySlotRef slot) |
What sits in slot; an empty slot has no item. For a VtInventorySlotRef.EquipmentArea address, the worn item with its wear and extra durability. |
int SlotCount(string area = "bag") |
How many slots area shows: its size, more while it holds items past it, or the occupied range for an area without a limit. 0 for a shut or unknown area that holds nothing. |
bool IsSlotLocked(VtInventorySlotRef slot) |
Whether slot lies past its area’s current size, such as a bar slot a backpack has not opened yet, or any slot of a shut area. Nothing new goes into a locked slot; an item left there after the area shrank can still be taken out. |
int CapacityWith(IReadOnlyList<VtSourceOverride> overrides, IReadOnlyList<VtEquipmentSlot> vacated = null, VtEquipmentSlot filled = VtEquipmentSlot.None) |
What EffectiveCapacity would be with the sources in overrides replaced or removed, the equipment slots in vacated empty and filled worn, such as after taking off a backpack. Changes nothing. 0 means unlimited. |
int UnitsIn(string area = "bag") |
Items area holds, counted across every stack. |
int UnitLimit(string area = "bag") |
Most items area may hold in total: its VtInventoryAreaDefinition.unitLimit plus modifiers on its VtInventoryAreaDefinition.unitLimitStat. -1 when only its slots limit it. A HUD shows UnitsIn over this, such as “84 / 200”; the area may hold more than this after the limit dropped, and then takes nothing new until items leave. |
int EntriesAfter(VtItemDefinition takeOne, IReadOnlyList<VtInventoryEntry> puts) |
How many slots the bag would use after one takeOne is removed and each of puts is added once with its wear, the way TryRemoveItem and TryAddItem would do it, ignoring capacity. Either may be null. Changes nothing. |
bool CanAddAfterRemoving(IReadOnlyList<VtRecipeIngredient> takes, VtItemDefinition put, int count) |
Whether count copies of put would fit once every entry of takes is removed. Changes nothing. |
bool CanAddItem(VtItemDefinition item, int count = 1) |
True when count of item would fit entirely: existing stacks fill first, then free slots up to capacity. Pure query; a vendor asks this before charging. |
int HowManyFit(VtItemDefinition item, int count, int wear = 0) |
How many of count copies of item with wear would fit now, within slots, rules and unit limits. Pure query. |
int AddAsMuchAsFits(VtItemDefinition item, int count, int wear = 0, int extraDurability = 0) |
Add as many of count copies as fit, the way TryAddItem places them, and return how many were placed. The caller keeps the rest, such as a pickup left on the ground with the remainder. Copies keep wear and the extraDurability of copies combined into them. 0 on a replica. |
bool TryAddItem(VtItemDefinition item, int count = 1) |
Add count new copies of item. For stackable items, fills existing stacks first (up to maxStackSize each), then the first free slots until either every requested copy is placed or capacity is hit. Returns true iff every requested copy fit. |
bool TryAddItem(VtItemDefinition item, int count, int wear) |
Like TryAddItem, for copies that already took wear, such as a worn axe put away. They only stack with copies of the same wear. |
int WearOfNext(VtItemDefinition item) |
Wear of the copy of item that TryRemoveItem takes first, or 0 when the bag holds none. |
bool TryRemoveItem(VtItemDefinition item, int count = 1) |
Remove count copies of item, from the area with the lowest pay priority first and the last slots first, emptying slots that run out. Returns true iff the requested count was fully removed (false on under-stocked or refused). |
int GetCount(VtItemDefinition item) |
Total count of item across every stack. |
bool TryMove(VtInventorySlotRef from, VtInventorySlotRef to, int count, out VtInventoryRefusal refusal) |
Move count items from one slot to another; 0 moves the whole stack. Into an empty slot, onto the same item (as much as fits), or, for a whole stack, swapping with what is there. A part of a stack cannot swap. A copy of a VtDurabilityMode.Uses item moved onto another copy combines with it: the target keeps the durability of both and the source slot empties. A VtInventorySlotRef.EquipmentArea address on either side puts the item on, takes it off, or moves it between worn slots, with equipment’s own checks; moving a Uses copy between the bag and a worn copy combines them too. Authority-gated; a predicting client sends the request. |
bool CanMove(VtInventorySlotRef from, VtInventorySlotRef to, int count, out VtInventoryRefusal refusal) |
Whether TryMove would succeed, without changing anything. A drag view asks this to light up the slot under the pointer. Moves to or from equipment check the item’s slot and requirements and the bag slot’s rules; bag space is checked when the move is made. |
bool TryQuickMove(VtInventorySlotRef from, out VtInventoryRefusal refusal) |
Send the stack in from where it belongs. A copy of a VtDurabilityMode.Uses item combines into the copy the unit wears; an item that can be worn goes on when its equipment slot is empty; a worn item comes off into the bag; anything else goes to the other open areas, topping up stacks first, then free slots, preferred areas first, and whatever does not fit stays. Refused with VtInventoryFailureReason.NoRoom when nothing moved. Authority-gated; a predicting client sends the request. |
VtAbilityCastFailReason TryUseSlot(VtInventorySlotRef slot, VtAbilityTargetData targetData = default) |
Use the item in slot like TryUseItem, consuming from that stack. Returns VtAbilityCastFailReason.NotGranted for an empty slot or an item without a use. On a predicting client the request is sent and this returns NotGranted. |
bool TryDropSlot(VtInventorySlotRef slot, int count, out VtInventoryRefusal refusal) |
Drop count items from slot to the ground in front of the unit (0 drops the whole stack). The world item comes from the item’s VtItemDefinition.worldItemPrefab, else VtTuning.defaultWorldItemPrefab, and keeps the stack’s wear and extra durability. Refused with VtInventoryFailureReason.NotDroppable for an item that is not VtItemDefinition.isDroppable or has no prefab. Authority-gated; a predicting client sends the request. |
bool CanDrop(VtItemDefinition item, int count = 1) |
True if the inventory contains at least count copies AND the item’s VtItemDefinition.isDroppable is true. TryDropSlot checks this itself; the gate is not part of TryRemoveItem because the same primitive backs use-on-press consumption (which must always succeed regardless of bind state). |
bool CanTrade(VtItemDefinition item, int count = 1) |
True if the item can be included in a trade window. |
bool CanSell(VtItemDefinition item, int count = 1) |
True if the item can be sold to a vendor. |
VtAbilityCastFailReason TryUseItem(VtItemDefinition item, VtAbilityTargetData targetData = default) |
Use a charge of item — fires its VtItemDefinition.useAbility through VtUnitAbilities.TryCast using the supplied target data. On VtAbilityCastFailReason.Success, decrements the inventory stack by 1 if VtItemDefinition.consumeOnUse is true. Returns the cast result so UI / hotbar code can display the failure reason (out of range, on cooldown, etc.). |
void Clear() |
Drop everything in the bag. |
void CaptureSlots(List<VtInventorySlotSnapshot> into) |
Every occupied slot with its position, for a save or a replication snapshot. |
void ApplyInventoryFromNet(IReadOnlyList<VtInventorySlotSnapshot> snapshot) |
Net-replication entry point: replace the inventory with the authoritative snapshot, each stack in its slot. Stacks whose slot is unknown or taken go to the first free slots, past capacity if need be, so nothing is lost. Bypasses the authority gate — the consumer’s net layer guarantees the snapshot is from the host. Fires OnInventoryChanged so UI re-renders. |
void ApplyInventoryFromNet(IReadOnlyList<VtInventoryEntry> snapshot) |
Net-replication entry point for a snapshot without positions: the stacks fill the slots in order. Bypasses the authority gate. Fires OnInventoryChanged so UI re-renders. |
VtUnitHeldSlot
Component. Add it with Add Component → Vantage → Items → VtUnitHeldSlot. Adds VtUnitInventory automatically.
Makes the selected slot of an inventory area the unit’s main hand, as in games where the hotbar is the inventory: the item stays in its slot while it is held, switching slots switches what is held, and the held item’s bonuses, abilities and wear work as if it were worn in VtEquipmentSlot.MainHand. Wear lands on the slot’s stack. Without this component the main hand is a normal equipment slot.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Area (area) |
VtInventoryAreaDefinition | None | Area whose selected slot is held in the main hand, such as the hotbar. Empty uses the bag of an inventory without areas. |
Scripting API
| Member | Description |
|---|---|
int Selected { get; } |
The selected slot’s index in the area, or -1. |
string AreaId { get; } |
Id of the area the held slot is in. |
VtInventorySlotRef SelectedSlot { get; } |
The selected slot’s address. Only meaningful while Selected is 0 or more. |
VtInventoryEntry Held { get; } |
What sits in the selected slot, or nothing. |
event Action<int> OnSelectionChanged |
Fired when the selected slot changes, with the new index (-1 for none). |
void Initialize() |
Cache siblings and subscribe. Safe to call more than once; call it right after adding the component from code. |
bool Select(int index, out VtEquipFailureReason reason) |
Hold the item in slot index of the area; -1 holds nothing. Refused, changing nothing, when the slot does not exist, lies past the area’s current size, or when the item cannot be held: its requirements, the two-hand rule, or no room in the bag for an off-hand item that has to come off. On a predicting client the request is sent and this returns false with VtEquipFailureReason.AuthorityNotLocal. |
void ApplySelectionFromNet(int index) |
Mirror a selection from the authority or a save. The item is held without checking its requirements again, since the authority already did and a loading unit may not have its attributes back yet. |
VtInventoryAreaDefinition
Asset. Create it with Create → Vantage → Items → Inventory Area.
A named group of slots in a VtUnitInventory, such as a hotbar row, a backpack or a quiver. List areas on the inventory in the order new items fill them. A bag without areas has one, sized by VtUnitInventory.baseCapacity.
Inspector fields
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
Id (id) |
string |
Empty | Stable identifier for saves, network payloads and slot addresses. Convention: ‘area. |
|
Display Name (displayName) |
string |
Empty | Name a window shows over the area. | |
Base Size (baseSize) |
int |
6 | ≥ 0 | Slots in the area. 0 without a Size Stat makes an area that grows as needed. |
Size Stat (sizeStat) |
VtStatDefinition | None | Optional stat that changes the size, like a bag item granting +6. Size = Base Size plus the stat’s modifiers. A size of 0 shuts the area. | |
Unit Limit (unitLimit) |
int |
0 | ≥ 0 | Most items the area holds in total, counted across every stack, such as a pouch of 50 materials. 0 without a Unit Limit Stat leaves only the slots as the limit. |
Unit Limit Stat (unitLimitStat) |
VtStatDefinition | None | Optional stat that raises the unit limit, like a backpack granting +150. Unit limit = Unit Limit plus the stat’s modifiers. | |
Opened By (openedBy) |
VtEquipmentSlot | None |
Equipment slot that must hold an item for the area to be open, such as Back for a backpack area. None keeps it always open. | |
Preferred Tags (preferredTags) |
VtItemTagDefinition[] | Empty | New items with any of these tags try this area before the others, such as materials into the backpack. | |
Pay Priority (payPriority) |
int |
0 | Lower pays crafting and building costs first. On a tie, the area listed later pays first. | |
Rules (rules) |
VtInventorySlotRule[] | Empty | Rules every slot of the area must pass, such as ‘ammunition only’. | |
Slot Rules (slotRules) |
VtInventorySlotRuleOverride[] | Empty | Extra rules for single slots. |
Scripting API
| Member | Description |
|---|---|
string Id { get; } |
The id, or the asset name when the id is empty. |
bool Prefers(VtItemDefinition item) |
Whether new copies of item try this area first. |
VtItemTagSlotRule
Asset. Create it with Create → Vantage → Items → Slot Rules → Item Tag. Inherits VtInventorySlotRule.
Slot rule: the item must carry one of tags, such as ammunition for a quiver. With invert it must carry none of them.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Reason Key (reasonKey) |
string |
Empty | Localization key or plain text shown when this rule refuses. Empty shows the generic text. |
Tags (tags) |
VtItemTagDefinition[] | Empty | The item must carry at least one of these tags. |
Invert (invert) |
bool |
Off | Refuse items with any of these tags instead. |
VtEquipmentKindSlotRule
Asset. Create it with Create → Vantage → Items → Slot Rules → Equipment Kind. Inherits VtInventorySlotRule.
Slot rule: only items worn in one of slots, such as off-hand items for a belt slot. VtEquipmentSlot.None in the list admits items that cannot be worn.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Reason Key (reasonKey) |
string |
Empty | Localization key or plain text shown when this rule refuses. Empty shows the generic text. |
Slots (slots) |
VtEquipmentSlot[] | Empty | Equipment slots whose items this slot takes. Rings and trinkets match either slot of their pair. |
VtStackableSlotRule
Asset. Create it with Create → Vantage → Items → Slot Rules → Stackable. Inherits VtInventorySlotRule.
Slot rule: only items that stack, such as materials for a resource pouch.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Reason Key (reasonKey) |
string |
Empty | Localization key or plain text shown when this rule refuses. Empty shows the generic text. |
VtInventoryEntry
Serializable struct.
One slot in a VtUnitInventory’s flat backpack — a (definition, count) pair. Stackable items merge their counts in a single entry up to VtItemDefinition.maxStackSize; non-stackable items each occupy their own entry with count = 1.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Item (item) |
VtItemDefinition | None | The item in the slot. Empty for an empty slot. |
Count (count) |
int |
0 | How many copies the stack holds. Always 1 for items that do not stack. |
Wear (wear) |
int |
0 | Durability lost, from 0 (new) to the full durability (broken). Always 0 for items that do not wear out. |
Extra Durability (extraDurability) |
int |
0 | Durability added by copies combined into this one (Durability Mode Uses). 0 for a single copy and for every other item. |
Scripting API
| Member | Description |
|---|---|
int Capacity { get; } |
Full durability of this entry: the item’s VtItemDefinition.maxDurability plus extraDurability. 0 for items that do not wear out. |
int Durability { get; } |
Durability left: Capacity minus wear. 0 for items that do not wear out. |
float DurabilityFraction { get; } |
Durability left as a fraction of Capacity; 1 for items that do not wear out. |
static int CapacityOf(VtItemDefinition item, int extraDurability) |
Full durability of item with extraDurability combined in. 0 for items that do not wear out. |
static int ClampWear(VtItemDefinition item, int wear) |
wear kept inside what one copy of item can take: 0 for items that do not wear out. |
static int ClampWear(VtItemDefinition item, int wear, int extraDurability) |
wear kept inside what item with extraDurability combined in can take. |
static int ClampExtra(VtItemDefinition item, int extraDurability) |
extraDurability kept to what item can hold: 0 unless its copies combine (VtItemDefinition.CombinesDurability). |
VtInventorySlotRef
Serializable struct.
The address of one slot in a VtUnitInventory: an area id and a position in it. A bag without authored areas has one area, DefaultArea.
Inspector fields
| Field | Type | Default | Description |
|---|---|---|---|
Area (area) |
string |
Empty | Id of the area: an inventory area’s id, ‘bag’ for a bag without areas, or ‘equipment’ for worn items. |
Index (index) |
int |
0 | Position in the area, from 0. For the equipment area, the equipment slot’s number. |
Scripting API
| Member | Description |
|---|---|
bool IsEquipment { get; } |
True when this addresses worn equipment. |
const string DefaultArea |
Id of the single area of a bag without authored areas. |
const string EquipmentArea |
Id that addresses worn equipment: index is the VtEquipmentSlot. Moving to or from it puts items on and takes them off. |
static VtInventorySlotRef Worn(VtEquipmentSlot slot) |
The worn equipment slot slot. |
static VtInventorySlotRef InBag(int index) |
Slot index of the default area. |
VtStartingInventoryEntry
Serializable struct.
One row in VtUnitDefinition.startingInventory — a (item, count) pair. Stackable items merge their counts into a single inventory entry up to VtItemDefinition.maxStackSize; non-stackable items each get their own entry per copy.
Inspector fields
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
Item (item) |
VtItemDefinition | None | Item to add to the inventory at spawn. | |
Count (count) |
int |
0 | ≥ 1 | How many copies to add. Stackable items merge into a single entry; non-stackable items each get their own entry. |
VtInventorySlotRule
Abstract asset base. Shipped subclasses: VtEquipmentKindSlotRule, VtItemTagSlotRule, VtStackableSlotRule.
Base for slot rules authored as assets. Subclass it, implement Check, and add a CreateAssetMenu.
Inspector fields
| Field | Type | Description |
|---|---|---|
Reason Key (reasonKey) |
string |
Localization key or plain text shown when this rule refuses. Empty shows the generic text. |
Scripting API
| Member | Description |
|---|---|
virtual bool Accepts(VtItemDefinition item, in VtInventorySlotContext context, out string reasonKey) |
True when Check passes; otherwise returns false with this rule’s reasonKey. Override it only to build the refusal text yourself. |
protected abstract bool Check(VtItemDefinition item, in VtInventorySlotContext context) |
True when the slot takes item. |
IVtInventorySlotRule
Interface. Implemented by VtEquipmentKindSlotRule, VtItemTagSlotRule, VtStackableSlotRule.
A check of your own on what a slot takes, such as “ammunition only” for a quiver. List rules on an VtInventoryAreaDefinition for every slot of the area, or for single slots. Placing new items skips slots that refuse; moving into one is refused with VtInventoryFailureReason.RefusedByRule.
Scripting API
| Member | Description |
|---|---|
bool Accepts(VtItemDefinition item, in VtInventorySlotContext context, out string reasonKey) |
True when the slot takes item. Otherwise set reasonKey to a localization key or plain text, or leave it empty for the generic text. |
VtInventorySlotContext
Struct.
Everything a IVtInventorySlotRule is told about the slot it guards.
Scripting API
| Member | Description |
|---|---|
readonly VtUnitInventory Inventory |
The inventory the slot belongs to. |
readonly VtInventoryAreaDefinition Area |
The area the slot is in. |
readonly int Index |
The slot’s position in the area. |
VtInventoryRefusal
Struct.
Why a slot operation was refused: the reason and, when a slot rule refused, the rule’s key. VtFailureText.Describe turns it into text.
Scripting API
| Member | Description |
|---|---|
bool IsNone { get; } |
True when nothing refused. |
static readonly VtInventoryRefusal None |
No refusal. |
readonly VtInventoryFailureReason Reason |
The reason. |
readonly string RuleKey |
Localization key or text from the rule that refused, or empty. |
readonly VtEquipFailureReason EquipReason |
Why equipment refused, when Reason is VtInventoryFailureReason.EquipRefused. |
static VtInventoryRefusal FromEquip(VtEquipFailureReason reason) |
A refusal by equipment. VtEquipFailureReason.None is no refusal and VtEquipFailureReason.AuthorityNotLocal maps to VtInventoryFailureReason.AuthorityNotLocal. |
VtInventorySlotRuleOverride
Serializable struct.
Slot rules for one slot of an area, on top of the area’s own rules.
Inspector fields
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
Index (index) |
int |
0 | ≥ 0 | Position of the slot in the area, from 0. |
Rules (rules) |
VtInventorySlotRule[] | Empty | Rules this slot must also pass. |
Enums
VtEquipmentSlot
The set of equipment slots an item can occupy on a unit. Used as the key for the slot map on VtUnitEquipment and as the source-id suffix when equipped items push their modifiers / attributes / traits ("equipment_<slot>").
| Value | Description |
|---|---|
None |
Inventory-only / non-equippable. Potions, materials, quest items. |
Head |
Helm / hat / hood. |
Chest |
Chestpiece / robe / breastplate. |
Legs |
Leg armor / pants / greaves. |
Feet |
Boots / sandals / sabatons. |
Hands |
Gloves / gauntlets / bracers. |
MainHand |
Primary weapon. 2H weapons occupy this slot and block OffHand. |
OffHand |
Off-hand weapon, shield, or focus. Auto-unequipped when a 2H is equipped to MainHand. |
Neck |
Necklace / amulet / pendant. |
Ring1 |
First ring slot. Members of the Ring family. |
Ring2 |
Second ring slot. Members of the Ring family. |
Trinket1 |
First trinket slot. Members of the Trinket family. |
Trinket2 |
Second trinket slot. Members of the Trinket family. |
Back |
Worn on the back: backpack, cloak, quiver. |
VtAbilityCastFailReason
Result of VtUnitAbilities.TryCast. Success means the cast started (instant abilities resolve the same frame; casts with non-zero castTime begin their cast bar). All other values are soft failures — callers can surface them to UI as feedback (“not enough mana”, “out of range”, …) without exceptions.
| Value | Description |
|---|---|
Success |
Cast accepted. Either resolved this frame (instant) or cast bar started. |
NotGranted |
Ability is not in the caster’s granted list. |
InvalidTarget |
Target does not match the ability’s VtTargetingMode (e.g. single-target ability cast with no target). |
OutOfRange |
Target is out of the ability’s range. |
NotEnoughResource |
Caster’s resource pool cannot cover the ability’s resourceCost. |
OnCooldown |
Per-ability cooldown is still ticking. |
OnGCD |
Global cooldown is active and this ability does not ignore it. |
AlreadyCasting |
Caster is mid-cast of another ability (and the queue is full / disabled). |
Incapacitated |
Caster’s traits forbid casting right now (silenced / stunned / CanCast=false). |
CasterDead |
Caster is dead. |
VtEquipFailureReason
Why an attempted VtUnitEquipment.TryEquip / VtUnitEquipment.CanEquip call refused the operation. Returned via the out parameter so callers (UI tooltips, AI, item-pickup handlers) can surface a precise reason without guesswork.
| Value | Description |
|---|---|
None |
The operation succeeded — the request would equip cleanly. |
NullItem |
The supplied item was null. |
SlotMismatch |
The slot the caller asked for doesn’t match the item’s authored slot (and isn’t in the same family for ring / trinket items). |
LevelTooLow |
The wearer’s level is below the item’s VtItemRequirements.levelMin. |
AttributeTooLow |
The wearer’s resolved attribute totals don’t satisfy one of VtItemRequirements.attributeMins. |
MissingRequiredTag |
The wearer doesn’t have VtItemRequirements.requiredUnitTag. |
SlotOccupiedBlocked |
A slot conflict that cannot be auto-resolved — typically equipping into VtEquipmentSlot.OffHand while a two-handed weapon occupies VtEquipmentSlot.MainHand. Caller must unequip the conflicting slot first. |
AuthorityNotLocal |
The caller is not the authoritative owner of this unit. In multiplayer modes VtUnitEquipment.TryEquip rejects on replicas; the authoritative side mutates and the net layer mirrors via VtUnitEquipment.ApplyEquippedFromNet. |
NotInInventory |
VtUnitEquipment.TryEquipFromInventory was asked for an item the unit’s bag does not hold. |
InventoryFull |
The unit’s bag has no room for the item taken off. |
WouldOverflowInventory |
The item adds to the bag’s capacity, and without it the bag could no longer hold what it holds. Empty the bag first. |
TargetSlotRefused |
The bag slot named to take the item holds something that cannot be worn there, is shut, or its rules refuse the item. |
HeldSlotFull |
A VtUnitHeldSlot holds the main hand and its area has no free slot for the item. |
VtInventoryFailureReason
Why a slot operation on a VtUnitInventory was refused.
| Value | Description |
|---|---|
None |
It worked. |
NoSuchSlot |
The area or slot does not exist on this inventory. |
SlotEmpty |
The slot to take from is empty. |
AreaShut |
The area is shut, for example because the backpack that opens it is not worn. |
RefusedByRule |
A slot rule refused the item. VtInventoryRefusal.RuleKey says why. |
NotEnough |
More was asked for than the stack holds. |
CannotSwap |
Part of a stack cannot be swapped with a different item; move all of it or pick an empty slot. |
TargetFull |
The stack in the target slot is full. |
NoRoom |
No other slot has room. |
AuthorityNotLocal |
The caller is not the authority for this unit; the request was sent to it. Not a refusal: VtFailureText.Describe returns no text for it. |
EquipRefused |
Putting an item on or taking it off was refused. VtInventoryRefusal.EquipReason says why. |
CarryLimit |
The target area already holds as many items as its unit limit allows. |
NotDroppable |
The item cannot be dropped: it is bound, or no world item prefab is set for it. |