-
August 16th, 2020, 15:52 #11
- Join Date
- Feb 2016
- Posts
- 39
We just came into this issue. This sounds like a very cool extension. Do you know when you will be releasing it?
-
August 16th, 2020, 16:12 #12
I did manage to get it working. I'm currently testing it with friends.
Will need a couple days to make sure there are no apparent issues.
Will aim to get something out on Tuesday, unless there are issues found.
This will be my first extension, so I will advise now, that you should make sure your campaign is backed up before use.
-
August 18th, 2020, 14:39 #13
I ran into an issue today, while refactoring... ya know how it is..
The way i previously had a working version, was essentially replacing the "manager_char.lua" file with my own, where i copied everything from the original into my own, and added my own lua where needed.
Knowing that this is not best practice, i looked to create and initialize my own script, which is being called as and when it is needed, but now the script does not work.
I have tested that both the onInit() and my function is being called, which it is.
Below is my function.
Code:function onInit() DB.addHandler(DB.getPath("charsheet.*.inventorylist.*.carried") , "onUpdate", nonDimensionalStorage); DB.addHandler(DB.getPath("*.count"), "onUpdate", nonDimensionalStorage); end function nonDimensionalStorage(nodeChar) local nDSCurrent = 0; local nDSMax = 500; local nDSRemaining = 0; local nDSNCount, nDSNWeight; for _,vNode in pairs(DB.getChildren(nodeChar, "inventorylist")) do if DB.getValue(vNode, "location", 0) == "Bag of Holding" and DB.getValue(vNode, "carried", 0) == 0 then nDSNCount = DB.getValue(vNode, "count", 0); if nDSNCount < 1 then nDSNCount = 1; end nDSNWeight = DB.getValue(vNode, "weight", 0); nDSCurrent = nDSCurrent + (nDSNCount * nDSNWeight); end nDSRemaining = nDSMax - nDSCurrent; end DB.setValue(nodeChar, "bagofholding.current", "number", nDSCurrent); DB.setValue(nodeChar, "bagofholding.remaining", "number", nDSRemaining); DB.setValue(nodeChar, "bagofholding.max", "number", nDSMax); end
also.. is there a code wrap option on the forum?
EDIT: never mind i found it (in advanced)Last edited by BloatedNikNak; August 18th, 2020 at 14:44. Reason: additional info (for loop)
-
September 2nd, 2020, 00:36 #14
Extension has been released:
https://www.fantasygrounds.com/forum...ag-of-Holding)
-
September 2nd, 2020, 06:35 #15
- Join Date
- Feb 2016
- Posts
- 39
Awesome! Thank you!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks