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

Deck variables

Just a quick question do decks have a variable  assigned to them. I want to have a deck that gives you a number to assign a token that's a marker for X critters that appear when token attacked but controlling player know what it is before hand
Take a look at the deck/card objects inside the  API Wiki unfortunately I have not dealt with these much myself to be able to understand/help with what you are trying to accomplish.
1485265853

Edited 1485265944
The Aaron
Pro
API Scripter
They don't, but you can use other mechanics, here's a few options: 1) Custom Turn Order -- if you add a Custom Item on the Turn Order named DESK, your players can reference its value as @{tracker|DESK}.  That isn't page specific, so would need to be changed when you change pages. 2) Character -- You could add a character named DESK and give it attributes named for each of your pages.  If you gave it an attribute named FrostHill, your players could reference it as @{DESK|FrostHill} to get the value. Edit : HAHAHAH, and I totally misread what you were asking...
1485265998
The Aaron
Pro
API Scripter
Is there a reason the card can't have a number on it?
The card can have a number on it just wanted to know if I could reference it in a macro 
1485289962
The Aaron
Pro
API Scripter
I think you're in the realm of API scripts then.  At a minimum, you could create a Character for each card played and link the represents automatically.  If you named the card right, you could then pull the value out of the name and place it in an attribute. For that matter, an API script could take the number from the name and put it in the bar, allowing it to be referenced with @{selected|bar1} or some such. Here: on('ready',function(){     "use strict";     on('add:card',function(card){         _.defer(()=>{             let c=getObj('graphic',card.id);             if(! (c.get('bar1_value')+'').length ){                 let cardOrig = getObj('card',c.get('cardid')),                     num=cardOrig.get('name').match(/\d+/);                 if(num.length){                     c.set({bar1_value: parseInt(num[0],10)});                 }             }         });     }); }); On adding a card to the table, if it doesn't have a value in bar1, this will find the first number (muli-digit is fine) in the cards name and place it in bar1. The numbers are persisted in when in a player's hand, but note that when you take a card to hand, the values are store based on the card id, not the graphic, so if you pick up two of the same card, the last card taken will dictate the value of the bars.  (This is specific to Roll20, not this script.)