advancement consumption

Cccjmk4/7/2022
now that I brought that up on #progress-reports @calego , could I maybe pester you later for some advice regarding how to consume advancements? I think I would not be relying on the nifty hooks you have been working on cause unless I go completely overboard with the refactoring, I would be just using the advancements for reference on what to show on the Hero Creation ui
CCalego4/7/2022
I expect you'll be interested in the "before our advancment selection flow begins" hook to cancel out of it and substitute your own. Otherwise, you're probably not going to want those hooks yeah. All advancment data is stored on the Items with advancments, but I believe there's a 'summary' of sorts on the actor itself? I'm not 100% and it is undergoing some refactors at the moment which @arbron knows more about, so imma ping him to pull in his expert opinion (thanks for all the legwork you're putting in btw jeff)
LTLLeo The League Lion4/7/2022
@calego gave vote LeaguePoints™ to @arbron (#70 • 25)
Cccjmk4/7/2022
but that hook still happens when the advancement is triggered, right ? before selecting stuff, sure, but you need an Actor getting an advcamentment at least
CCalego4/7/2022
It happens when a levelup happens or when a new item with advancements is added right.
Cccjmk4/7/2022
fo real though, he's been killing it for 1.6x / 1.7.x
CCalego4/7/2022
we're apparently adding in a "level up button" on the actor sheet RAW before we release, so that might be something you'll need to worry about
Cccjmk4/7/2022
yeeeeah.. I don't even have an actor by the time I need to munch them
CCalego4/7/2022
AHHH You mean for creation creation
Cccjmk4/7/2022
yup liiiiiiiiiiiterally creation 😛 I don't know how familiar you are with the module though, but its basically roll20's charactermancer, only.. sexier ofc cause i did it 🕶️
LTLLeo The League Lion4/7/2022
Package: hero-creation-tool
Author: Alex, Dan, Andrew, Coco, Roy, Lyle, ccjmk
Hero Creation Tool for DnD5E
A step-by-step tool for creating player characters on DnD5e-based games
Info:
Version: 1.7.1 Core: 9 Changelog
Stats:
Installs: 1.94% Endorsements: 2 Comments: 1
CCalego4/7/2022
yeah I remember now Mmm that's trickier How do you populate class selection today? I'd probably try something like "trawl the compendia for class items". When a class is selected, get that document in full from the compendium so you have all its advancement info.
Cccjmk4/7/2022
there's a couple module settings where the user selects compendia where I will search for the Class items, and Features that I should try to link too classes. I expect those Features to have the ${className} ${lv} as requirement, those compendia get indexed when the tool's opened (to fast-fetch the requirement), and then I show whatever matches ${selectedClass} ${selectedLv} when you click & confirm "Create" all those indexed items get rehydrated into actual getDocument shenanigans, there might be some extra nuisance somewhere there, I remember I had some issues that ghost helped me deal with
CCalego4/7/2022
Features that I should try to link too classes
tell me more... I would expect this part to be unecessary now that Users have a UI to add features to classes
Cccjmk4/7/2022
No description
Cccjmk4/7/2022
right now I'm already adding all those to the actor fresh outta the oven, I guess sure, I could just add the class with appropriate levels, and the hooks would ask the user to add everything? but it would be a little crappy UX-wise.. showing the user what features they will get is part of the "preview" handiness, and asking them later to "acccept them" again feels crappy :/
Aarbron4/7/2022
Since each advancement type renders its own UI within the larger advancement interface, you could just render this components within your own interface Then use the advancement's apply methods yourself to make changes to the actor your building
Cccjmk4/7/2022
but there's no actor when I show that UI yet hmm i could make make a synthetic actor and save it on "creation"..
Aarbron4/7/2022
Yeah, that's what we are doing with the advancement process We clone the original actor, make all of the changes to it, and then copy them over to the original actor when you click complete
CCalego4/7/2022
The advancement data on the class item has a list of item uuids that you can use however you desire I would use that to power the thing you screenshotted Ultimately you'll do less guessing on your end and simply trust that the class item is configured with advancements correctly
Cccjmk4/7/2022
ok, I don't recall how to make a synthetic actor but I can search for that, what I have no clue on is how will I render the advancement component. (i am finishing work soon so I'll be able to play with this some more) yeah that's a huge boon for me
CCalego4/7/2022
I probably wouldn't need around with rendering the advancement manager for your use case
Cccjmk4/7/2022
just show them as I am now ? it does make sense to hook onto advancements on a more clever way I think.. because for example, I understand we could remove or modify stuff on the actor on an advancement right ? so I would expect to for example, process all advancements from lv1-to-5 if the user selects say a Bard 5, and been able to show "ok, your whatever dice will be like this at that level" and so on so forth but maybe it's better to just use the basic advancements, and then maybe run the rest when the actor is created, else things might get muddy fast
CCalego4/7/2022
Mmm, yeah that's true it would be smart to populate the advancement choices in the same way, otherwise stuff might get wierd Is HCT creating the actor with all of the things they choose, or creating the actor, then modifying it?
Cccjmk4/7/2022
creating it with everything NOW if I need to change that to better fix advancements, so it be
CCalego4/7/2022
your UX is a lot cleaner and more intuitive how you have it now
Cccjmk4/7/2022
my concern originally was not doing a bunch of updates, but I was not fully aware of synthetic objects before, and I understand that would solve the issue the same way, right?
CCalego4/7/2022
It does yeah, in theory at least you for sure make less DB calls, but you have to work around some things and the final call is really like 3-4 calls
Cccjmk4/7/2022
so yea, I could make a synth when user opens the tool, and maybe toy with it as you advance, persist it on Create
CCalego4/7/2022
that's an interesting idea
Cccjmk4/7/2022
for creating a syn I need to send temporary: true to the Document.create right ? like
Actor.create(actorData, {temporary: true})
Actor.create(actorData, {temporary: true})
I will probably start by that, refactoring this to create an actor on popup, and persist that once, then I can play with Advancements 😆

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
Alternative Alignment System D&D5eWow, that is a really powerful way to codify alignment. I like it! Do you have any ideas as to how iconsumables chat data@Zhell > So that's odd. How come consumables work different and all other item types get a non-funcilthid stop dragActually, would it be possible to modify the core function that allows people to click and drag toke1.6.x mid-milestone update@dnd5e - **No Action Required** Milestone 1.6.0 is 69% Complete (_nice_) <https://gitlab.com/foundPlugin ContributorsI'm very proud to be the maintainer of a module (Export Sheet to PDF) that is getting many, many conmore-hooks-itemroll-hooksFor those of you interested in such things, I have hacked together a way to inject hooks into the mipreHooks5eJSON.stringify jankI discovered that the problem is JSON.stringify, not parselayersTIL about CSS Layers. https://developer.mozilla.org/en-US/docs/Web/CSS/@layer ```css @layer utilitiHitDice hooks MRI just added my first merge request 😄 <https://gitlab.com/foundrynet/dnd5e/-/merge_requests/495>advantage shennaneginsdevmode extension brainstormhttps://github.com/mdn/webextensions-examples/tree/master/devtools-panelsSaving Functions as module settings@wasp I remember you asked about saving functions as settings (which quickly turned into stringifyinnew consumable typesTried adding localization strings for some new consumable types, but keep getting this ("`DND5E.Consspell-compendium-5e alpha1Overriding onDropItem & onSortItemYou'd override them in your sheet class.getter & setter wrapper for settingsI'm trying to use a getter & setter pair as an interface for `game.settings.get` and `game.settings.scrollable tab contentsIt is possible, and you're firmly in the css and DOM structure side of development with this line ofJr devI'm cleaning out my bookmarks and accidentally came back to this article. Potentially useful startinHTCPackage: `hero-creation-tool`