ItemsBundlesModule - Mini-IT/SnipeWiki GitHub Wiki
The items module provides access to ingame items and their various groupings. The item is a container for item attributes. You can define item attribute types in the editor and then add/edit item attributes of the items. The items can have a type, a slot (can be used for wearable items) and a group (can be used for grouping the items in ingame shop). You can also bundle items into item bundles. These bundles can be assigned to other items so, for example, putting the bundle item into the inventory will convert the item into the items in a bundle.
Shop and inventory modules are based on the items module.
Through the editor you can create and edit the item types, item groups, item slots, item attribute types, the items themselves and item bundles. The main editor page has a menu for these in the center block. Item groups are in the next block that edits the shop since they are primarily used in the shop. Most of these are straightforward, there's no need to describe every page. There are a couple things worth mentioning.
The first one concerns the item image. You can upload a file for it using the upload form on the edit item page. The uploaded file will be put into the "client/items/" directory of the editor (it needs to be created and have proper permissions set) and named "<item ID>.<extension>".
The second one allows displaying the item attributes as strings on the edit item page and editing them with the use of dropdown lists. For example, if you have an item attribute that contains an effect ID, you can have the item attribute on a page showing the effect name string instead of the default ID number. If you click on the edit attribute link, you will see a form with the dropdown list of effects instead of a default text field with effect ID. This is done through editor subscriptions and described in detail at the Editor Subscriptions page.
The third one is that changing or creating any items, items slots, etc will trigger a reload on the game servers. It is not advisable to delete the items on a running server since this will break all containers that point to it.
- "core/item.imageExtension" - Image extension for the uploaded images. Default: png.
- "core/item.imageWidth" - Image width for uploaded image display in the item page. Default: 100.
- "core/item.imageHeight" - Image height for uploaded image display in the item page. Default: 100.
- "core/item.showListImage" - (0/1) If enabled, displays uploaded item image in the item list.
- "core/item.listImageWidth" - Image width for uploaded image display in the item list. Default: 100.
- "core/item.listImageHeight" - Image height for uploaded image display in the item list. Default: 100.
The core items functionality contains some pre-defined item attributes that can be used in your project:
- "bundleID" (Bundle ID) - This attribute is a link to an item bundle. When you call the
InventoryCore.put()
method, the items contained in the bundle will be put into the inventory instead of the bundle item. - "maxAmount" (Maximum amount) - This attribute contains the maximum amount for an item in the inventory. By default the maximum amount equals 1. If it equals -1, the item amount is unlimited.
The slave server items module is called snipe.slave.modules.ItemModuleCore
. It gives access to items and item groups. Note that all methods return ItemProtoClass
. This is not actually a class but a type definition that points to either the core item prototype class or your project's that should extend the core class. The actual core class is called snipe.slave.data.ItemProtoCore
.
The item bundles module is called snipe.slave.modules.BundleModuleCore
. It gives access to item bundle contents.