Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:InventoryManager"

From Roll20 Wiki

Jump to: navigation, search
(Installation and Setup)
(4 intermediate revisions by one user not shown)
Line 10: Line 10:
  
 
This is an example of an API script listing to demonstrate the format we'd like contributors to mimic. Keeping a unified look will lower the barrier to entry for mentors just learning how to use API scripts in their games. In this space we're looking for a general description of the script and it's use. If there a specific installation instructions you should make a note of it here but detail them in the Help.txt and optionally below in it's own section.
 
This is an example of an API script listing to demonstrate the format we'd like contributors to mimic. Keeping a unified look will lower the barrier to entry for mentors just learning how to use API scripts in their games. In this space we're looking for a general description of the script and it's use. If there a specific installation instructions you should make a note of it here but detail them in the Help.txt and optionally below in it's own section.
 +
 +
== Credits ==
 +
 +
This script was inspired by the [https://app.roll20.net/forum/post/1485348/script-graphic-inventory-manager-multidimensional-gui-for-characters Graphic Inventory Manager: Multidimensional GUI for characters] written by John C.
  
 
== Syntax ==
 
== Syntax ==
 +
 +
There are no commands at this time.
 +
 
{{syntaxbox top|Example|nocat=true}}
 
{{syntaxbox top|Example|nocat=true}}
{{API command|example}}<br>
 
{{API command|example 3}}<br>
 
{{API command|example off}}
 
 
{{syntaxbox end}}
 
{{syntaxbox end}}
  
Line 22: Line 26:
 
Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
 
Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
  
Then you need to setup a page in your campaign to be able to use this script. It is recommended that you setup a new campaign for this manager, so that your players can have this campaign open in another tab and always look at their inventories (else you would have to switch the page constantly).
+
You have to change the value of the default inventory token graphic '''inventoryTokenImage'''. Upload any image you wish to represent (the inside) of containers. This could be a lightly transparent square to your campaign / account and retrieve its link (see [[API:Objects#imgsrc_and_avatar_property_restrictions]]).
 +
 
 +
Then you need to setup a page in your campaign to be able to use this script. '''It is recommended that you setup a new campaign for this manager''', so that your players can have this campaign open in another tab and always look at their inventories (else you would have to switch the page constantly).
  
 
The following paragraphs describe the different types of tokens the script can handle.
 
The following paragraphs describe the different types of tokens the script can handle.
Line 32: Line 38:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| Layer || map
+
| '''Layer''' || map
 
|-
 
|-
| bar3_value || Number of the player inside of the config
+
| '''bar3_value''' || Number of the player inside of the config
 
|-
 
|-
| gm_notes || main
+
| '''gm_notes''' || main
 
|}
 
|}
  
Line 45: Line 51:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| Layer || map
+
| '''Layer''' || map
 
|-
 
|-
| gm_notes || worn
+
| '''gm_notes''' || worn
 
|}
 
|}
  
Line 56: Line 62:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| Layer || objects
+
| '''Layer''' || objects
 
|-
 
|-
| bar1_value || Weight of the item
+
| '''bar1_value''' || Weight of the item
 
|-
 
|-
| bar2_value || Volume of the item
+
| '''bar2_value''' || Volume of the item
 
|-
 
|-
| gm_notes || ''any modifiers (see below)''
+
| '''gm_notes''' || ''any modifiers (see below)''
 
|}
 
|}
  
Line 125: Line 131:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| Layer || map
+
| '''Layer''' || map
 
|-
 
|-
| gm_notes || drop
+
| '''gm_notes''' || drop
 
|}
 
|}
  
Line 136: Line 142:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| Layer || objects
+
| '''Layer''' || objects
 
|-
 
|-
| bar1_max || Maximum weight this character can carry (0 for unlimited)
+
| '''bar1_max''' || Maximum weight this character can carry (0 for unlimited)
 
|-
 
|-
| bar2_max || Maximum volume this character can carry (0 for unlimited)
+
| '''bar2_max''' || Maximum volume this character can carry (0 for unlimited)
 
|-
 
|-
| bar3_value || Number of the player inside of the config
+
| '''bar3_value''' || Number of the player inside of the config
 
|-
 
|-
| gm_notes || status OR status3
+
| '''gm_notes''' || status OR status3
 
|}
 
|}
 
  
 
== Changelog ==
 
== Changelog ==
 
{{changelog version|1.0|2015-01-31|* Release}}
 
{{changelog version|1.0|2015-01-31|* Release}}

Revision as of 14:59, 31 January 2015

API ScriptAuthor: Jonathan Burke
Version: 1.0
Last Modified: 2015-01-31
Code: InventoryManager
Dependencies: None
Conflicts: None

This is an example of an API script listing to demonstrate the format we'd like contributors to mimic. Keeping a unified look will lower the barrier to entry for mentors just learning how to use API scripts in their games. In this space we're looking for a general description of the script and it's use. If there a specific installation instructions you should make a note of it here but detail them in the Help.txt and optionally below in it's own section.

Contents

Credits

This script was inspired by the Graphic Inventory Manager: Multidimensional GUI for characters written by John C.

Syntax

There are no commands at this time.

Installation and Setup

Copy the script's code, available from the menu on the right and stored at Roll20's API GitHub Repository. Paste the code into a new script in your campaign's API Script Editor. Save the new script and it will be available inside your campaign.

You have to change the value of the default inventory token graphic inventoryTokenImage. Upload any image you wish to represent (the inside) of containers. This could be a lightly transparent square to your campaign / account and retrieve its link (see API:Objects#imgsrc_and_avatar_property_restrictions).

Then you need to setup a page in your campaign to be able to use this script. It is recommended that you setup a new campaign for this manager, so that your players can have this campaign open in another tab and always look at their inventories (else you would have to switch the page constantly).

The following paragraphs describe the different types of tokens the script can handle.

Character Area

This script expects you to have a special token for each character you want to be able to use the inventory manager. The token represents the area owned by that character. All items that get dropped inside of this area will become controlled by that character and he can freely move them around (even drop them into other character areas). This token has to have main set in its gm-notes section and should be placed on the map layer. You have to set the red bars value to the number of the player inside the script config.

Layer map
bar3_value Number of the player inside of the config
gm_notes main

Equipment Slots

After you have created a character area, you can create any amount of tokens that should represent equipment slots for that character. You can have one big slot all over the character or split them up to indicate various regions on your character. Those slots have to have worn set in their gm-notes section and should be placed on the map layer. All items placed over such an equipment slot will be recognized by the script as 'being worn'.

Layer map
gm_notes worn

Items

Each and every item a player can hold or store is a token. The green bar of a token represents its weight, the blue bar its volume. For ease of use it is recommended that you create often used tokens and save them as handouts so that you can drag them onto a character area whenever you need a new item. You dont have to have a handout for every item, e.g. rare items would not need a handout.

Layer objects
bar1_value Weight of the item
bar2_value Volume of the item
gm_notes any modifiers (see below)

Special Items

Some items are special in that they represent container or have special properties. These properties can be identified by adding modifiers to the gm-notes section of that token. Available modifiers are:

Modifier Effect
unstowable For items that should not be stored inside of containers (e.g. greatswords)
backpack For items that represent containers (each container has its own key, see below)
constantweight For containers that have a constant weight and ignore the weight of their contents (e.g. bag of holding)
liquid For containers that store liquids (e.g. vials)
weight [number] For items that have a base-weight (primary use for liquid containers)
coins [type] For items that should represent a coin
ignore For items or tokens that should not be considered at all (e.g. visual sugar)

Container

Container kinds are defined in the script config section. Per default are the following containers defined:

Key Max. weight in lbs Max. volume in cubic ft
backpack 30 1
quiver 1 0.1
boltcase 1.5 0.15
pouch 6 0.2
pocket 3 0.1
bagofholding 500 64
hhh 80 8
hhhside 20 2
chest 300 12
cart 600 50

You can add additional containers or change the values as you like. Keep in mind that already placed containers do not change their values.

Drop Areas

You can define special drop areas. All items that get moved over these areas will get moved to the map-layer and are not considered to be carried by that player.

Layer map
gm_notes drop

Status Marker

To display the weight, profile etc. you can create a token and place it anywhere. It should be on the objects layer or the information will not be visible (since its name contains the information). For weight and volume informations set status in its gm-notes. For total money-value carried set status3 in its gm-notes.

Layer objects
bar1_max Maximum weight this character can carry (0 for unlimited)
bar2_max Maximum volume this character can carry (0 for unlimited)
bar3_value Number of the player inside of the config
gm_notes status OR status3

Changelog

v1.0 (2015-01-31)

  • Release