Member
Join Date: Jun 2016
Location: KS, USA
Posts: 39
|
I'm trying to code a few different sizes of barrel (based on real-world cooperage) that will adjust their weight based on how many 4 oz. "servings" are contained within them. (My initial intention is to use them to keep track of how many doses of "Tears to Wine" I have, since a single creature drinking the entire output of a first level druid's casting of the spell at 3.74 gallons (0.5'^3) would be enough to induce water poisoning and kill most people.)
I have the barrels set up so that they appear in Tracked Resources with an appropriate number of "charges", and I can currently change the weight from empty to full based on a checkbox under Activated Abilities using an Eval Script. Is there an existing item I could scavenge code from that programmatically checks the Tracked Resources/remaining charges value and does something based on that? Is it possible to programmatically change the number of "charges" used so that I could use the activation checkbox to 'refill' a barrel? Similarly, could I clear the checkbox from my script if the number of charges drops below a certain point? Is there some way to put a button rather than a checkbox in the activation area as more appropriate than a button for refilling? In looking at the Leadership feat, I can see how it adds the tracker for modifiers to the leadership score, but I haven't been able to find in the editor where this is handled programmatically; I can see where it bootstraps 'LeaderHelp', but I can't find that thing in the editor. Finally, is what I'm proposing currently within the known capabilities of Hero Lab? |
#1 |
Senior Member
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623
|
A bag of holding gets the weight of the contained items to be ignored. You could have a look at how that is achieved, to then adjust your own item's weight?
Farling Author of the Realm Works Import tool, Realm Works Output tool and Realm Works to Foundry module Donations gratefully received via Patreon, Ko-Fi or Paypal |
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
Quote:
Quote:
Quote:
I think it's doable. You can access the current number of charges because that is stored in the user field, then multiply that by whatever weight factor each charge should add (based on whatever your house rule says), and override the weight field (gWeight) for the barrel. I think the main challenge will be finding the right timing to override the weight. |
||||
#3 |
Member
Join Date: Jun 2016
Location: KS, USA
Posts: 39
|
Quote:
I do appreciate the attempt to assist, though. Quote:
Code:
Pre-levels, 900 field[gWeight].value = 6 - (field[trkUser].value * 0.25) Also, it turns out that Hero Lab automatically added a 'reset to default value' button on the tracked resources entry for it, so I have my 'click to refill' after all. The timing I used has been working for me on waterskins and jugs that automatically calculated weight based on full or empty. So far it tests like a champ for these barrels, too. Edit: Answering another of Aaron's comments: The reason why I mentioned Leadership in the OP is the tracker on it's activation entry that lets you change the modifier to your leadership score. Turns out I didn't need to go that route after all. Last edited by Skarn; November 12th, 2018 at 12:07 PM. |
||
#4 |
Senior Member
Join Date: Sep 2015
Posts: 435
|
This sounds like a change that should be incorporated into the base HL data set for PF — very useful, thanks!
I'll make my own version of this for various containers in the short term, but maybe ShadowChemosh will end up adding something like it to the Community Pack...? (Wink, wink, nudge, nudge) |
#5 |
Member
Join Date: Jun 2016
Location: KS, USA
Posts: 39
|
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
I can take a look and see how I could add it to the community Pack because it designed to run all the time without turning off currently. Which is not good for the community. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#7 |
Member
Join Date: Jun 2016
Location: KS, USA
Posts: 39
|
Quote:
Besides, keeping enough Tears to Wine-created mead on hand to maintain a constant effect can get pretty heavy at lower levels. Quote:
If that activation component was added back in, wouldn't it be possible to use the activation checkbox to disable calculations? If I'm not mistaken, that should then cause the item to default to the weight assigned in the editor. |
||
#8 |
Senior Member
Join Date: Sep 2015
Posts: 435
|
OCD-ish? Yeah, I suppose.
For me, I want to correct the silly wineskin that weighs 4 lbs even when it's empty. |
#9 |
Member
Join Date: Jun 2016
Location: KS, USA
Posts: 39
|
Quote:
Its a clay jug that I configured based on an activation button for full or empty weight; the only difference between that and what you want is that I used the standard waterskin weight for full, and 0.5# for empty. (The official empty weight would mean that a full skin only holds half what is claimed.) Shouldn't be too difficult to adapt it for more precision with the code here if that's what you prefer. |
|
#10 |
|
|