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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 4)

1488830159

Edited 1488830238
Arthur B. said: But if I use --whisper|all, wouldn't that whisper it to everyone? Yup; if you don't want to whisper everyone, replace 'all' with 'self, gm' or a list of players Also, will [Books](!
#Books) work in the chat as a buton without a script like PowerCards? Yes.
Thanks for the help guys! Much appreciated.
March 21st, 2017 ~ 8:45 am eastern Version: 3.4.0 Link: <a href="https://gist.github.com/Sky-Captain-13/452330a3d9" rel="nofollow">https://gist.github.com/Sky-Captain-13/452330a3d9</a>... Major Update: You can now send a command to the AlterBars script written by me as well. This means you can use PowerCards to apply damage to a target automatically. Much like the soundfx option, you have to replace the -- in the alterbar commands with a single underscore. --alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|GM The sample macro below shows how to apply damage to the target of an attack based on their AC, using the D&D 5e OGL sheet armor class attribute npc_ac: !power {{ --name|Shortbow --Attack:|[[ [$Atk] 1d20+5]] vs @{target||npc_ac} AC --?? $Atk &lt; @{target||npc_ac} ?? !Missed|**You missed!** --?? $Atk &gt;= @{target||npc_ac} ?? soundfx1|_play|ArrowHits --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? Hit:|[[ [$Dmg] 1d8+3]] piercing damage --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|GM --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d8+3]] piercing damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|GM }}
1490109301
Ziechael
Forum Champion
Sheet Author
API Scripter
SkyCaptainXIII said: Much like the soundfx option . I wish mine would work... :'( #passivedepressivecryforhelp
1490122546

Edited 1490122741
Ziechael said: SkyCaptainXIII said: Much like the soundfx option . I wish mine would work... :'( #passivedepressivecryforhelp Works for me... not sure why it doesn't for you. Send me an invite to your campaign.
There is an issue if your use recursive tables along with powercards and a number of other scripts that all use the same HandleInput function. I had to disable and enable all my scripts a dozen times to nail it down to recursive tables. Inside handleInput, there's a line where it tries to get the player displayname from msg.playerid and sending a script command from the api has no playerid. This is the fix for that problem... somewhere around line 102-104'ish... who=(getObj('player',msg.playerid)||{get:()=&gt;'API'}).get('_displayname');
Also, the alterbar update only works on single targets. It will take a big re-write to make it work for multiple targets, which may be done someday... since the new jsnode has some options that might alleviate earlier issues I had with powercards and async functions.
Cool updates!
JB, any way to apply this API image to chat script with power cards? <a href="https://app.roll20.net/forum/post/590539/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/590539/slug%7D</a>
Putting images in chat is in by default now. [alttext](<a href="http://i.imgur.com/BsEMCPm.png" rel="nofollow">http://i.imgur.com/BsEMCPm.png</a>)
What about within PowerCards?
Doesn't seem to work.You can put it at the top of the macro though to show up first.
1491425175

Edited 1491425250
Is there a way to remove the Display Name tag when you use:&nbsp;[alttext]( <a href="http://i.imgur.com/BsEMCPm.png" rel="nofollow">http://i.imgur.com/BsEMCPm.png</a> )
Nope.
Thanks for checking...
New to power cards is the a doc to help me learn the template? Master ML that is a really nice token.
Craven . said: New to power cards is the a doc to help me learn the template? Master ML that is a really nice token. First couple posts in the thread have all the basic information. Anything else, just ask in thread and someone may be able to help.
1491532500

Edited 1491532583
Can this be turned into a power card format? I hate the pick buttons. /w GM &{template:npcaction} {{rname=GM Tools}} {{name=Craven's Tools}} {{description=[Status Marker](! #GM:TokenStatus) •&nbsp; Sets Token to a status using token mods. **Status** Blind, Charmed, Deafened, Frightened, Grappled, Invisibility, Paralyzed, Petrified, Poisoned, Prone, Restrained, Stunned, Unconscious and Dead. &nbsp;[Player Stats](! #GM:StatsPC) •&nbsp; Show important stats of a Player. [Monster Stats](! #GM:StatsMonster) •&nbsp; Show important stats of a Monster. [New Toon Fixed](! #Starting-Stats) •&nbsp; Roll abilities for **New Character Fix** Rolls twice for each ability. Can not move the numbers. 6*4d6 keep highest 3 reroll 1's. [New Toon Float](! #New-Toon) •&nbsp; Roll abilities for **New Character Float** is Roll 6x4d6 keep highest 3 reroll 1's but you can chose where to but the abilities. [Weather](! #Weather) •&nbsp; Take you to a weather site for random weather. [5e OGL API Status](! #API5eStatus ) • Stats of the 5e OGL API }}
You would still have to use the buttons.
Sky said: You would still have to use the buttons. Would the be pink? Can we change the color?
I haven't done anything to change the color of any command buttons.
Hey team, trying to bust out the character portrait & name first when the skill (or whatever) generates on the sidebar for the M&M character sheet. My current macro is: !power {{ --name|Test of Skill --leftsub|Skill --rightsub|Check ^^?{Use Skill|Acrobatics, **Acrobatics:** [[1d20+@{selected|Acrobatics}]]|Athletics, **Athletics:** [[1d20+@{selected|Athletics}]]|Deception, **Deception:** [[1d20+@{selected|Deception}]]|Expertise, **Expertise:** [[1d20+@{selected|Expertise-1}]]|Insight, **Insight:** [[1d20+@{selected|Insight}]]|Intimidation, **Intimidation:** [[1d20+@{selected|Intimidation}]]|Investigation, **Investigation:** [[1d20+@{selected|Investigation}]]|Perception, **Perception:** [[1d20+@{selected|Perception}]]|Persuasion, **Persuasion:** [[1d20+@{selected|Persuasion}]]|Sleight of Hand, **Sleight of Hand:** [[1d20+@{selected|Sleight-of-hand}]]|Stealth, **Stealth:** [[1d20+@{selected|Stealth}]]|Technology, **Technology:** [[1d20+@{selected|Technology}]]|Treatment, **Treatment:** [[1d20+@{selected|Treatment}]]|Vehicles, **Vehicles:** [[1d20+@{selected|Vehicles}]]} }} (Sorry, I don't know how to do that cool gray background that can scroll that you guys do). I assume I need to place the command in between !power {{ and --name|, &nbsp;but not sure how to go about it. I thought it was --charid| , but doesn't seem to be working. Also, I would like to give them the option to change the output color to make it unique to their characters (right now they are all purple). A quick and dirty command line for that would be appreciated if it is possible. (Apologies if this is redundant and I have overlooked it. Just getting my bearings in the Powercard department).
Sky said: You would still have to use the buttons. So how do I add button to the powercards?
Dustin said: I assume I need to place the command in between !power {{ and --name|, &nbsp;but not sure how to go about it. I thought it was --charid| , but doesn't seem to be working. --charid|@{selected|character_id} --emote|... should work for you: charid - Gets the character_id of the character triggering the macro. Combines with --emote to create a custom look to emotes. Usage: --charid|@{character_id} emote - Creates an emote on top of the power card. Set CUSTOM_EMOTES to false in script to return to standard Roll20 orange emotes. If you have charid and emote together in the macro to use the power card styled emotes, you can put an exclamation mark in front of the emote to not show the avatar for that macro. Example: --emote|This emote would have an avatar. Example:--emote|!This emote would not have an avatar. Dustin said: Also, I would like to give them the option to change the output color to make it unique to their characters (right now they are all purple). Set USE_PLAYER_COLOR on line 63 to true.
1491594242

Edited 1491594310
Craven . said: Sky said: You would still have to use the buttons. So how do I add button to the powercards? Add a --whisper| tag (e.g. --whisper|self or --whisper|all) to your PowerCards macro, and Command Buttons should then function as expected.
Players can also customize every individual powercard's color if they want with the use of tags like --txcolor, --bgcolor, etc.
Silvyre said: Craven . said: Sky said: You would still have to use the buttons. So how do I add button to the powercards? Add a --whisper| tag (e.g. --whisper|self or --whisper|all) to your PowerCards macro, and Command Buttons should then function as expected. Oh yeah... forgot they don't work except in whispers for some reason.
1491621365

Edited 1491621414
Thanks, team. I've got the color scheme figured out, but for some reason I am not getting the tokenid to generate within the Powercard. My output Macro !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} --name|Parry [[10+@{selected|parry}]] Dodge[[10+@{selected|dodge}]] }} What can I do to get the pic and emote name in the same format as the Powercard below?
1491631518

Edited 1491631589
Buttons not working in powercards I have tried --whisper|Gm as well !power {{ --whisper|all --corners|10 --format|GM --name|Token Mod Lighting --leftsub|Set light sources --rightsub|Set Vision --Torch| [On](! #TorchOn) [Off](! #TorchOff) • 40 rad 20 dim. --Bullseye| [On](! #BullseyeOn) [Off](! #BulleyeOff) • 120 rad 60 dim --Lantern| [On](! #LanternOn) [Off](! #LanternOff) • 60 rad 30 dim --Darkvision| [Set](! #Darkvision) &nbsp; --Blind Sight| [Set](! #BlindSight) }} Orginal Macro that does work. /w GM &{template:npcaction} {{rname=Light Sources}} {{name=Select On or Off?}} {{description=[Torch ON](! #TorchOn) [Torch Off](! #TorchOff) • Light 40 radius with 20 dim light. [Bullseye ON](! #BullseyeOn) [Bullseye Off](! #BulleyeOff) • Light 120 radius with 60 dim light angle 45. [Lantern On](! #LanternOn) [Lantern Off](! #LanternOff) • Light 60 radius with 30 dim light angle 360. &nbsp;[Darkvision](! #Darkvision)[Blindsight](! #BlindSight)&nbsp; }} I used the [text](! #Macro) when building it.&nbsp; ! & # 13 ;
Dustin said: Thanks, team. I've got the color scheme figured out, but for some reason I am not getting the tokenid to generate within the Powercard. My output Macro !power {{ --tokenid|@{selected|token_id} --emote|@{selected|character_name} --name|Parry [[10+@{selected|parry}]] Dodge[[10+@{selected|dodge}]] }} What can I do to get the pic and emote name in the same format as the Powercard below? I removed the default italics formatting from emotes a long time ago, so that people can decide how to format their emotes. Use double backslashes // around any text you want to italicize. As for the picture... powercards doesn't do any formatting of pictures other than reducing their size to fit.
@Craven -- It works for me...
The buttons show up without being whispered too... are they not working for anyone else?
Not sure what is going on with everyone else... but my powercards with the buttons work in chat and in whispers.
1491661168

Edited 1491661197
I guess we just needed your magic touch as they are working now lol. I will test later if i remove the whisper if it will work.
Sky said: The buttons show up without being whispered too... are they not working for anyone else? Not working for me (3.4.0): !power --whisper| --name|[A](!) --[A](!)|[A](!)
1491669416

Edited 1491669505
Ya it stop working again. The button show up its when you click them they do nothing.
Craven . said: The button show up its when you click them they do nothing. Reopening a Collections Macro reverts HTML entities; if that Macro is then saved, those reversions are as well. Is it possible that this is the cause of your issue? Regardless, this should work: !power {{ --whisper|all --corners|10 --format|GM --name|Token Mod Lighting --leftsub|Set light sources --rightsub|Set Vision --Torch| [On](!&amp;#13;#TorchOn) [Off](!&amp;#13;#TorchOff) • 40 rad 20 dim. --Bullseye| [On](!&amp;#13;#BullseyeOn) [Off](!&amp;#13;#BulleyeOff) • 120 rad 60 dim --Lantern| [On](!&amp;#13;#LanternOn) [Off](!&amp;#13;#LanternOff) • 60 rad 30 dim --Darkvision| [Set](!&amp;#13;#Darkvision) &nbsp; --Blind Sight| [Set](!&amp;#13;#BlindSight) }}
If you have a ! mark in your macro, it won't work either. So you have the [Button](!#MacroName) it won't see the api command if you also have an exclamation mark in the macro itself.
Ah, figured out why they're working for me and not for anyone else. I made a change in my version and never put it out cause it was just me testing something else totally unrelated. Will look at it later tonight and put up an updated version.
Sky said: Ah, figured out why they're working for me and not for anyone else. I made a change in my version and never put it out cause it was just me testing something else totally unrelated. Funny how that works out... I have two requests regarding optimizing screen real estate: Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined. Introduce a reserved tag that controls the line-height of RowStyle. e.g. --lineheight|0.9em
yup that was it I went in and changed the name of the macro and saved it again. So i have the raw code saved in evernote and I can copy it back when needed.
1491743455

Edited 1491743584
Help. Trying to get the macro below to add roll to tracker with the selected character name. As you can see the below is showing my chat handle in the tracker not the selected token Indigo. I tried adding --charid|@{selected|character_name} but it doesn't work and even crashed the API once. Also it doesn't show a roll of the 3D dice on the screen. Thanks in advance Craven !power {{ --corners|10 --format|GM --name|**Initiative** --leftsub|**@{selected|character_name}** --rightsub|**@{Selected|npcd_dex_mod}** --Initiative|[[ [trkr] 1d20+@{Selected|npcd_dex_mod}]] }}
You had the token selected right?
1491747653

Edited 1491747907
Silvyre said: I have two requests regarding optimizing screen real estate: Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined. Introduce a reserved tag that controls the line-height of RowStyle. e.g. --lineheight|0.9em I got number one done, but messing with the line height only works so much because of how much it is used in all the various tidbits and how they're connected to each other... especially with using em units instead of px. &nbsp;There's a very limited range of sizes that look good with smaller sizes and they have to be defined as px, not em. Such as 11px for bodyfontsize and lineheight. There's also the issue with making the line-height too big and not increasing the font size. The inline roll background doesn't center with the text and I'm not sure how much work it would take to do that.
April 9th, 2017 ~ 10:30 am eastern Version: 3.4.1 Link: <a href="https://gist.github.com/Sky-Captain-13/452330a3d9" rel="nofollow">https://gist.github.com/Sky-Captain-13/452330a3d9</a>... Minor Update: If --name is not defined in the powercard, the title/background block will not be displayed. Bugfix: Command buttons now work in chat and not just whispers.
1491750675

Edited 1491750849
Sky said: Silvyre said: I have two requests regarding optimizing screen real estate: Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined. Introduce a reserved tag that controls the line-height of RowStyle. e.g. --lineheight|0.9em I got number one done, but messing with the line height only works so much because of how much it is used in all the various tidbits and how they're connected to each other... especially with using em units instead of px. &nbsp;There's a very limited range of sizes that look good with smaller sizes and they have to be defined as px, not em. Such as 11px for bodyfontsize and lineheight. There's also the issue with making the line-height too big and not increasing the font size. The inline roll background doesn't center with the text and I'm not sure how much work it would take to do that. Sky said: April 9th, 2017 ~ 10:30 am eastern Version: 3.4.1 Link: <a href="https://gist.github.com/Sky-Captain-13/452330a3d9" rel="nofollow">https://gist.github.com/Sky-Captain-13/452330a3d9</a>... Minor Update: If --name is not defined in the powercard, the title/background block will not be displayed. Bugfix: Command buttons now work in chat and not just whispers. Awesome, thanks!
Enjoying the miscellaneous upgrades I'm discovering! I noticed this, though:
Silvyre said: Enjoying the miscellaneous upgrades I'm discovering! I noticed this, though: Ah, didn't consider just one row. Will fix that later this afternoon.
Yes you can see by the output of the power card that I had indigo selected. How do I use the charid tag?
Craven . said: Help. Trying to get the macro below to add roll to tracker with the selected character name. As you can see the below is showing my chat handle in the tracker not the selected token Indigo. I tried adding --charid|@{selected|character_name} but it doesn't work and even crashed the API once. Also it doesn't show a roll of the 3D dice on the screen. It should be --charid|@{selected|character_id} instead of _name