-
September 2nd, 2020, 00:34 #1
5E - Additional Storage (Bag of Holding)
5E - Additional Storage - Provides separation from characters encumbrance, for use with: Bag of Holding, Heward's Handy Haversack & Portable Hole
I recommend having a exported backup of your character & campaign, just in case.
Having either, Bag of Holding, Heward's Handy Haversack & Portable Hole, in the characters inventory.
USAGE EXAMPLE:
- Character has a Bag of Holding in their INVENTORY, and it is IDENTIFIED.
- To place an item in the "Bag of Holding" set the items location to "Bag of Holding" and set to NOT CARRIED.
- If a character wants to carry / equip and item already in the Bag of Holding, just use the Carried / Equipped toggle. When Carried or Equipped the items weight is applied to the encumbrance, as it is no longer in the Bag of Holding.
- When you fill out the location, use the TAB key to complete the entry, instead of Enter / Return as this creates a new line, as if you have a blank item in your inventory.
Bag of Holding = 500lb Capacity
Heward's Handy Haversack = 120lb Capacity
Portable Hole = 3616683lb Capacity
NOTE: Location name is case sensitive, and does not work with multiple additional storage items.
If you experience any bugs, please provide details steps on how to reproduce the bug, include if possible, screenshots and extensions that are currently in use.
KNOW ISSUES:
When one of the Additional Storage Items (eg. Bag of Holding) is added to a PCs inventory list, the items "identified" button needs to be toggled.
It appears that when an item is added to the list now, it's identified status is either null/undefined instead of being either 0 (not identified) or 1 (identified).
At this stage, I am unsure if this is something that I am able fix, or if this is something that is a bug with FG / working as intended.
Release Info:
V.1.0 - Initial Release
V.1.1 - Community Request - Added: Greater Bag of Holding (1000lb) and Superior Bag of Holding (2000lb)
V.1.2 - Fix functionality after Unity update (may no longer be compatible with classic)
NOTE: Changed file name (removing version number). If downloading to update, ensure you delete previous file. This has been done so that updating is easier going forward.
Additional Storage Screenshot.pngLast edited by BloatedNikNak; March 8th, 2022 at 02:24. Reason: Added .ext file
-
September 4th, 2020, 10:22 #2
Nicely done! I'll try this out soon methinks!
-
September 4th, 2020, 14:43 #3
Nicely done! I'll check it out this weekend.
Fantasy Grounds Unity Lives! Good job, Smiteworks!
-
September 4th, 2020, 16:46 #4
- Join Date
- Dec 2015
- Posts
- 194
Are there different sizes of bags of holding? If so, would there be the possibility to code this for something like a "superior" bag of holding?
-
September 4th, 2020, 16:50 #5
-
September 4th, 2020, 17:09 #6
- Join Date
- Dec 2015
- Posts
- 194
-
September 4th, 2020, 17:23 #7
In the file: additionalStorage.lua
Found in the .ext file, campaign\scrips\additionalStorage.lua
Just add:
items["Superior Bag of Holding"] = 1000;
for example
Code:function additionalStorage(nodeChar) local current = 0; local max = 0; local remaining = 0; local NCount, NWeight; local items = {}; items["Heward's Handy Haversack"] = 120; items["Handy Handkerchief"] = 250; items["Bag of Holding"] = 500; items["Portable Hole"] = 3616683; items["Superior Bag of Holding"] = 1000; -- Loops through all items in characters inventory. for _,vNode in pairs(DB.getChildren(nodeChar, "inventorylist")) do -- Loops through for item,capacity in pairs(items) do if item == DB.getValue(vNode, "name", 0) and DB.getValue(vNode, "carried", 0) > 0 and DB.getValue(vNode, "isidentified", 0) == 1 then max = capacity end if item == DB.getValue(vNode, "location", 0) and DB.getValue(vNode, "carried", 0) == 0 then NCount = DB.getValue(vNode, "count", 0); if NCount < 1 then NCount = 1; end NWeight = DB.getValue(vNode, "weight", 0); current = current + (NCount * NWeight); end end remaining = max - current; end DB.setValue(nodeChar, "additionalStorage.current", "number", current); DB.setValue(nodeChar, "additionalStorage.remaining", "number", remaining); DB.setValue(nodeChar, "additionalStorage.max", "number", max); end
-
September 4th, 2020, 17:30 #8
- Join Date
- Dec 2015
- Posts
- 194
Where is the .lua file? I don't see a scripts folder in my campaign let along a "AdditionalStorage.lua file anywhere..... (and yes, I loaded the extension in my campaign)
-
September 4th, 2020, 20:06 #9
You'll need to modify the extension. It's essentially a .zip file, so you can just unzip it. 7zip is great about unzipping it easily, however other programs you'll need to tell it that they can unzip it.
-
September 4th, 2020, 22:46 #10
The .lua file is a part of the .ext file you have downloaded from my post above.
If you would like to edit the code for your own home brew content, you will first need to unzip the file.
Use can use 7zip to extract the files, and once that is done, you will be able to browse the files / folders as you would any other folder.
Note that most zip programs will also work, including the one built into windows.
But in order to unzip a file using windows default program, you will first need to rename the file, removing the .ext at the end and replacing it with .zip (you will need to make sure you have "Show file name extensions" enabled in windows to do it this way).
Inside the now unzipped folder, go to /campaigns/scripts/ and open AdditionalStorage.lua with a text editor. I use Visual Studio Code, but notepad++ is a great alternative, or you could just use windows notepad.
Once there you will see the script i pasted above, and will be able to add your own item.
Just follow the same format that i have, so as an example, if you want a Superior Bag of Holding, and say it has a capacity of 1000lb you would add the following:
Code:items["Superior Bag of Holding"] = 1000;
Once you have done what you need, save the file.
You don't have to zip the file again if you do not want to, but it is suggested.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks