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)

March 06 (7 years ago)

Edited March 06 (7 years ago)

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.
March 06 (7 years ago)
Thanks for the help guys! Much appreciated.
March 21 (7 years ago)
March 21st, 2017 ~ 8:45 am eastern
  • Version: 3.4.0
  • Link: https://gist.github.com/Sky-Captain-13/452330a3d9...
  • 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 < @{target||npc_ac} ?? !Missed|**You missed!**
--?? $Atk >= @{target||npc_ac} ?? soundfx1|_play|ArrowHits
--?? $Atk >= @{target||npc_ac} AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 1d8+3]] piercing damage
--?? $Atk >= @{target||npc_ac} AND $Atk.base <> 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
}}
March 21 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

SkyCaptainXIII said:

  • Much like the soundfx option.
I wish mine would work... :'(
#passivedepressivecryforhelp
March 21 (7 years ago)

Edited March 21 (7 years ago)

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.
March 21 (7 years ago)
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:()=>'API'}).get('_displayname');
March 21 (7 years ago)
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.
March 23 (7 years ago)
Cool updates!
April 05 (7 years ago)
JB, any way to apply this API image to chat script with power cards?

https://app.roll20.net/forum/post/590539/slug%7D
April 05 (7 years ago)
Putting images in chat is in by default now. [alttext](http://i.imgur.com/BsEMCPm.png)
April 05 (7 years ago)
What about within PowerCards?
April 05 (7 years ago)
Doesn't seem to work.You can put it at the top of the macro though to show up first.
April 05 (7 years ago)

Edited April 05 (7 years ago)
Is there a way to remove the Display Name tag when you use: [alttext](http://i.imgur.com/BsEMCPm.png)

April 05 (7 years ago)
Nope.
April 05 (7 years ago)
Thanks for checking...
April 06 (7 years ago)
New to power cards is the a doc to help me learn the template?
Master ML that is a really nice token.
April 06 (7 years ago)

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.
April 07 (7 years ago)

Edited April 07 (7 years ago)
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)
•  Sets Token to a status using token mods. **Status** Blind, Charmed, Deafened, Frightened, Grappled, Invisibility, Paralyzed, Petrified, Poisoned, Prone, Restrained, Stunned, Unconscious and Dead. 
 [Player Stats](!
#GM:StatsPC) 
•  Show important stats of a Player.
[Monster Stats](!
#GM:StatsMonster)
•  Show important stats of a Monster.
[New Toon Fixed](!
#Starting-Stats) 
•  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) 
•  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)
•  Take you to a weather site for random weather.
[5e OGL API Status](!
#API5eStatus )
• Stats of the 5e OGL API
}} 


April 07 (7 years ago)
You would still have to use the buttons.
April 07 (7 years ago)

Sky said:

You would still have to use the buttons.

Would the be pink? Can we change the color?
April 07 (7 years ago)
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|,  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).
April 07 (7 years ago)

Sky said:

You would still have to use the buttons.

So how do I add button to the powercards?
April 07 (7 years ago)

Dustin said:

I assume I need to place the command in between !power {{ and --name|,  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.
April 07 (7 years ago)

Edited April 07 (7 years ago)

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.
April 07 (7 years ago)
Players can also customize every individual powercard's color if they want with the use of tags like --txcolor, --bgcolor, etc.
April 07 (7 years ago)

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.
April 08 (7 years ago)

Edited April 08 (7 years ago)
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?
April 08 (7 years ago)

Edited April 08 (7 years ago)
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)  
--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.
 [Darkvision](!
#Darkvision)[Blindsight](!
#BlindSight)  }} 
I used the [text](! #Macro) when building it.  ! & # 13 ;



April 08 (7 years ago)

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.
April 08 (7 years ago)
@Craven -- It works for me...

April 08 (7 years ago)
The buttons show up without being whispered too... are they not working for anyone else?

April 08 (7 years ago)
Not sure what is going on with everyone else... but my powercards with the buttons work in chat and in whispers.
April 08 (7 years ago)

Edited April 08 (7 years ago)
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.
April 08 (7 years ago)

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](!)
April 08 (7 years ago)

Edited April 08 (7 years ago)
Ya it stop working again.
The button show up its when you click them they do nothing.

April 08 (7 years ago)

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](!&#13;#TorchOn) [Off](!&#13;#TorchOff) 
• 40 rad 20 dim.
--Bullseye| [On](!&#13;#BullseyeOn) [Off](!&#13;#BulleyeOff)
• 120 rad 60 dim
--Lantern| [On](!&#13;#LanternOn) [Off](!&#13;#LanternOff)
• 60 rad 30 dim
--Darkvision| [Set](!&#13;#Darkvision)  
--Blind Sight| [Set](!&#13;#BlindSight)
}}
April 08 (7 years ago)
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.
April 08 (7 years ago)
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.
April 09 (7 years ago)

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:
  1. Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined.
  2. Introduce a reserved tag that controls the line-height of RowStyle. e.g. --lineheight|0.9em
April 09 (7 years ago)
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.
April 09 (7 years ago)

Edited April 09 (7 years ago)
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}]]

}}



April 09 (7 years ago)
You had the token selected right?
April 09 (7 years ago)

Edited April 09 (7 years ago)

Silvyre said:

I have two requests regarding optimizing screen real estate:
  1. Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined.
  2. 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.  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 09 (7 years ago)
April 9th, 2017 ~ 10:30 am eastern
April 09 (7 years ago)

Edited April 09 (7 years ago)

Sky said:

Silvyre said:

I have two requests regarding optimizing screen real estate:
  1. Introduce a way to hide the titlebox. e.g. if --name| is null and/or undefined.
  2. 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.  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

Awesome, thanks!
April 09 (7 years ago)
Enjoying the miscellaneous upgrades I'm discovering!

I noticed this, though:

April 09 (7 years ago)

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.
April 09 (7 years ago)
Yes you can see by the output of the power card that I had indigo selected. How do I use the charid tag?
April 09 (7 years ago)

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