Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
(Created page with "thumb|220x220px The '''Bag''' is the player's portable inventory, in which items are stored. It is accessible from the pause menu. == The Bag == T...")
Tag: Visual edit
 
Maruno (talk | contribs)
No edit summary
Line 1: Line 1:
[[File:Bag (1).png|thumb|220x220px]]
+
[[Image:Bag.png|right|256px|thumb|The Bag, filled with items.]]
 
The '''Bag''' is the [[player]]'s portable inventory, in which [[items]] are stored. It is accessible from the [[pause menu]].
 
The '''Bag''' is the player's portable inventory, in which items are stored. It is accessible from the pause menu.
 
   
 
== The Bag ==
 
== The Bag ==
  +
The Bag is accessible via the variable <code>$PokemonBag</code>, which is an instance of <code>class PokemonBag</code> (created with the code <code>$PokemonBag=PokemonBag.new</code>). It contains arrays representing the Bag's pockets, as well as a variable that remembers which item is registered for quick use, and some navigation-based variables.
+
The Bag is accessible via the variable <code>$PokemonBag</code>, which is an instance of <code>class PokemonBag</code> (created with the code <code>$PokemonBag=PokemonBag.new</code>). It contains arrays representing the Bag's pockets, as well as a variable that remembers which items are registered for quick use in the [[Ready menu]], and some navigation-based variables.
   
 
There are several settings related to the Bag. These are:
 
There are several settings related to the Bag. These are:
  +
 
#===============================================================================
 
# * The names of each pocket of the Bag. Leave the first entry blank.
 
# * The maximum number of slots per pocket (-1 means infinite number). Ignore
 
# the first number (0).
 
# * The maximum number of items each slot in the Bag can hold.
 
# * Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
 
# first entry (the 0).
 
#===============================================================================
 
#===============================================================================
<nowiki>#</nowiki> * The names of each pocket of the Bag. Leave the first entry blank.
 
<nowiki>#</nowiki> * The maximum number of slots per pocket (-1 means infinite number). Ignore
 
<nowiki>#</nowiki> the first number (0).
 
<nowiki>#</nowiki> * The maximum number of items each slot in the Bag can hold.
 
<nowiki>#</nowiki> * Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
 
<nowiki>#</nowiki> first entry (the 0).
 
<nowiki>#</nowiki> * The pocket number containing all berries. Is opened when choosing one to
 
<nowiki>#</nowiki> plant, and cannot view a different pocket while doing so.
 
<nowiki>#</nowiki>===============================================================================
 
 
def pbPocketNames; return ["",
 
def pbPocketNames; return ["",
<nowiki> </nowiki> _INTL("Items"),
+
_INTL("Items"),
<nowiki> </nowiki> _INTL("Medicine"),
+
_INTL("Medicine"),
<nowiki> </nowiki> _INTL("Poké Balls"),
+
_INTL("Poké Balls"),
<nowiki> </nowiki> _INTL("TMs & HMs"),
+
_INTL("TMs & HMs"),
<nowiki> </nowiki> _INTL("Berries"),
+
_INTL("Berries"),
<nowiki> </nowiki> _INTL("Mail"),
+
_INTL("Mail"),
<nowiki> </nowiki> _INTL("Battle Items"),
+
_INTL("Battle Items"),
<nowiki> </nowiki> _INTL("Key Items")
+
_INTL("Key Items")
 
]; end
 
]; end
 
MAXPOCKETSIZE = [0,-1,-1,-1,-1,-1,-1,-1,-1]
 
MAXPOCKETSIZE = [0,-1,-1,-1,-1,-1,-1,-1,-1]
BAGMAXPERSLOT = 99
+
BAGMAXPERSLOT = 999
 
POCKETAUTOSORT = [0,false,false,false,true,true,false,false,false]
 
POCKETAUTOSORT = [0,false,false,false,true,true,false,false,false]
BERRYPOCKET = 5
 
   
 
== What you can do with an item ==
 
== What you can do with an item ==
  +
 
The things you can do with an item depend on what item it is.
 
The things you can do with an item depend on what item it is.
  +
{|
 
  +
{| class="article-table" border="1"
!Action
+
! Action
!When it is available
+
! When it is available
 
|-
 
|-
|Use
+
| Use
 
|
 
|
 
* If the item can be used from the Bag (i.e. it has a UseFromBag or UseOnPokemon item handler).
 
* If the item can be used from the Bag (i.e. it has a UseFromBag or UseOnPokemon item handler).
 
* If the item is a TM or a HM, and the player has at least 1 Pokémon.
 
* If the item is a TM or a HM, and the player has at least 1 Pokémon.
 
|-
 
|-
|Read
+
| Read
 
|
 
|
 
* If the item is a Mail item.
 
* If the item is a Mail item.
 
|-
 
|-
|Give
+
| Give
 
|
 
|
 
* If the player has at least 1 Pokémon, and the item is ''not'' a Key Item or a HM (or infinite TM).
 
* If the player has at least 1 Pokémon, and the item is ''not'' a Key Item or a HM (or infinite TM).
 
|-
 
|-
|Toss
+
| Toss
 
|
 
|
 
* If the item is not a Key Item, a HM or an infinite use TM.
 
* If the item is not a Key Item, a HM or an infinite use TM.
* Always appears during Debug mode.
+
* Always appears during [[Debug mode]].
 
|-
 
|-
|Register/Deselect
+
| Register/Deselect
 
|
 
|
 
* If the item can be registered (see below) and currently isn't, or if the item is currently registered, respectively.
 
* If the item can be registered (see below) and currently isn't, or if the item is currently registered, respectively.
 
|-
 
|-
|Make Mystery Gift
+
| Make Mystery Gift
 
|
 
|
* Debug mode only. Creates a new Mystery Gift containing a definable quantity of the item.
+
* [[Debug mode]] only. Creates a new [[Mystery Gift]] containing a definable quantity of the item.
 
|}
 
|}
The player can also swap the positions of two items in a pocket by selecting one of the items with the Z key and then the other with the C key. While an item is selected for moving, it will be shown in red.
+
The player can also rearrange items in a pocket by selecting one and pressing the [[Controls|Z key]]. The item name turns red and the cursor changes, and it can then be moved around with the [[Controls|up/down keys]]. Pressing the [[Controls|Z key]] again returns the cursor to normal and leaves the item in its new position, while pressing the [[Controls|X key]] cancels the move.
   
 
A pocket which has been set to auto-sort itself will not let the player manually rearrange its contents.
 
A pocket which has been set to auto-sort itself will not let the player manually rearrange its contents.
   
 
== Registering an item ==
 
== Registering an item ==
Registering an item allows it to be quickly used in the overworld by pressing the F5 key, without needing to open the Bag. Only one item can be registered at a time.
 
   
  +
Registering an item makes it show up in the [[Ready menu]], accessible from the overworld by pressing the [[Controls|F key]]. There is no limit to how many items can be registered at once. An item remains registered even if the player consumes it; if the player gains more of that item later, it will automatically reappear in the [[Ready menu]]. Unregistering an item can only be done in the Bag.
Only Key Items can be registered, and only if that item has a UseInField item handler (i.e. tickets and other plot coupons cannot be registered).
 
   
  +
Any item with a UseInField item handler can be registered. This includes several Key Items such as the Bicycle and Super Rod, and also includes consumable items like Honey, Repel and Escape Rope.
The ID of the registered item is stored in the variable <code>$PokemonBag.registeredItem</code> (it equals 0 if there is no registered item).
 
  +
  +
The list of currently registered items is stored in the array <code>$PokemonBag.registeredItems</code>. This is not an inventory in and of itself; remember that an item can be registered even while the player doesn't have it.
   
 
== Displaying items ==
 
== Displaying items ==
  +
Key Items and HMs (and infinite TMs) don't have their quantities shown, because it is assumed that the player will only ever own one of each of these items. Despite this, they still have quantities just like any other item. Their quantities should have no bearing on the game, as checking for the presence of one of these items will only care whether there are more than 0 of them in the Bag. Even so, for the sake of neatness and logic, you should try to make sure the player is never given multiples of the same Key Item/HM.
+
Key Items and HMs (and infinite TMs) don't have their quantities shown, because it is assumed that the player will only ever own one of each of these items. Despite this, they still have quantities just like any other item. Their quantities should have no bearing on the game, as checking for the presence of one of these items (with <code>$PokemonBag.pbHasItem?(:BICYCLE)</code>) will only care whether there are more than 0 of them in the Bag. Even so, for the sake of neatness and logic, you should try to make sure the player is never given multiples of the same Key Item/HM/infinite TM.
   
 
== Tips ==
 
== Tips ==
  +
 
* The Items pocket notoriously contains a lot of items compared to the other pockets, with potentially over 200 different items that go in it. Why not split this pocket's items up into others?
 
* The Items pocket notoriously contains a lot of items compared to the other pockets, with potentially over 200 different items that go in it. Why not split this pocket's items up into others?
** The most obvious solution is to move all the held items into their own pocket.
+
** The most obvious solution is to move all the held items into their own pocket. If you want to keep the same number of pockets overall, then the Held Items pocket could replace the Mail pocket. The mail items would be moved into the Items pocket (if indeed you have mail in your game).
*** If you want to keep the same number of pockets overall, then the Held Items pocket could replace the Mail pocket. The mail items would be moved into the Items pocket (if indeed you have mail in your game).
 

Revision as of 21:56, 22 November 2018

Bag

The Bag, filled with items.

The Bag is the player's portable inventory, in which items are stored. It is accessible from the pause menu.

The Bag

The Bag is accessible via the variable $PokemonBag, which is an instance of class PokemonBag (created with the code $PokemonBag=PokemonBag.new). It contains arrays representing the Bag's pockets, as well as a variable that remembers which items are registered for quick use in the Ready menu, and some navigation-based variables.

There are several settings related to the Bag. These are:

#===============================================================================
# * The names of each pocket of the Bag. Leave the first entry blank.
# * The maximum number of slots per pocket (-1 means infinite number). Ignore
#      the first number (0).
# * The maximum number of items each slot in the Bag can hold.
# * Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
#      first entry (the 0).
#===============================================================================
def pbPocketNames; return ["",
   _INTL("Items"),
   _INTL("Medicine"),
   _INTL("Poké Balls"),
   _INTL("TMs & HMs"),
   _INTL("Berries"),
   _INTL("Mail"),
   _INTL("Battle Items"),
   _INTL("Key Items")
]; end
MAXPOCKETSIZE  = [0,-1,-1,-1,-1,-1,-1,-1,-1]
BAGMAXPERSLOT  = 999
POCKETAUTOSORT = [0,false,false,false,true,true,false,false,false]

What you can do with an item

The things you can do with an item depend on what item it is.

Action When it is available
Use
  • If the item can be used from the Bag (i.e. it has a UseFromBag or UseOnPokemon item handler).
  • If the item is a TM or a HM, and the player has at least 1 Pokémon.
Read
  • If the item is a Mail item.
Give
  • If the player has at least 1 Pokémon, and the item is not a Key Item or a HM (or infinite TM).
Toss
  • If the item is not a Key Item, a HM or an infinite use TM.
  • Always appears during Debug mode.
Register/Deselect
  • If the item can be registered (see below) and currently isn't, or if the item is currently registered, respectively.
Make Mystery Gift

The player can also rearrange items in a pocket by selecting one and pressing the Z key. The item name turns red and the cursor changes, and it can then be moved around with the up/down keys. Pressing the Z key again returns the cursor to normal and leaves the item in its new position, while pressing the X key cancels the move.

A pocket which has been set to auto-sort itself will not let the player manually rearrange its contents.

Registering an item

Registering an item makes it show up in the Ready menu, accessible from the overworld by pressing the F key. There is no limit to how many items can be registered at once. An item remains registered even if the player consumes it; if the player gains more of that item later, it will automatically reappear in the Ready menu. Unregistering an item can only be done in the Bag.

Any item with a UseInField item handler can be registered. This includes several Key Items such as the Bicycle and Super Rod, and also includes consumable items like Honey, Repel and Escape Rope.

The list of currently registered items is stored in the array $PokemonBag.registeredItems. This is not an inventory in and of itself; remember that an item can be registered even while the player doesn't have it.

Displaying items

Key Items and HMs (and infinite TMs) don't have their quantities shown, because it is assumed that the player will only ever own one of each of these items. Despite this, they still have quantities just like any other item. Their quantities should have no bearing on the game, as checking for the presence of one of these items (with $PokemonBag.pbHasItem?(:BICYCLE)) will only care whether there are more than 0 of them in the Bag. Even so, for the sake of neatness and logic, you should try to make sure the player is never given multiples of the same Key Item/HM/infinite TM.

Tips

  • The Items pocket notoriously contains a lot of items compared to the other pockets, with potentially over 200 different items that go in it. Why not split this pocket's items up into others?
    • The most obvious solution is to move all the held items into their own pocket. If you want to keep the same number of pockets overall, then the Held Items pocket could replace the Mail pocket. The mail items would be moved into the Items pocket (if indeed you have mail in your game).