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

Decks: seeing cards distributed to "absent" players

Hey guys and gals! I have a deck that grants a random one-time bonus for each level my players have (distributed randomly when they gain a level). I'm doing my last tunings before a game tomorrow and I'd like what kind of card they might use just in case. Of course, my players aren't connected right now, so I can't just click on their avatar to see their "hand". I know they still have the cards when they reconnect after testing it out with them. (I'm their GM) Do you know if there's any way to see their hand when they're not connected?
1642886933
Gold
Forum Champion
I think there's no way. There might be a way using API Scripts, since you're PRO, I'm not sure, would recommend looking at card-deck related API scripts. It's a good &amp; necessary suggestion for a lot of games and use-cases. Please mention your request in the Suggestions thread for Enhanced Card Deck features if you agree +1: <a href="https://app.roll20.net/forum/post/1240005/enhanced-card-deck-features" rel="nofollow">https://app.roll20.net/forum/post/1240005/enhanced-card-deck-features</a>
Gold said: I think there's no way. There might be a way using API Scripts, since you're PRO, I'm not sure, would recommend looking at card-deck related API scripts. It's a good &amp; necessary suggestion for a lot of games and use-cases. Please mention your request in the Suggestions thread for Enhanced Card Deck features if you agree +1: <a href="https://app.roll20.net/forum/post/1240005/enhanced-card-deck-features" rel="nofollow">https://app.roll20.net/forum/post/1240005/enhanced-card-deck-features</a> Thanks for the answer. I'll try looking through a few APIs just in case but I don't think there's much hope. Thanks for the suggestion thread too! I tried posting it.
1642898659
The Aaron
Roll20 Production Team
API Scripter
Here's a little script I threw together for this.&nbsp; Run it with: !show-hands Output looks like: Code: on('ready',()=&gt;{ const HE = (() =&gt; { const esRE = (s) =&gt; s.replace(/(\\|\/|\[|\]|\(|\)|\{|\}|\?|\+|\*|\||\.|\^|\$)/g,'\\$1'); const e = (s) =&gt; `&amp;${s};`; const entities = { '&lt;' : e('lt'), '&gt;' : e('gt'), "'" : e('#39'), '@' : e('#64'), '{' : e('#123'), '|' : e('#124'), '}' : e('#125'), '[' : e('#91'), ']' : e('#93'), '"' : e('quot') }; const re = new RegExp(`(${Object.keys(entities).map(esRE).join('|')})`,'g'); return (s) =&gt; s.replace(re, (c) =&gt; (entities[c] || c) ); })(); const s = { num: `position:absolute;top:3px;right:3px;z-index:100;font-weight:bold;color:white;font-size:2em;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;`, card: `max-width: 5em;max-height:7em;position:relative;display:inline-block;margin:.5em;box-shadow:.2em .2em .4em .4em;`, title: `font-weight:bold;color:black;font-size:1.3em;`, title2: `bottom:3px;left:3px;z-index:100;font-weight:bold;color:white;font-size:1em;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;`, player: `padding:.5em;margin-bottom: 1em;`, deck: `border:1px solid #333;background-color: #999; margine-left:1em;padding:.5em;` }; const f = { t : (c) =&gt; `&lt;div style="${s.title}"&gt;${c}&lt;/div&gt;`, t2 : (c) =&gt; `&lt;div style="${s.title2}"&gt;${c}&lt;/div&gt;`, player : (p,b) =&gt; `&lt;div style="${s.player}"&gt;${f.t(p)}${b}&lt;/div&gt;`, deck : (d,b) =&gt; `&lt;div style="${s.deck}"&gt;${f.t2(d)}${b}&lt;/div&gt;`, card : (t,i) =&gt; `&lt;div style="${s.card}"&gt;${f.hover(t,f.image(i))}&lt;/div&gt;`, hover : (t,b) =&gt; `&lt;span class="tipsy showtip" title="${HE(HE(t))}"&gt;${b}&lt;/span&gt;`, image : (i) =&gt; `&lt;img src="${i}"&gt;`, }; const showCard = (card) =&gt; f.card(card.get('name'),card.get('avatar')); const getPlayerByID= (()=&gt;{ let cache = {}; return (pid) =&gt; { if(!cache.hasOwnProperty(pid)){ cache[pid] = getObj('player',pid); } return cache[pid]; }; })(); const getDeckByID = (()=&gt;{ let cache = {}; on('destroy:deck',(did)=&gt;{ delete cache[did]; }); return (did) =&gt; { if(!cache.hasOwnProperty(did)){ cache[did] = getObj('deck',did); } return cache[did]; }; })(); on('chat:message',msg=&gt;{ if('api'===msg.type &amp;&amp; /^!show-hands(\b\s|$)/i.test(msg.content) &amp;&amp; playerIsGM(msg.playerid)){ let who = (getObj('player',msg.playerid)||{get:()=&gt;'API'}).get('_displayname'); let hands=findObjs({type:'hand'}) .reduce((m,h)=&gt;{ let p = (getPlayerByID(h.get('parentid'))||{get:()=&gt;`Unknown Player: ${h.get('parentid')}`}).get('displayname'); let ds = h.get('currentHand') .split(/\s*,\s*/) .filter(s=&gt;s.length) .map(cid=&gt;getObj('card',cid)) .filter(o=&gt;o!==undefined) .reduce((m,c)=&gt;({...m,[c.get('deckid')]:[...(m[c.get('deckid')]||[]),c]}), {}) ; let deckOutput = Object.keys(ds).map(id=&gt;{ let d = (getDeckByID(id)||{get:()=&gt;`Unknown Deck: ${id}`}).get('name'); let cards = ds[id] .map(showCard) .join('') ; return f.deck(d,cards); }).join(''); return [...m,f.player(p,deckOutput)]; },[]); sendChat('',`/w "${who}" ${hands.join('')}`); } }); });
Thanks a lot guys!
1643223138
Gold
Forum Champion
Very nice authoring and providing of API snippit, from arcane scriptomancer The Aaron. I'd be keenly interested in a different/expanded version of that --- to make it possible to Play the Cards into the Chat with the full text of the card's contents (not just the name, preferably more than just the Tooltip, instead to include the actual complete face-text of the cards). But i'm not going to pursue asking for this now from API Scripters, instead I'm requesting Roll20 add these features as a standard feature, for Accessibility purposes.