- For the main page about items, see Items.
- For a description of how item effects work, see Item effects.
- For adding, removing, counting and choosing items in the Bag, see Manipulating items.
This page describes how to define an item.
Defining an item[]
An item begins with its definition. This means that is is listed in the PBS file "items.txt", or a PBS file named "items_XYZ.txt" (where "XYZ" is any text), so that it can be recognised by the game as an item. This alone does not give the item an effect, but you must start by defining it before you can use it.
This page only describes how to define an item. See the page Item effects to find out how to add effects to defined items.
PBS file "items.txt"[]
The PBS file "items.txt" lists all the defined items in the game. Each section in this file is one separate item, where a section begins with a line containing an ID in square brackets and ends when the next section begins. Each line in a section is one separate piece of information about that item.
Aside from the ID line, every line in a section follows the format:
XXX = YYY
where XXX is a property and YYY is the value or values associated with it (the spaces are optional). For example:
[STARDUST] Name = Stardust NamePlural = Stardusts PortionName = bag of Stardust PortionNamePlural = bags of Stardust Pocket = 1 Price = 3000 Flags = Fling_30 Description = Lovely, red-colored sand with a loose, silky feel. It can be sold at a high price to shops. #------------------------------- [POTION] Name = Potion NamePlural = Potions Pocket = 2 Price = 200 FieldUse = OnPokemon BattleUse = OnPokemon Flags = Fling_30 Description = A spray-type medicine for treating wounds. It can be used to restore 20 HP to a single Pokémon. #------------------------------- [TM42] Name = TM42 NamePlural = TM42s Pocket = 4 Price = 3000 BPPrice = 32 FieldUse = TR Flags = Fling_70 Move = FACADE Description = This attack move doubles its power if the user is poisoned, burned, or paralyzed. #------------------------------- [TOWNMAP] Name = Town Map NamePlural = Town Maps Pocket = 8 Price = 0 FieldUse = Direct Flags = KeyItem Description = A very convenient map that can be viewed anytime. It even shows your present location.
All pieces of information are optional, but will have default values if they are not defined. The order of the lines does not matter, except for the ID line in square brackets which must be first.
Property | Description | Default value |
---|---|---|
[ID] | This is how the scripts refer to the item. Each item must have a different ID. Typically this is the same as the item name, but written in all capital letters and with no spaces or special characters. In the scripts, the ID is used as a symbol (i.e. with a colon in front of it, such as :POTION ). The ID is never seen by the player.
This line must come first in a section, because, as mentioned above, this line defines when a new section begins. In Bag pockets that auto-sort themselves, items will be sorted in the same order that they are defined in the PBS file "items.txt". |
n/a |
Name | The name of the item, as seen by the player. | "Unnamed" |
NamePlural | The plural form of the name of the item, as seen by the player. For example, "Potions". | "Unnamed" |
PortionName | The name of a portion of the item, used in most messages. For example, used to say that the player has found "1 bag of Stardust" rather than simply "1 Stardust". | none |
PortionNamePlural | The plural form of the portion name of the item. For example, "bags of Stardust". | none |
The Bag pocket number the item is stored in. By default, this is one of:
The list of Bag pockets is in the script section Settings, in |
1 | |
Price | The cost of the item when the player buys it from a Poké Mart. Note that when the player sells the item to a Poké Mart, it is sold for half this price (by default; see SellPrice). If an item has a price of 0, the player cannot sell it. | 0 |
SellPrice | The amount of money gained when selling the item to a Poké Mart. | Half of Price |
BPPrice | The cost of the item in Battle Points (BP). Note that the player cannot sell items for BP, so there is no corresponding sell price property. | 1 |
FieldUse | How the item can be used outside of battle. Is one of the following:
|
none |
BattleUse | How the item can be used in battle. Is one of the following:
|
none |
Flags | Comma-separated labels applied to the item which can be used to make it behave differently. The existing flags are:
|
none |
Consumable | Whether the item will be consumed after being used from the Bag. Is true or false . Usually only used to make a non-Key Item infinite use (e.g. Black/White Flutes).
|
false if a Key Item, TM or HM, and true otherwise
|
ShowQuantity | Whether the item will show its quantity in the Bag. Only used to show the quantity of a Key Item, TM or HM. Setting it to false for a different item will not hide its quantity.
|
false if a Key Item, TM or HM, and true otherwise
|
Move | The ID of the move that this item teaches. For HMs, TMs and TRs only.
A Pokémon is compatible with a HM/TM/TR only if the move it teaches is listed a a Tutor Move for its species in the PBS file "pokemon.txt" (or in "pokemon_forms.txt" if appropriate), or if that move is in its level-up moveset or egg moves. See the page Learning moves for more information. |
none |
Description | The item's description. Typically, HMs, TMs and TRs will have the same description as the moves they teach, but they don't need to. | "???" |
Item icons[]
Each item has a single icon, which is located in the folder "Graphics/Items" and called "XXX.png", where "XXX" is the ID of that item.
If the icon for a machine item (a HM/TM/TR) does not exist, then it will instead try to use other icon(s):
- TM - Tries the icon named "machine_XXX.png", where "XXX" is the ID of the type of the move it teaches, e.g. "machine_FLYING.png".
- TR - Tries the icon named "machine_tr_XXX.png", where "XXX" is the ID of the type of the move it teaches, e.g. "machine_tr_FLYING.png". If this isn't found, it tries the icon that a TM would use, e.g. "machine_FLYING.png".
- HM - Tries the icon named "machine_hm_XXX.png", where "XXX" is the ID of the type of the move it teaches, e.g. "machine_hm_FLYING.png". If this isn't found, it tries the icon that a TM would use, e.g. "machine_FLYING.png".
The item icon can be any size, although 48x48 pixels is traditional.
An item's icon can be animated. For it to be animated, its graphic should contain a number of frames in a row, and each frame must be exactly 48x48 pixels in size. No matter how many frames there are in the graphic, one complete cycle will last 1 second, so having more frames means less time is spent showing each individual frame. Both of these values (48 pixels and time per cycle) are defined as constants in class ItemIconSprite
and are easily changeable; note that they apply to all item icons.
Items can also have unique small icons for display in the party screen when they are held by a Pokémon. These are located in the folder "Graphics/UI/Party" and called "icon_item_XXX.png" (for non-mail items) or "icon_mail_XXX.png" (for mail items), where "XXX" is the ID of that item. If there isn't a unique icon for an item, it will use the default "icon_item.png" or "icon_mail.png" instead.
Mail[]
In addition to the above, each Mail item also needs its own background picture. This picture is located in the folder "Graphics/UI/Mail" and called "mail_XXX.png", where "XXX" is the ID of that item.
Mail background pictures should be the size of the game screen.