Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
Advertisement Create a free account Compendium in Game, Join Today

What is the simplest Charactermancer anybody has made for a custom sheet?

1580758982
I've been fiddling about a bit with making a charactermancer for one of my custom character sheets, and while I feel like I understand some basics I haven't been able to get anything working. The examples I've found with sheets that use the charactermancer are too complex for me to learn from, so I've been wondering if anynoe has made a really simple one yet? If not, how would the script for a charactermancer that only named the character look like?
1580760728
Scott C.
Forum Champion
Sheet Author
API Scripter
As far as I know, no one has made a mancer for a custom sheet. Partially, that's because the charactermancer only works with (and can only be developed for) systems that have a compendium on Roll20. The charactermancer only works if the game has a compendium enabled.
1580761537
GiGs
Pro
Sheet Author
API Scripter
Scott C. said: The charactermancer only works if the game has a compendium enabled. I didn't realise that. Does it not work at all even if you dont use any compendium features? Back when they introduced the charactermancer they said they hope to see the community use it and look forward to what they come up with. That seems bizarre if it doesnt work without a compendium.
1580762041
ᐰndreas J.
Forum Champion
Sheet Author
Translator
Cassie have used the charactermancer in some form for the character importer in the Shadowrun 5E sheet.
1580763272
As far as I understand, and this is mentioned in the Shadowrun sheet,  you don’t actually have to use a compendium, as long as you add one in the game settings.  I’ve managed to get a few charmancer pages up an running, but I’m stumped when I try to get the comp_values into the attr_values. I’m sort of understanding the theory, but lost in practice. 
1580764182

Edited 1580764196
GiGs
Pro
Sheet Author
API Scripter
Ah that makes sense. Just add a compendium for another game and don't use it. I can see why that puts off custom sheet makers, since its an extra instruction you have to give players who want to use your sheet, and its an instruction that just seems weird.
1580765249

Edited 1580765292
Scott C.
Forum Champion
Sheet Author
API Scripter
the thing to keep in mind with the mancer is that it is a separate system from the sheets. Yes, it's accessed via a button or other event on the sheet, but once it turns on, the sheet itself is "paused". I haven't actually tried to do something like an api triggered sheet change or a manual change on the attributes & abilities tab to see what happens, but for all practical purposes the sheet itself is paused and setAttrs no longer interact with the sheet attributes. setAttrs instead works with the charmancer values. Which you can then manipulate to your heart's content inside the mancer. This remains localized to the mancer until the user clicks a button to switch to the final slide; note that the mancer can't automate this. Once the final slide has been activated, setAttrs can now affect normal sheet attributes while still being able to get mancer attributes and sheet attributes. Once that's done, the mancer can shut down and the sheet returns to normal.
1580828462
Wes
Pro
Sheet Author
The only thing I have thought about using it for is "Point Buy" attribute setup.
1580837051
I've previously made a character sheet for Traveller. The New Era where I included a "worksheet" tab to help in the rather complicated character generation process. I have figured out how to make charmancer slides and input data into these, and this could replace the worksheet tab and be more user friendly since it has better navigation.Also, I'd be fun to get it working. I have also understood that the data from the charmancer slides are saved in a JSON object that needs to be accecssed in a sheetworker-type script that can write data to sheet attributes, but since I have very limited understanding of javascript I have not able to wrap my head around the actual syntax. I have looked at a few charmancer scripts on the roll20 github, but these are quite complex and do a lot of things so I haven't been able to understand them properly either. That is why I was looking for either a sheet with a very simple charactermancer if that exists, or if anyone could help me with the syntax of a script that did something really simple such as transfering a character name from the charactermancer to the actual sheet. With either of these I think I'd be able to make something very basic. And maybe learn something new.
1580840234

Edited 1580840249
Cassie
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Applying the changes is fairly easy. You can see how I do it here for the Shadowrun 5e Importer.  I use the function: on ( "mancerfinish:apply" , ( ) => { } In this example I've already built an object that associated the imported data with the character sheet attribute names. This final function just deletes all the object keys that were used purely for organizing Charactermancer data then uses setAttrs to apply the character information to the sheet. The object you're building should be far less complicated since "character_name" will just equal whatever the user typed in the associated input. This is the HTML for the Importer if you are curious.
1580910767
Thank you, Cassie. I haven't been able to get anything working yet, but I'm stumbling along...
1580933665
GiGs
Pro
Sheet Author
API Scripter
Can you post the complete code you have already (just the charmancer-related bits)? We may be able to spot any issues with it.
1580997819
I will, but I realized I was in a bit too deep and went back to my javascript tutorials. I'll be back when I get something to work, or failing that something I could reasonably expect to work. 
1581018554
GiGs
Pro
Sheet Author
API Scripter
There's no shame in writing something that doesnt work. When you go too deep, that's exactly the kind of code you should post because helping you with it will likely teach you more quickly than you would learn otherwise.
1582037289
I haven't really had the time to look any further into this, but if I understand Cassies code right, this bit gets the charmancer data and values for any attributes set. For example if I have a slide named "importer" and it contains an input called "comp_character_name", it is now stored in  "mancerValues". on("mancerfinish:apply", () => { const mancerData = getCharmancerData(); const mancerValues = mancerData["importer"].values; Then comes this bit, which I don't understand, but suspect is specfic to the importer: Object.keys(mancerValues).forEach((key) => { if (key == "builder" || key == "jsonData" || key == "hidden") { //delete mancerValues[key]; }; }); clean(); And finally this bit, which I think writes attributes in the "mancerValues" from the comp_ to attr_ so that the character_name should now appear as an attribute on the character sheet: setAttrs(mancerValues, () => { console.log(`%c APPLY IMPORTER:`, "color: blue; font-weight:bold"); console.log(mancerValues); deleteCharmancerData(["importer"]); finishCharactermancer(); }); }); I've tried simply running Cassies script, both with and without the the bit in the middle, without any luck. It does not finnish, does not delete any data from the Charactermancer or write any data to the attributes on the character sheet. Again, I realize I'm out of my depth here...