Script:Backpack
From Roll20 Wiki
API Script
Author: Ken L.
Version: 1.25
Last Modified: 2015-6-24
Code: NA
Dependencies: None
Conflicts: Unknown
Contents |
Backpack is a journal based inventory system that updates the 'bio' section of a journal to represent a graphic inventory interface. This allows GMs whom implement this script to allow players to manage a graphic representation of their inventory. Once setup, you can move, give, drop, and pickup items through the use of the API button interface as well as buy and sell from shops and stores should they be prepared.
To use this script requires quite a bit of setup on the part of the GM preparing the asset and item databases. The asset database is simply a list of available item types/subtypes and their associated images. The item database is a list of parsable item signatures which can be short hand written to loot drop handouts or any backpack compatible journal entry.
Getting Started
Once you load the backpack.js and backpack_tmp.js scripts into your campaign, you'll need to at least create an asset database.
After creating an asset database, you're ready to populate backpack compatible journal entries as inventories, stores, or loot cache drops.
General Use
TODO
Item Definitions
Item definitions are the format in which entries of items are parsed into the script. They consist of several parts.
[quantity] <name>;<type> [weight] [value] [description] [use] [maxcharge] [enigma]
Formally:[quantity]
name
type
[optionals]
[quantity]
name
type
subtype
[optionals]
type
→ Existing type in backpack_tmp.js
sybtype
→ Existing subtype defined in the asset database
quantity
→ Optional quantity of the item, see quantity
weight
→ Optional weight of the item in lbs, see weight
value
→ Optional value of the item, see value
description
→ Optional description of the item, see description
use
→ Optional use argument to be executed, see use
maxcharge
→ Optional max charges of the item, see charges
enigma
→ Optional the enigma arguments, see enigmas
name
type
subtype
quantity
weight
value
description
use
charges
enigmas
Asset Database
The asset database is a journal entry that contains within its gmnotes section the library of images to be used for item definitions
The asset database has a simple format where each line is a single asset entry (blank lines between groups of entries are fine).
Each asset entry is in either of the following formats:
Type:Link
Type:Subtype:Link
Formally:
type
subtype
link
type
link
type
→ Existing type in backpack_tmp.js
sybtype
→ Anything except ε
link
→ HTML link to the image source, must start with 'http' case insensitive
Item Database
TODO
Customizing
TODO
Changelog
TODO