elffriend-dnd / foundryvtt-link-item-resource-5e Goto Github PK
View Code? Open in Web Editor NEWFoundry Module to link items and actor resources.
License: MIT License
Foundry Module to link items and actor resources.
License: MIT License
I received the following error:
== Technical Details:
Detected by libWrapper.
Package ID= link-item-resource-5e
Error= The wrapper for 'CONFIG.Actor.documentClass.prototype.update' registered by module link-item-resource-5e with type WRAPPER did not chain the call to the next wrapper, which breaks a libWrapper API requirement. This wrapper will be unregistered.
With TidySheets version 0.7.2, anytime the player sheet is closed all currencies are set to 0.
Using Find the Culprit, it seems to be an interaction between TidySheets and Link Item and Resources.
This may just be an issue on TIdySheets side due to the recent update, so I will let the author know as well.
Currently the module throws a bunch of warnings into the console because of changes to underlying structures in v10
Error: You are accessing the Actor5e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
Hi! Is there a way to have a resource connect to a spell slot?
I have a cleric in DnD 5e System that I need to change his primary resource from 1 to 2 due to leveling. I found that this mod is what is preventing me from doing so. Sheet is editable, I can change the current number value. I tried unlinking the features from the resources and I also tried disabling other mods but this is the only one that's preventing the change (only in that specific resource btw). Is there something that I'm missing or is this a bug?
Problem
Calling update
on an actor with duplicate
d ActorData resets linked resources to whatever they were before the links were established.
Expected Behavior
Linked resources should survive duplication.
Steps to reproduce
let a = game.actors.getName("Akra (Dragonborn Cleric)");
let aData = duplicate(a.data);
a.update(aData);
Additional context/thoughts
Note that the code above, in theory, shouldn't do anything at all. You will notice, however, that the previously linked resources (and the respective item charges etc) are now all set to 0 (or whatever the resources were before linking them).
aData
contains the original resource setup (before linking), but why?
Checking a.data.data.resources.primary
before pushing the update shows the values the way they're being displayed on the character sheet so that
let a = game.actors.getName("Akra (Dragonborn Cleric)");
console.log(a.data.data.resources.primary);
let aData = duplicate(a.data);
console.log(aData.data.resources.primary);
spits out
{label: 'Breath Weapon', value: 1, max: 1, sr: true, lr: true}
{value: null, max: null, sr: false, lr: false, label: ''}
As a workaround, one can delete
the resource property before updating but that seems inelegant because it should be unnecessary. Also, problems arise if the changes being pushed by the update actually involve the linked resources.
Environment
Observed on Foundry 9.268, DnD5e 1.5.7
on a blank world with no other active modules (except the dependency "libWrapper" ofc).
Just letting you know that when I install and use this module, the Actor db file becomes filled with the same actor.
I adjusted 3 Feature resources on 2 actors and both actors had the same thing happen.
(it went from 3MB to 9MB)
I am using the Forge.
5e version 1.5.3,
Foundry 0.8.9
Character sheet used is Tidy5e.
Might is be possible to have the number of remaining hit dice left (of all classes possessed) show up as a resource, out of their respective maximum for the D&D 5e system?
Possibly be able to use item count as a resource (arrows for instance) or even spell slots remaining. This mod is awesome and I dont use the resource sections otherwise since none of them sync.
Ex: I have a wand with 5 charges, if i want to refund some of the charges through the resource rather than through the item, I'd like for that to be possible
Foundry V10.285
LibWrapper 1.12.9
Link Item and Resource 1.2.2
When attempting to change the resource quantity it will revert back to item quantity on load, and does not adjust item quantity.
Hello!
Since Updating to V11 - the first time a character sheet is opened, any abilities/items linked to the resources will not populate in the resources boxes. They're just blank (e.g. "Resource 1," etc.) However, the resource fields are locked, as are the ability/item quantities - indicating that the module still has some control over those fields and that they're still linked.
When the sheet is closed/reopened or when the ability/item is edited in any way, it populates the ability/item to resource box with an overridden quantity of zero (0).
I've tested with all other modules inactive (other than dependencies) with no change. I've also tested by manually editing the resource in advance with the proper quantities, and then activating the module. In that case, when the resource populates, it does so with a quantity that matches my manual edit regardless of how many were used.
Thanks in advance for any guidance!
Originally from Mr Primate:
So I think I have found a bug - if the resource is greater than 2 e.g. then when I try to change the resource amount on the resource box back to full, it doesn't change the usage. - it will change if it's not a max value
Likely due to there being an underlying resource whose maximum is lower than the override's. Will have to do some digging on this one.
Constated behavior :
Wished for behavior :
Thanks :-)
If you create an innate spell, say "Darkness" and link it to a resource, it works just as you expect. However if you immediately change it from an "innate" spell to a "prepared" spell, the link will remain despite it no longer having a daily resource or what-have-you.
Just a thought! It took me a while to get past this and I thought one of my resources was permanently bugged. Turns out it was just this!
There are two "debugger;" calls in the code, which I'm pretty certain do not belong there.
They trigger when I close a character sheet AND the console (F12) is open.
As the title says, I would like for this module to be able to link the items to the resources added by Add a Resource.
After update to Foundry 11.300 the module "presents" itself as not working
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.