Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Inventory manager script setup

Ok, I saw a thread on this script, but it seems to be closed now, and I'm running into some questions. I'm working through the first step, creating tokens. I'm creating journal entries and linking tokens to them, but how do I set up player access? Should they be in everyone's journals, and should players have access to control and edit them?
1432374921
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi Gozer, are you building the graphical inventory by John C? If so, strap in... it's a hell of a lot of work but has been worth it for me so far. For all items that the player can peruse and potentially buy set them to be seen by ALL players as journal entries, don't worry about the control settings as the script defines them for you automatically based on where you put them on the 'map'. One thing i found is that you need to have all of your players inventories on one page but you can split them up using DL lines, just make sure their status token has sight, is controlled by them and emits light ;) Otherwise the sky is the limit with this script, i now even have mounts and a cart represented on it with inventories that can be disabled when the mount/cart is not available/in use... such fun :) Back on topic, for all items that you want to make ahead of time or want to keep hidden from the players since they aren't freely available to buy (coinage, special items, quest items etc) don't make them visible in their journals and you can have them all set up ready to go when needed. i'd also highly recommend heavy use of tagging (you've come at the right time, i set mine up pre-folders and now i need to find time to go rename them all to remove the 'weapon, armour etc' prefixes!) and folders. Folders are obviously for separating the weapons, armour etc out but tags can be used to really narrow the search for your players. I use tags to suggest the weapon type (1h, 2h, light, slashing, piercing etc), armour type, item type in general (weapon, armour, equipment, storage, misc etc) but i also use them to define the shops that sell the items (blacksmith, general store, leatherworker, fletcher etc) so that if the players are in a small village with only a general store in it they can quickly filter out unavailable items... great time saver to prevent you from having to veto their every purchase! Have fun :)
Ok, so make the items visible in their journals, but not give them control (talking about common items)? If they don't have control, will they be able to move the item on and off of their icon to equip/unequip things (such as backpacks)? Also, I'm having a hard time deciding about how much volume things take up - like a longbow, for example - how many cubic feet does it take up? Or a suit of armor? And does that matter, since those items would pretty much be "unstowable?" I was actually going to use the script by Rouby, since he said he cleaned up some bugs in John's script. Can you confirm or deny this? Which script are you using?
1432393824
Ziechael
Forum Champion
Sheet Author
API Scripter
I use John's Rouby cleaned it up after i was up and running so i didn't dare switch to check... i'm a coward and Rouby didn't really highlight his changes enough to sway me... John's works just fine for me, granted there can be a delay for some things but i'm fine with that :) I drag the items onto my players inventories for them and just let them place them but it wouldn't harm for them to be able to control the items themselves to save you that step. As for volume, it gets tough i know, a longbow broken down and packed in a bag would probably only be 0.5cf-1cf but i tend to look at it as a guide to making dexterity related skills harder so big or long things have inflated sizes to give that player a much bigger profile... ultimately though it is an extra feature that you can just ignore or fudge to suit your own needs. An extra tip that i've developed it a LOOT area at the bottom, give each player a large token down there with sight and light and have a collective area for displaying the loot they've found in the latest encounter, they can then drag the bits they want to keep onto their tokens for you to relocate to their inventory, everything left behind is just that, left behind :)
Well, it looks as though I've got things set up as far as I need to be for now (I've got extra spaces for new players as they join). I also set up a "loot" area at the bottom. I had the idea of using a Teleport script to have players send the stuff they grab from "Loot" directly to their profile, but the Teleport script I have doesn't seem to work with the Inventory script. Any thoughts? Anyone? Beuller?
1433132488
The Aaron
Pro
API Scripter
What do you mean, the inventory script and teleport script don't work together? Are you getting a crash, or is one just not working when both are activated?
When they are both activated, the teleport script doesn't work. I've set up the matching teleport tokens on the GM layer, and numbered them properly (as far as I can tell, anyway), but when I place a token on the object layer to teleport, it doesn't move, but instead gains a red status marker with the number 2 on it. This is usually what happens in the inventory script when you stack two tokens on top of one another.
Anyone who's using this script, is there an easy way for players to be able to see how much each of their containers are carrying, or how much space is remaining? We're using it to keep track of inventory, but, for example, this past week, the players found a large hoard of coins, and needed to carry them out of the dungeon. It would be nice if the players had some kind of visual representation of how much space/weight they could carry in each of their containers (backpacks, sacks, etc). I could click on the backpacks and see how much is in there, but the players can't do this (the script hard codes it this way). Aaron tweaked the code for the coins to allow the players to adjust the number of coins each token represent, could the containers be tweaked in the same way?
1434982483
Ziechael
Forum Champion
Sheet Author
API Scripter
Your players should be able to see bars 1 and 2 by default which gives them a bar to monitor weight and volume. You could always set up a macro that gives them a text readout in chat based on bar 1 value/max and bar 2 value/max?
Oh...macro's a good idea. I'll work on that. EDIT: The macro idea works great! I created a macro that whispers the GM available weight and volume for a given container. Thanks for the idea! If you want to steal it, here's the macro... /w gm &{template:default} {{name=**@{selected|token_name} Weight/Volume**}} {{Weight Used=[[@{selected|bar1|current}]] lbs. }} {{Weight Available=[[@{selected|bar1|max}-@{selected|bar1|current}]] lbs. }} {{Volume Used=[[@{selected|bar2|current}]] cu. ft. }} {{Volume Available=[[@{selected|bar2|max}-@{selected|bar2|current}]] cu. ft. }} I made it a GM whisper, so the chat wouldn't be spammed for the players, and they wouldn't be confused by seeing others' information and think it's theirs.
1434983371
Ziechael
Forum Champion
Sheet Author
API Scripter
Something as simple as '@{target|bar1} pounds of @{target|bar1|max} pounds used' allows the player to target the container they are interested in querying (naturally you can make that prettier...)
Ziechael, in your version are the grey inventories selectable by players? By default when mine are created, they are not. The macro idea works fine for me as a GM, but for the players, I have to manually give the players control over the inventory area for them to be able to select them (and thus use this macro). I can do it, I'm just wondering if that's the way it works for everyone.
1435007351
Ziechael
Forum Champion
Sheet Author
API Scripter
They can't, but i tested logged as a player and @{target works as they can't select monsters but can still target them :)
Very good, I'll switch mine to @{target}
Ok, noticed another problem. Now that we've started carrying a bunch of coins, it seems as if the coins are not calculating correctly. I've changed the coin weight value to fit better with OSRIC (10 coins/lb), but the weight seems to be rounding up too much. For instance, one guy's carrying 24 coins in his coin purse, but the weight is reading as three pounds. Any thoughts? The code for setting the coins weight is here (lines 42-43): coin: { wgt: 0.1, /* in lbs. */ vol: 0.001 /* in cubic feet. (1,000 per ft3) */ }, And the code where the coins weight is calculated is here (lines 381-385): // If the item is a pile of coins ... if(s.indexOf("coins") !== -1) { // ... adjust the weight and volume ... obj.set("bar1_value",Math.round((parseFloat(obj.get("bar3_value") * GIM.coin.wgt) * 1000) / 1000)); obj.set("bar2_value",Math.round((parseFloat(obj.get("bar3_value") * GIM.coin.vol) * 1000) / 1000)); EDIT: Now that I'm looking at it and comparing it more closely with the results I'm getting, I think it has something to do with the "round" function. 5 coins are coming out to 1 pound (not .5 pounds, like they should), and 116 coins comes out to 12 pounds (not 11.6). If I take out the "round" function, would that work? And why does it get multiplied by 1000, and then divided by 1000?
One of the closing parentheses on the right should be moved before the division (or deleted, in which case one of the opening parentheses after Math.round should be deleted too). The point of code like "Math.round(foo*10)/10" is to retain some digits after the decimal place (multiply by a power of 10, round to an integer, then divide back to where you were). But if the parentheses get misplaced into "Math.round((foo*10)/10)" as above, then the extra math is just extra work for no benefit.
So, like this? // If the item is a pile of coins ... if(s.indexOf("coins") !== -1) { // ... adjust the weight and volume ... obj.set("bar1_value",Math.round((parseFloat(obj.get("bar3_value") * GIM.coin.wgt) * 1000)) / 1000); obj.set("bar2_value",Math.round((parseFloat(obj.get("bar3_value") * GIM.coin.vol) * 1000)) / 1000); EDIT: Yes! That fixed it. Thanks!