Token Handout

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
DMFTodd
Cave Troll
Posts: 95
Joined: Mon Jun 29, 2009 11:17 pm

Token Handout

Post by DMFTodd »

The lMarkus framework for Pathfinder has a very handy macro that makes it easy to handout images to all the players. I've ripped it out of the framework and made it easier to insert into any framework (at least that was my intention). As noted, I ripped this out of an existing framework: I've not created anything myself here and all credit goes to the giants who created this to begin with.

How It Should Work: You have a button called Token Handout. You click a token, click this button, and then you can "handout" the image on the token's Layout, Portrait, or Handout to whichever players you like. In the chat window, each player gets a link to that image. They click that link and it opens a window displaying the image.

First, you need to add the attached token to your campaign.

Secondly, you want to create a Token Handout button, probably in your Campaign macros that has this code:

Code: Select all

<!-- see  http://forums.rptools.net/viewtopic.php?f=20&t=8467 -->

[H: assert( isGM(), "<b>" + getMacroName() + "</b> is a GM only macro.", 0 )]
[H: ids = getSelected()]
[H: abort(if(ids == "", 0, 1))]

[H: playerList = getAllPlayerNames()]

[H: whichTokenTabString = ""]
[H: whichTokenTabString =  whichTokenTabString + "Text | Handout (click this) | Clickable text link || TEXT"]
[H: whichTokenTabString =  whichTokenTabString + " ## " + "dispElement|Image,Portrait,Handout,None|Show Which Image | RADIO"]
[H: whichTokenTabString =  whichTokenTabString + " ## " + "dispText | Notes, GM Notes, Free Text, NA(Token Name) | Show Which Text | RADIO"]
[H: whichTokenTabString =  whichTokenTabString + " ## " + "FreeText | On-the-fly info text |Enter free text | TEXT"]

[H: SendToTabString = ""]
[H: SendToTabString = SendToTabString + "dummy | 'All Players' overrides individual player choices | Display to | LABEL"]
[H: SendToTabString = SendToTabString + " ## " + "allPlayersCheck | 1 | All Players | CHECK"]
[H: SendToTabString = SendToTabString + " ## " + "dummy | ------------------------------------------------------- | --------------- | LABEL"]
[H: playerNumber = 0]
[H, FOREACH(tempPlayer, playerList), code: {
   [SendToTabString = SendToTabString + " ## " + "playercheck"+playerNumber+" | 0 | " + tempPlayer + " | CHECK"]
   [H: playerNumber = playerNumber+1]
}]

[H: success = input(
"whichTokenTab | Info || TAB",
whichTokenTabString,
"sendToTab | SendTo || TAB",
SendToTabString
)]
[H: abort(success)]

<!-- Link text -->
[H: tToken = currentToken()]
[H: displaytext = macroLink(Text,"subShowHandout@Lib:TokenHandout","self","Element="+dispElement+"; Text = "+dispText+"; FreeText = "+FreeText, tToken)]

<!-- build json array with player names to send to, based on user input -->
[H: jarr = ""]
[H: playerNumber = 0]
[H, FOREACH(tempPlayer, playerList), code: {
   [tempTicked = eval("playercheck"+playerNumber)]
   [IF(tempTicked): jarr = json.append(jarr, tempPlayer)]
   [playerNumber = playerNumber+1]
}]

[IF(allPlayersCheck), code: {
    [R: displaytext]
  };{
   [H: outputTo(jarr, displaytext)]
   [H: abort(0)]
}]
Attachments
LibTokenHandout.rptok
The token having some needed functions.
(18.01 KiB) Downloaded 92 times

Volomon
Cave Troll
Posts: 56
Joined: Fri Jul 02, 2010 4:43 am
Contact:

Re: Token Handout

Post by Volomon »

Never posted for this thread and felt I should this is a very helpful macro and anyone who drops multiple handouts should get this.

Great work!

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Token Handout

Post by wolph42 »

A similar function can be found on the bag of tricks. Except for the link, the players get the image immediately as a pop up on screen.

Post Reply

Return to “User Creations”