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

Access to npc sheet through macro?

Hi,  I'd like to know if there's a way to give access to a character sheet to a player through a macro.  If I set (via token-mod) control to a token to a player, the player can move it but cannot accès the character sheet unless it is in his journal.  Is there a possible macro to both give control and show a specific player the character sheet.  This can be used for conjured animals by a druid. I'd like to give only temporary access to the sheet.  Thank you for your help 
1629890644

Edited 1629891110
Oosh
Sheet Author
API Scripter
Yep, it's possible. The character sheet has the keys controlledby and inplayerjournals which would need the player's id added. I haven't used any API scripts for a while, I can't remember if chatsetattr has a way of pulling player id's or not though - probably not.TokenMod should already be setting the controlledby when you do the token - so it's just the journal access so the player can actually see the sheet. If this is only for one player, you could use tokenMod to grab the required player id from a token only they control. You can then set up a chatSetAttr macro to apply that id to both the required fields on the target monster character sheet. Actually I don't know if CSA can modify these Object keys or not, I don't think I've ever tried. Another option for more dynamic control would be to use Fetch (combined with other Meta scripts maybe) to make it easier to grab the info you need. I'll let the local metamancer offer some advice on that though :)
Oh that's good to know that the key is accessible. I don't think token has already been updated to be able to set this parameter to a player. I checked on token mod help and did,n't see anything about that. Maybe this will happen if TheAaron has some time to have a look through it. It will be great to do something like !token-mod --set inplayerjournal|playername1|playername2... controlledby|playername1... This way we could mass select conjured animals for example and give acces to the druid in a one click macrobutton Thank you for your answer anyway and let's wait to see if anyone has another option.
1629892472

Edited 1629892506
David M.
Pro
API Scripter
The Token Action Maker script  might help. Run the !ta or !sortta command on your conjured animal sheets during setup. It will create token actions for all of the attack rolls, saves, skill checks, initiative, reactions, etc. Then, just use your token-mod macro to assign control of the token. Once a player can select a token, they should be able to access the token actions.  Even if you don't go this route, TAM is one of my favorite utility scripts. I rarely need to open an npc sheet during actual gameplay.
Totally true. I, as a gm, use it all the time too. 
1629904217
timmaugh
Pro
API Scripter
Oosh said: Another option for more dynamic control would be to use Fetch (combined with other Meta scripts maybe) to make it easier to grab the info you need. I'll let the local metamancer offer some advice on that though :) This is one of the edge cases I intend to patch soon. Currently, you can do things like "selected" and "speaker"... but "speaker" looks for a character, not the player. I can add a "player" designation: @(player.playerid) ...and probably code it so that "speaker" -- if paired with a property from the player object -- would return the requested data: @(speaker.char_controlledby)  // gets the character's controlled by list @(speaker.roll20id)      // would get the player's Roll20 ID Other pieces of data should be added, too... like @(campaign...)... or @(time...).