DMsGuild Classic
Page 1 of 3 123 Last
  1. #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.

    Compatible with both FGC & FGU

    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.

    Release Info:

    V.1.0 - Initial Release
    V.1.1 - Community Request - Added: Greater Bag of Holding (1000lb) and Superior Bag of Holding (2000lb)

    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.png
    Attached Files Attached Files
    Last edited by BloatedNikNak; October 8th, 2020 at 23:14. Reason: Update optimization

  2. #2
    skj310's Avatar
    Join Date
    Jun 2016
    Location
    Queensland, Australia
    Posts
    176
    Blog Entries
    4
    Nicely done! I'll try this out soon methinks!

  3. #3
    Nicely done! I'll check it out this weekend.
    Fantasy Grounds Unity may be official now, but its release may take a while yet.

  4. #4
    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?

  5. #5
    Quote Originally Posted by SmackDaddy View Post
    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?
    I don't believe there is a Superior version, but if you were to homebrew one, its is really simple to add.

  6. #6
    Quote Originally Posted by BloatedNikNak View Post
    I don't believe there is a Superior version, but if you were to homebrew one, its is really simple to add.
    How would I go about doing that? Do you have the source code I could check out or is an extension file viewable within a text editor? (new to all this - sorry for the newb question)

  7. #7
    Quote Originally Posted by SmackDaddy View Post
    How would I go about doing that? Do you have the source code I could check out or is an extension file viewable within a text editor? (new to all this - sorry for the newb question)
    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

  8. #8
    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)

  9. #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.

  10. #10
    Quote Originally Posted by SmackDaddy View Post
    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)
    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;
    It is important that you use the same capitalization here, as you would use in Fantasy Grounds.

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SWADE Playlist

Log in

Log in