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 .
×
Create a free account

Open Character Sheet created with CharacterSheet API

I want my players to be able to create their own character sheets and then have them open automatically. Out of the box, CharacterSheet creates the sheet in the journal tab and displays a message in the Chat tab like: Joab (GM) created a character named "Joab (GM) #2"! Rather than, or in additional to, displaying this message, how can I get the sheet to automatically open upon creation?
1648871177

Edited 1648871248
GiGs
Pro
Sheet Author
API Scripter
There's no way for anything native to roll20 to open the character sheet's automatically. There is another character creation script, made by Aaron, which posts buttons in chat for each user to open the character sheets they control. You probably want to try that. I don't remember what it's called off-hand but it is in the script library.
1648893986

Edited 1648894554
Oosh
Sheet Author
API Scripter
While there is an internal function on character objects, .showDialog() that does exactly this, it's not exposed to the API and also wouldn't help much. It needs to be triggered from within the user's browser to open an iframe there - firing it from the API would open the character sheet for the API "player" in their non-existent browser. The best you can do is a link as GiGs suggested - being able to automate it any further would essentially require Roll20 to allow an API script to open links on a user's screen without their action. That's a bit of a no-no for browsers - you wouldn't even need to write malicious code to accidentally open infinite popups on someone's PC and end the universe. This format should work: [Open my character](<a href="http://journal.roll20.net/character/-blahY0WJeka1_lYnM8w" rel="nofollow">http://journal.roll20.net/character/-blahY0WJeka1_lYnM8w</a>) When you create something with createObj it returns the new ID created, so pretty much just a simple: const newCharacterId = createObj ( 'character' , /* character data */ ); /* do some stuff with attributes or whatever */ sendChat ( `characterCreator` , `/w " ${ msg . who } " [Open New Character]( <a href="http://journal.roll20.net/character/" rel="nofollow">http://journal.roll20.net/character/</a> ${ newCharacterId } )` ); should do the trick. edit - roll20 rudely recoloured that link in the code. That should be orangey-brown stringiness.