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

Identify Player Tokens for Scriptcard

Scriptcard Gurus, how would I check whether a token is a Player controlled token?  I manually added "player" to the GM notes of each of their tokens, and this works, but is there a better way to check this?   --:(5) FIND ALL PLAYER TOKENS IN RANGE|   --:RangeLoop|           --:TOKEN MUST BE ON OBJECTS LAYER AND MUST BE A PLAYER|           --?[*[&tokenid]:t-layer] -ne objects |NextToken           --?"[*[&tokenid]:t-gmnotes]" -ninc "player" |NextToken
1629846440
Kurt J.
Pro
API Scripter
If you are using ScriptCards 1.4.0 or later, there is a new option to the pagetokens command that lets you specify PCs, so somthing like:   --~TokenCount|array;pagetokens;@{selected|token_id};pc Will restrict the array that is created to only PC tokens. That is, tokens with a "represents" property to a character with a "controlledby" property. Matt M. said: Scriptcard Gurus, how would I check whether a token is a Player controlled token?  I manually added "player" to the GM notes of each of their tokens, and this works, but is there a better way to check this?   --:(5) FIND ALL PLAYER TOKENS IN RANGE|   --:RangeLoop|           --:TOKEN MUST BE ON OBJECTS LAYER AND MUST BE A PLAYER|           --?[*[&tokenid]:t-layer] -ne objects |NextToken           --?"[*[&tokenid]:t-gmnotes]" -ninc "player" |NextToken
I'm using 1.3.9c (one-click), but will try this method after I update to 1.4.0.  It would certainly be simpler than my method. Kurt J. said: If you are using ScriptCards 1.4.0 or later, there is a new option to the pagetokens command that lets you specify PCs, so somthing like:   --~TokenCount|array;pagetokens;@{selected|token_id};pc Will restrict the array that is created to only PC tokens. That is, tokens with a "represents" property to a character with a "controlledby" property.