Skip to content

Adding Pocket items

AgentCucco edited this page Jan 27, 2021 · 4 revisions

Function syntax.

Encyclopedia.AddPocketItem(itemTab, etype)
  • ItemTab: 'table'. A table containing the main arguments for the item.
  • etype: 'string'. The type of the table. (Ex. "cards", "runes", "pills", "syringes")

List of arguments in ItemTab:

  • Class: 'string'. The class for your pocket item, usually referenced as your mod's name. (optional)
    • Note: On smaller mods, it's recommended to not add this argument, so the item gets added to "general mods" instead of occupying a new category in the menu.
  • ID: 'number'. Your pocket item's id.
  • WikiDesc: 'table'. Your wiki table for the pocket item. (optional)
  • Name: 'string'. The name of your pocket item, used in case the name in the xml causes an [ERROR] tag to display in-game. (optional)
  • Desc: 'string'. The description of your pocket item, used in case the description in the xml causes an [ERROR] tag to display in-game. (optional)
  • ModName: 'string'. The name of the mod attached to the pocket item. (optional)
    • Mod names are already autogenerated, this argument is only used to tweak the names to others.
  • Sprite: 'sprite'. The custom sprite you want to display. (optional)
    • Note that item sprites are autogenerated by the encyclopedia, only use this argument if you want to overwrite the original.
  • Hide: 'boolean': Used in case you want to hide your pocket item from the menu. (optional)
    • Pocket item will still show up in the Status screen, the tag is primarily used for secret pocket items.
  • UnlockFunc: 'function': Used to display a locked version of the item and a custom name/description. (optional)
    • Used for mods that add unlockable items, like Revelations.
    • Passes (self) as an argument.
    • Note: You need to return a table in this function, if the item is locked.
      • self is a copy of the original table, so you can change it without compromising the original entry.
      • It is recommended to change the description to the unlock condition, for clarity. Name can be changed as well. (Both default to "???")
  • StatusFunc: 'function': Used to display a custom tooltip and change wiki entries on the fly, only during the status menu. (optional)
    • Passes (self) as an argument.
    • Runs when the status menu is opened, or the search box is used.
    • Note: You need to return a table in this function.
      • self is a copy of the original table, so you can change it without compromising the original entry.
  • StatusClose: 'function': Used to revert pocket items back to default when the menu is closed. (optional)
    • Passes (self) as an argument.
    • Runs when the status menu is closed.

How to add specific pocket items.

Clone this wiki locally