Difference between revisions of "WebAPI/GetSchema"

From Team Fortress Wiki
Jump to: navigation, search
m (Result Data: Updating rarity qualities and listing qualities in order. Also, Medic weapon qualities have been fixed.)
m (Result Data: I didn't get the Headtaker's name right)
Line 41: Line 41:
 
:; '''vintage''' (''3''): In GetPlayerItems, vintage items (items the player had before the [[Polycount Update]]) have this as their quality.
 
:; '''vintage''' (''3''): In GetPlayerItems, vintage items (items the player had before the [[Polycount Update]]) have this as their quality.
 
:; '''rarity3''' (''4''): In the list of items returned by GetSchema, no items have this listed as their quality.
 
:; '''rarity3''' (''4''): In the list of items returned by GetSchema, no items have this listed as their quality.
:; '''rarity4''' (''5''): In GetPlayerItems, [[Rarity#Unusual|unusual]] items (items with an unusual particle effect attached) have this as their quality, for example [[The Horseless Headless Horseman's Headtaker]].
+
:; '''rarity4''' (''5''): In GetPlayerItems, [[Rarity#Unusual|unusual]] items (items with an unusual particle effect attached) have this as their quality, for example The [[Horseless Headless Horsemann's Headtaker]].
 
:; '''unique''' (''6''): In GetPlayerItems, all normally-obtained (not manually awarded by Valve) unlockable items have this as their quality. In the list of items returned by GetSchema, all findable items have this listed as their quality.
 
:; '''unique''' (''6''): In GetPlayerItems, all normally-obtained (not manually awarded by Valve) unlockable items have this as their quality. In the list of items returned by GetSchema, all findable items have this listed as their quality.
 
:; '''community''' (''7''): In GetPlayerItems, Community items (a special kind of item, normally with special particle effects and description line, given to valuable community contributors) have this quality. In the list of items returned by GetSchema, no items have this as listed their quality.
 
:; '''community''' (''7''): In GetPlayerItems, Community items (a special kind of item, normally with special particle effects and description line, given to valuable community contributors) have this quality. In the list of items returned by GetSchema, no items have this as listed their quality.

Revision as of 18:51, 8 March 2011

This method returns the item schema for the current build of Team Fortress 2.

This documentation is for version v0001 of GetSchema.

URL

http://api.steampowered.com/ITFItems_440/GetSchema/v0001/

Method-specific Parameters

language
The ISO639-1 language code for the language all localized strings should be returned in. Not all strings have been translated to every language. If a language does not have a string, the English string will be returned instead. If this parameter is omitted the string token will be returned for the strings.

Supported languages for TF2 are:

  • Danish (da)
  • Dutch (nl)
  • English (en)
  • Finnish (fi)
  • French (fr)
  • German (de)
  • Italian (it)
  • Japanese (ja)
  • Korean (ko)
  • Norwegian (no)
  • Polish (pl)
  • Portuguese (pt)
  • Russian (ru)
  • Simplified Chinese (zh - hides Traditional Chinese)
  • Spanish (es)
  • Swedish (sv)
  • Traditional Chinese (Cannot be specified by ISO639-1)

Status codes

  • 1: The normal code. Should always be returned.

Result Data

qualities
An object containing the numeric values corresponding to each "quality" an item can have:
normal (0)
In the list of items returned by GetSchema, all of the standard inherent basic class weapons have this listed as their quality.
rarity1 (1)
In GetPlayerItems, promotional items that have been obtained from the original source will have this listed as their quality (for example, Sun-On-A-Stick and Sharpened Volcano Fragment). In the list of items returned by GetSchema, no items have this listed as their quality.
rarity2 (2)
In the list of items returned by GetSchema, no items have this listed as their quality.
vintage (3)
In GetPlayerItems, vintage items (items the player had before the Polycount Update) have this as their quality.
rarity3 (4)
In the list of items returned by GetSchema, no items have this listed as their quality.
rarity4 (5)
In GetPlayerItems, unusual items (items with an unusual particle effect attached) have this as their quality, for example The Horseless Headless Horsemann's Headtaker.
unique (6)
In GetPlayerItems, all normally-obtained (not manually awarded by Valve) unlockable items have this as their quality. In the list of items returned by GetSchema, all findable items have this listed as their quality.
community (7)
In GetPlayerItems, Community items (a special kind of item, normally with special particle effects and description line, given to valuable community contributors) have this quality. In the list of items returned by GetSchema, no items have this as listed their quality.
developer (8)
In GetPlayerItems, Valve items (a special kind of item with special properties belonging only to Valve employees) have this as their quality. In the list of items returned by GetSchema, no items have this as listed their quality.
selfmade (9)
In GetPlayerItems, self-made items (items whose model was made by the player possessing the item, or Telltale Games employees in the case of the Sam & Max items, normally with a special particle effect and description line) have this as their quality. In the list of items returned by GetSchema, no items have this as listed their quality.
customized (10)
No items have this listed as their quality.
qualityNames
If the language argument is specified this object is included in the output. It includes the translations of the internal quality names to the specified language.
items
An object containing an array of
item
name
A string that defines the item in the items_game.txt
defindex
The item's unique index, used to refer to instances of the item in GetPlayerItems.
item_class
The item's class in game (ie. what you would use as the argument to "equip" in the console to equip it).
item_type_name
The tokenized string that describes the item's class (eg. "#TF_Wearable_Shield" for the Chargin' Targe and the Razorback). If the language argument is specified the string for that language will be returned instead of the token.
item_name
The tokenized string for the item's name (eg. "#TF_Spy_Camera_Beard" for the Camera Beard). If the language argument is specified the string for that language will be returned instead of the token.
item_description (Optional)
The tokenized string for the item's description if it has one. If a language is specified this will be the localized description string.
proper_name
A boolean value that indicates the presence of an language-appropriate prefix such as "The" or "A".
item_slot
A string describing what loadout slot the item corresponds to.
primary
Primary slot items (including "Slot Token - Primary")
secondary
Secondary slot items (including "Slot Token - Secondary")
melee
Melee slot items (including "Slot Token - Melee")
head
Hats and "Slot Token - Head"
misc
Misc slot items such as medals
pda
The Engineer's Build PDA, the Spy's Disguise Kit, and "Slot Token - PDA"
pda2
The Engineer's Destroy PDA, the Spy's Invisibility Watch, the Cloak and Dagger, the Dead Ringer, and "Slot Token - PDA2"
Engineer
Metal and class tokens (yes, all class tokens)
building
"TF_WEAPON_BUILDER" (an unused copy of the Engineer's Build PDA) and the unused "Slot Token - Building"
grenade
The unused "Slot Token - Grenade"
action
Gifts and the Duel minigame
item_quality
The item's normal quality value. See description of "qualities" above.
image_inventory
The image to display, as an escaped-slash ("\/") path to the material, without the extension
image_url
The URL of the small (128x128) backpack icon for this kind of item. Will be an empty string if none is available.
image_url_large
The URL of the large (512x512) backpack image for this kind of item. Will be an empty string if none is available.
model_player
The model to display for the item, using a path similar to the above but with an ".mdf" extension, or null if the object has no model.
min_ilevel
The minimum level of the item in the schema. See notes
max_ilevel
The maximum level of the item in the schema. See notes
craft_class (Optional)
The type of the item from the crafting system's point of view. If this field is not present the item cannot be crafted by the random crafting recipes. This will be weapon, hat, craft_bar, or craft_token.
used_by_classes (Optional)
The list of classes that can use this item. If this field is not present all classes can use the item.
attributes (Optional)
If the item has effects normally associated with it, an object containing an array of
attribute
name
The attribute's name value (see below)
class
The attribute's attribute_class value (see below)
value
The "value" of that attribute as a "%0.6f" formatted number: 1 (or 0) for boolean attributes (such as the Razorback's backstab blocking), or the multiplier for percentage-based attributes (such as 0.300000 for the Direct Hit's 30% blast radius, or 1.800000 for its 180% projectile speed)
attributes
An object containing an array of
attribute
name
A name describing the attribute (eg. "damage bonus" for damage increases found on weapons such as the Scotsman's Skullcutter, or "scattergun has knockback" for the Force-A-Nature's knockback)
defindex
The attribute's unique index, possibly used to refer to unique instances of the item with these attributes in GetPlayerItems.
attribute_class
an underscore-based name for the attribute (eg. "mult_dmg" for the attribute whose name is "damage bonus")
minvalue
The minimum value allowed for this attribute. See notes
maxvalue
The maximum value allowed for this attribute. See notes
description_string (Optional)
The tokenized string that describes the attribute. See notes
description_format (Optional)
A string describing how to format the value for a description. See notes
value_is_percentage
For values that translate into percentages and are represented by that percentage (eg. changes to the blast radius)
value_is_inverted_percentage
For values that translate into percentages and are represented by the difference in that percentage from 100% (eg. changes to the fire rate)
value_is_additive
For values that are a specific number (eg. max health bonuses and bleed durations) and boolean attributes (such as The Sandman's ability to knock out balls)
value_is_additive_percentage
For values that add to an existing percentage (e.g. The Ubersaw adding 25% charge every hit)
value_is_date
For values that are a unix timestamp
value_is_particle_index
For values that are a particle effect type. See notes
value_is_account_id
For values that are a Steam account ID. See notes
value_is_or
Possibly for values that get applied if a condition is true (e.g. player is on fire)
value_is_item_def
For values that are an item ID (a defindex value in the schema)
effect_type
A string describing the type of effect the attribute has.
positive
The effect is outright beneficial to the user (displayed in blue text in the item description window)
negative
The effect is punitive to the user (red text)
neutral
The effect is more tangential to the normal behavior (eg. the Kritzkrieg's ÜberCharge being critical hits rather than invulnerability) (white text).
hidden
A boolean that indicates if the attribute's description should be hidden from user view.

Notes

Normal Weapons

The first 32 items listed describe the original class weapons, with an extraneous "TF_WEAPON_BUILDER" at defindex 28, which has the icon of the Engineer's Destroy PDA but the model of the Build PDA, and a "TF_WEAPON_FLAREGUN" at defindex 31, which uses "#TF_Weapon_Flaregun" for both item_name and item_type_name (where the normal "Unique Achievement Flaregun" uses "#TF_Unique_Achievement_Flaregun" for the item_name) and the pistol for the model. Every weapon in the first 32's name is its item_class in all caps.

Both Engineer PDAs and the Spy PDA use "#TF_Weapon_PDA_Engineer" for both their item_type_name and their item_name.

Attribute Min and Max Values

Values found on items are not guaranteed to fall within this range: for instance, "attach particle effect" lists "0.000000" as both its minvalue and maxvalue, but non-zero values are used to specify what particle effect to attach.

Particle Index Type

This type was introduced with the Polycount Update. It is to be used as an index to retrieve the particle effect name/description string.

Account ID Type

There are two formats of IDs that can be extracted from this.

Steam Community ID
Add 1197960265728 to this value and prefix the string representation of the result with "7656" for a 64 bit Steam Community ID
STEAM_0 ID
Divide this value by 2 for a STEAM_0 ID value

Image Permissions

You are welcome to use the backpack images provided by image_url and image_url_large directly or to copy the files to your own server.

Level Ranges

If min_ilevel and max_ilevel are the same if the item does not have a random level.

Attribute Descriptions

If the attribute is unused or there is no applicable description_string and description_format will be unset. If there is a language specified this will be the localized description string instead of the token.

In the localized description string there are "%s1" tokens, these are to be replaced with the appropriately formatted value generated with the format type and attribute values.