Skip to content
smartargs
VantageDocumentation

Localization reference

The language table asset, the resolver every display string passes through, and the text for failure reasons. For how to use it, see Localization.

VtLocalizationTable

Asset. Create it with Create → Vantage → Localization → Localization Table.

One language: a list of key and text pairs. Create one per language, fill it from your sheet, and install it with VtLocalization.SetTable. Keys are the strings authored on definitions, so an untranslated key shows as itself.

Inspector fields

Field Type Default Description
Language (language) string "en" Language code, for example ‘en’ or ‘de-DE’. Informational.
Entries (entries) VtLocalizationEntry[] Empty Key and translated text, one row per string.

Scripting API

Member Description
bool TryGet(string key, out string text) Look up key. False when the table has no row for it or the row is empty.
void Rebuild() Rebuild the lookup after editing entries at runtime.

VtLocalizationEntry

Serializable class.

One translated string.

Inspector fields

Field Type Default Description
Key (key) string Empty The string as authored on the definition, for example ‘item.sword.name’ or the English text.
Text (text) string Empty What to show in this language.

VtLocalization

Static class.

Turns an authored display string into the text to show. Every displayName, description, dialogue line and answer in the package passes through Resolve before it reaches the screen, and your UI should do the same for anything it reads off a definition.

Scripting API

Member Description
static VtLocalizationTable Table { get; } The table answering lookups, or null.
static string Language { get; } Language code of the current table, or empty.
static Func<string, string> Resolver { get; set; } Custom lookup that takes precedence over the table. Return null to fall through to the table and then to the raw string.
static event Action OnLanguageChanged Fires after the table or resolver changed. Redraw text here.
static void SetTable(VtLocalizationTable newTable) Install newTable as the current language. Null clears it.
static string Resolve(string keyOrText) The text to show for keyOrText: the resolver’s answer, else the table’s, else the built-in default, else the string itself.
static void RegisterDefaults(IEnumerable<KeyValuePair<string, string>> entries) Register built-in text for keys, used when neither the resolver nor the table has a key. Registering a key again replaces its text. The package registers its own keys at load; a module of your own can register the English of its keys the same way.
static bool TryGetDefault(string key, out string text) The built-in text registered for key, if any.
static string Format(string keyOrText, params object[] args) Resolve followed by string.Format with args, for lines with numbers in them.

VtFailureText

Static class.

The text to show a player when a gameplay call refuses. Every failure reason in the package has a localization key and a built-in English line, so a toast or a tooltip is one call to Describe.

Scripting API

Member Description
const string KeyPrefix Prefix every failure-reason key starts with.
static string Key(VtAbilityCastFailReason reason) Localization key for an ability cast failure.
static string Key(VtCraftFailureReason reason) Localization key for a crafting failure.
static string Key(VtEquipFailureReason reason) Localization key for an equip failure.
static string Key(VtProgressionFailureReason reason) Localization key for a talent or attribute point failure.
static string Key(VtBuildFailureReason reason) Localization key for a building failure.
static string Key(VtVendorFailureReason reason) Localization key for a vendor failure.
static string Key(VtResourceNodeFailureReason reason) Localization key for a refused hit on a resource node.
static string Key(VtPartyFailureReason reason) Localization key for a party failure.
static string Key(VtChatFailureReason reason) Localization key for a chat failure.
static string Key(VtGuildFailureReason reason) Localization key for a guild failure.
static string Key(VtFriendsFailureReason reason) Localization key for a friend list failure.
static string Key(VtMailFailureReason reason) Localization key for a mail failure.
static string Key(VtUnlockFailureReason reason) Localization key for an unlock failure.
static string Key(VtInventoryFailureReason reason) Localization key for a refused inventory slot operation.
static string Describe(VtInventoryFailureReason reason) Text for a refused inventory slot operation; empty for VtInventoryFailureReason.None and for VtInventoryFailureReason.AuthorityNotLocal, which means the request was sent to the authority, so a view can show the result of every slot call without toasting on clients.
static string Describe(VtInventoryRefusal refusal) Text for a refused inventory slot operation: the refusing slot rule’s key resolved through VtLocalization when it has one, else the text of its reason.
static string Describe(VtAbilityCastFailReason reason) Text for an ability cast failure; empty for VtAbilityCastFailReason.Success.
static string Describe(VtCraftFailureReason reason) Text for a crafting failure; empty for VtCraftFailureReason.None.
static string Describe(VtEquipFailureReason reason) Text for an equip failure; empty for VtEquipFailureReason.None.
static string Describe(VtProgressionFailureReason reason) Text for a talent or attribute point failure; empty for VtProgressionFailureReason.None.
static string Describe(VtBuildFailureReason reason) Text for a building failure; empty for VtBuildFailureReason.None.
static string Describe(VtBuildRefusal refusal) Text for a refused placement: the refusing rule’s key resolved through VtLocalization when it has one, else the text of its reason. Empty when nothing refused.
static string Describe(VtVendorFailureReason reason) Text for a vendor failure; empty for VtVendorFailureReason.None.
static string Describe(VtResourceNodeFailureReason reason) Text for a refused hit on a resource node; empty for VtResourceNodeFailureReason.None.
static string Describe(VtPartyFailureReason reason) Text for a party failure; empty for VtPartyFailureReason.None.
static string Describe(VtChatFailureReason reason) Text for a chat failure; empty for VtChatFailureReason.None.
static string Describe(VtGuildFailureReason reason) Text for a guild failure; empty for VtGuildFailureReason.None.
static string Describe(VtFriendsFailureReason reason) Text for a friend list failure; empty for VtFriendsFailureReason.None.
static string Describe(VtMailFailureReason reason) Text for a mail failure; empty for VtMailFailureReason.None.
static string Describe(VtUnlockFailureReason reason) Text for an unlock failure; empty for VtUnlockFailureReason.None.
static bool TryGetEnglish(string key, out string text) The built-in English line for key. False when the key is not a failure-reason key.

Enums

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.

VtCraftFailureReason

Why a VtUnitCrafter.IsAvailable check or VtUnitCrafter.TryCraft call refused. Surfaced via the out param on those calls and the VtUnitCrafter.OnCraftFailed event so consumer UI can render a precise “you can’t craft this because…” message.

Value Description
None The check passed — recipe is craftable / craft succeeded.
RecipeNull The recipe argument was null.
NotLearned The crafter doesn’t know this recipe yet (not learnedByDefault + not in the unit’s VtUnitRecipeBook).
MissingIngredients The unit’s inventory doesn’t hold enough of one or more VtRecipeDefinition.inputs ingredients.
MissingRequiredItems The unit’s inventory doesn’t hold one or more VtRecipeDefinition.requiredItems tools (must-have but not consumed — e.g. Crafter’s Tools).
WrongStation The recipe requires a station the player isn’t using (null station or wrong type).
LevelTooLow The unit’s VtUnitLevel.Level is below VtRecipeDefinition.requiredLevel.
SkillTooLow The unit’s VtUnitCraftingSkills.GetLevel for the recipe’s VtRecipeDefinition.requiredSkill is below VtRecipeDefinition.requiredSkillLevel.
MissingPrereqQuests One or more VtRecipeDefinition.requiredCompletedQuests haven’t been turned in yet.
AlreadyCrafting A timed craft is already active. Cancel it first or wait for it to complete.
AuthorityNotLocal Replica side refused the mutation; only authority can craft.
NoCrafterComponent The unit doesn’t carry a VtUnitCrafter component. Returned by external helpers; the crafter itself never emits this since it can only be invoked when present.
TooFarFromStation The crafter is farther from the station than its interact radius allows.
Locked The recipe’s VtRecipeDefinition.requiredUnlock is not owned.
InventoryFull The output would go into the crafter’s bag and the bag has no room for it, even after the ingredients are taken out.

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.

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.

VtBuildFailureReason

Why a builder call was refused or a placement is invalid.

Value Description
None Nothing refused: the call succeeded or the placement is valid.
BuildableNull No buildable was given, or it has no prefab.
MissingItems The builder cannot pay the buildable’s item cost.
MissingCurrency The builder cannot pay the buildable’s currency cost.
MissingRequiredItems The builder does not carry the buildable’s required items, such as a hammer.
LevelTooLow The builder’s level is below the buildable’s required level.
MissingPrereqQuests A quest the buildable requires has not been turned in.
BlockedByCollider A collider on the buildable’s forbidden overlap layers is in the way.
NoSurface The cursor points at no surface the piece can stand on.
AlreadyPlacing A placement is already in progress.
NotPlacing Nothing is being placed.
AuthorityNotLocal This copy is not the authority. VtUnitBuilder.TryPlace and VtUnitBuilder.TryDemolish send the request to the authority, which decides.
NoBuilderComponent The unit has no builder component.
NotABuildable The target of a demolish is not something this system placed.
CrossesCliff The footprint spans more than one cliff level or lies on a ramp.
OutOfRange The placement point is farther from the builder than the buildable’s placement range.
Locked The buildable’s VtBuildableDefinition.requiredUnlock is not owned.
BlockedGround The footprint covers a cell the cliff map marks as blocked.
RefusedByRule A placement rule refused. VtBuildRefusal.RuleKey carries the rule’s own reason.

VtVendorFailureReason

Why a VtVendor.CanBuy, VtVendor.CanSell, VtVendor.TryBuy or VtVendor.TrySell call refused.

Value Description
None The trade can go ahead.
VendorNull The vendor component has no definition.
ItemNull No item, or a count of zero.
NotSold The vendor does not carry this item.
OutOfStock The vendor holds fewer than asked.
NoPrice The item has no value currency and no price override.
NoWallet The customer has no wallet.
CannotAfford The customer cannot pay.
NoInventory The customer has no inventory.
InventoryFull The purchase would not fit in the customer’s inventory.
NotSellable The item is not sellable, or the customer holds fewer than offered.
VendorDoesNotBuy This vendor does not buy from players.
TooFar The customer is farther from the vendor than its interact radius allows.
AuthorityNotLocal Not the authority; the request was forwarded.

VtResourceNodeFailureReason

Why a hit on a VtResourceNode was rejected (damage cancelled before it landed). Surfaced via VtResourceNode.OnHarvestFailed so the consumer’s UI can render precise feedback like “Need an axe!” or “Mining 50 required.”

Value Description
None The hit was accepted — the node took damage and harvested.
Depleted The node is currently depleted (already chopped) and is waiting for its respawn timer to elapse.
WrongTool The attacker doesn’t have an item with the required tool tag equipped (e.g. no axe in any equipment slot when chopping a tree).
SkillTooLow The attacker’s level in the required VtCraftingSkillDefinition is below the node’s threshold.
WrongDamageType The damage type (VtDamageType) isn’t in the node’s VtResourceNodeDefinition.acceptedDamageTypes list. E.g. ore takes Blunt only — a Slash sword bounces off.
InventoryFull The attacker’s inventory has no room for even one of anything the node yields, so the hit is refused and the node keeps its HP.

VtPartyFailureReason

Why a VtUnitParty call refused.

Value Description
None The call succeeded.
InvalidTarget No target, the unit itself, a unit without a party component, a hostile unit, or someone not in this party.
TargetInParty The invited unit already belongs to a party.
AlreadyInParty This unit already belongs to a party.
NotInParty This unit belongs to no party.
NotLeader Only the leader may do this.
PartyFull The party has VtTuning.partyMaxSize members.
NoInvite No invite is pending, or the inviter is gone.
AuthorityNotLocal Not the authority; the request was forwarded.

VtChatFailureReason

Why a chat send refused.

Value Description
None The message was sent.
EmptyText Nothing left after trimming and stripping markup.
TooLong Longer than VtTuning.chatMaxLength.
RateLimited Sent faster than the chat limit allows.
Muted The sender is muted.
Filtered The filter rejected the text.
NoRecipient The whisper target is not online, or is the sender.
NotInParty Party chat without a party.
NotInGuild Guild chat without a guild.
ChannelNotAllowed Players cannot send on System or Npc.
AuthorityNotLocal Not the authority; the message was forwarded.

VtGuildFailureReason

Why a guild call refused.

Value Description
None The call succeeded.
NoIdentity The player has no player identity.
AlreadyInGuild The player already belongs to a guild.
NotInGuild The player belongs to no guild.
NameInvalid The name is too short, too long, or has characters other than letters, digits and single spaces.
NameTaken Another guild has this name.
TagInvalid The tag is not 2 to 5 letters or digits.
CannotAfford The founder cannot pay the creation cost.
NoPermission The player’s rank lacks the permission.
TargetNotFound No online player by that name or id.
TargetInGuild The invited player already belongs to a guild.
TargetNotMember The player acted on is not a member of this guild.
GuildFull The guild has VtTuning.guildMaxMembers members.
NoInvite No invite is pending, or it expired.
RankTooLow The target’s rank is not below the acting member’s.
LeaderCannotLeave The leader must hand over leadership before leaving a guild with other members.
AuthorityNotLocal Not the authority; the request was forwarded.

VtFriendsFailureReason

Why a friends call refused.

Value Description
None The call succeeded.
NoIdentity The player has no player identity.
PlayerNotFound No known player by that name or id.
CannotBefriendSelf A player cannot befriend itself.
AlreadyFriends Already friends.
RequestPending A request to that player is already waiting.
FriendListFull The player has VtTuning.friendsMaxCount friends.
TargetFull The other player’s friend list or request inbox is full.
NoRequest No such pending request.
NotFriends The players are not friends.
AuthorityNotLocal Not the authority; the request was forwarded.

VtMailFailureReason

Why a mail call refused.

Value Description
None The call succeeded.
NoIdentity The player has no player identity.
RecipientNotFound No known player by that name or id.
CannotMailSelf A player cannot mail itself.
RecipientMailboxFull The recipient has VtTuning.mailboxMaxCount mails.
SubjectEmpty The subject is empty after cleaning.
TooLong The subject or body is longer than allowed.
TooManyAttachments More attachment lines than VtTuning.mailMaxAttachments.
UnknownDefinition An attached item or currency id is not in the Definition Catalog.
NoInventory The sender has no inventory for item attachments.
MissingItems The sender holds fewer items than attached.
ItemNotTradeable An attached item cannot be traded.
NoWallet The sender has no wallet for currency or postage.
CannotAfford The sender cannot pay the attached currency plus postage.
MailNotFound No mail with that id in the mailbox.
AttachmentsRemaining Take the attachments before deleting.
InventoryFull Some attached items did not fit; the rest stay attached.
NotReturnable System mail and returned mail cannot be returned.
AuthorityNotLocal Not the authority; the request was forwarded.

VtUnlockFailureReason

Why VtUnitUnlocks.TryUnlock was refused.

Value Description
None Nothing went wrong.
UnlockNull No unlock was given.
AlreadyUnlocked It is already owned.
MissingPrerequisite One of its required unlocks is not owned yet.
LevelTooLow The unit’s level is below the unlock’s required level.
MissingItems The cost source lacks the items.
MissingCurrency The cost source lacks the currency.
AuthorityNotLocal This process is not the authority; the request was forwarded.

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.