Lore archive · Warcraft Wiki, 2023 dump
API GetContainerNumSlots
Last wiki revision 2022-07-21
Returns the total number of slots in the bag specified by the index. numberOfSlots = GetContainerNumSlots(bagID)
- bagID: - the slot containing the bag, e.g. 0 for backpack, etc.
- numberOfSlots: - the number of slots in the specified bag, or 0 if there is no bag in the given slot.
- In 2.0.3, the Key Ring(-2) always returns 32. The size of the bag displayed is determined by the amount of space used in the keyring.
- As of 3.0.3, immediately after a PLAYER_ENTERING_WORLD event (initial login or zone change through an instance, ie. any time you see a loading screen), several events of BAG_UPDATE are fired, one for each bag slot you have purchased. All bag data is available during the PLAYER_ENTERING_WORLD event, but this function returns 0 for bags that have not had the BAG_UPDATE function called. This is most likely due to the UI resetting its internal cache sometime between the PLAYER_ENTERING_WORLD event and the first BAG_UPDATE event.
Source
https://warcraft.wiki.gg/wiki/API_GetContainerNumSlots · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.