edit-owned-item-effect

I've made an abomination. This hacks its way past the limitations surrounding editing effects on owned items as elegantly as I know how to, it even calls the _pre and post methods for the AE document along the way.
C
Calego861d ago
@ghost this might interest you if nothing else as a proof of concept tangential to what you're thinking about
UU
Unknown User861d ago
C
Calego861d ago
The hooks seem to have been lost in the cracks the transferred effect is not changed, not messing with that but the path to it is pretty clear IF you have a sourceId flag on your Actor's effect since that isn't there by default, you'd be guessing which effects to update (or wholesale deleting and remaking the effects every time, which is less bueno)
C
Calego861d ago
incidentally, 👍 this bad boy for me: https://gitlab.com/foundrynet/foundryvtt/-/issues/6399
GitLab
Consider providing sourceId flag for transferred Active Effects (...
Feature Summary When Active Effects are transferred from Item to Actor, there is no reverse link between the created Effects and...
UU
Unknown User861d ago
C
Calego861d ago
none of this is patched, it's all shennanegins with item sheet hooks and a DIY activeEffect extension Yeah, I've been doing that with my modules but I'm afraid it's a long road forward and not a stable assumption I use that for ensuring there's no duplicates created if someone hits "transfer effect" repeatedly
I
Ikaguia861d ago
Perhaps it would be a nice idea to add a button somewhere to reapply the effect to the actor? This way you could delete the old effect and effectively 'update' it
UU
Unknown User861d ago
C
Calego861d ago
that's what the little hand is on the item sheet effects list
I
Ikaguia861d ago
Two steps ahead I see :)
C
Calego861d ago
This is kind of three steps away from being able to fully derive transferred effects on the actor... Which is interesting, but a little too far for my taste with a module, I might try it for the fun of it, but it makes me nervous without more system control
UU
Unknown User861d ago
C
Calego861d ago
hang on let me push
I
Ikaguia861d ago
Is this going on a separate module or dnd5e itself?
C
Calego861d ago
separate module for sure, i doubt i could get this into the system I've a feeling this is almost system agnostic actually not really sure how much AE stuff 5e actually does vs just using core's
C
Calego861d ago
https://github.com/ElfFriend-DnD/foundryvtt-edit-owned-item-effects/blob/main/scripts/classes/owned-item-effect.js This class 'extends' ActiveEffect and overwrites create delete and update to make them work. Opening an item's effect is basically instanciating one of these with the effect's data and then the rest kinda... just... works.
GitHub
foundryvtt-edit-owned-item-effects/owned-item-effect.js at main · E...
Contribute to ElfFriend-DnD/foundryvtt-edit-owned-item-effects development by creating an account on GitHub.
C
Calego861d ago
The document lifecycle is a rats nest but I suspect it wouldn't be terribly difficult to get the hooks working as well
UU
Unknown User861d ago
C
Calego861d ago
Yeah I think to get really bulletproof API-wise, some deeper method overwriting is a good idea. I'm just happy to be able to open a spell on a player, make a quick and dirty effect on it to mark that "This creature is affected by that spell" finally
UU
Unknown User861d ago
Want results from more Discord servers?
Add your server
More Posts
Item Pile feedbackSimple is king!effects to chat@badideasbureau is the `temporary` flag you look for in Effects to Chat a convention from somewhere 5e AEsI've been messing pretty heavily with some Active Effect assumptions and mechanisms in 5e. This is mhero creator ui feedbackI'm trying to refactor the abilities' tab on the hero creation room to accomodate Race ASIs, but I deffect mechanic searchingI need someone to check me on a null hypothesis I'm making. > There are no abilities in 5e RAW whicDialog shennaneginsTIL the button callbacks for `Dialog.prompt` and `Dialog.confirm` can be asynchronous. ```js const Advancement Hooks@kandashi @ccjmk and anyone else who is currently working on modules that would interact with the AdAPI doc topicsGive me some ideas for what areas of the foundry core API would benefit from a wiki documentation paDiscord Permission IssueOh, I think you also need a Typescript roleDevelopment-APIA new section of the Wiki was created today: `development/api` This section is dedicated to documentitem to actors scriptI have this macro for updating actors in a compendium with spells from a compendium of spells (i.e. Primary and Embedded UpdatesTIL how to update embedded documents at the same time as parent documents. ``` game.actors.getName(compendium errors upgrading to v9hmm im not entirely sure how this will work though.. because I did just a quick smell test to my modBlind Chat MessagesAnyone have good examples of creating a chat message that should only be visible to a connected GM, compendium shennaneginsTIL about `CompendiumContent.getDocuments` taking nedb queries. ``` game.packs.get('dnd5e.heroes').gwith just a parent class and the class name, is there a way to instantiate a new class?JamesB and @veterini have a question for y'all in #coc7-dev https://discord.com/channels/7323252527More Hooks 5ehttps://github.com/ElfFriend-DnD/foundryvtt-more-hooks-5e I'm going to try to use this library to hacreateEmbeddedDocuments issueI'm going to throw my code in a thread so I don't clutter this channel up with a wall of textBase Item@otigon it occurs to me that the new `baseItem` property on weapons and such is probably of interestCompendium loadinghmm ghost, I added some console.time tags here and there to measure the difference between loading o