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 2

GenKitty said: New Bug: [[2d4cf0cs100]] works as expected outside API, acting as the functional equivalent of [NH]. Inside powercards, however, it doesn't work as expected. It highlights 1 & 4 as if I never used a CF/CS. I don't really mind adjusting my macros, but it would be nice if I could use the same dice equations for my powercards that I do for their backup macros -- and I'm curious WHY it doesn't work. :> (Backup macros: Due to the flakiness of API at times, and to reduce the snark from GMs who think this script is 'a lot of work for a few numbers', I have backup macros for every powercard I have. Le Sigh.) It works for me, as expected. No highlighting. Version 2.4.5 of the dev server script (tested on both prod and dev servers).
1426295240

Edited 1426295382
Bugfix & Update: March 13th, 2015 ~ 9:00 pm eastern Version: 2.4.6 Script Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: XPND works with multi-dice rolls now, however... formatting on die rolls after the first is buggy. Will fix that later. Minor Update: PowerCards now shows version and update info with a timestamp on the API Output Console when it loads. Minor Update: Added the following inline formatting tags... ]_[ inserts a horizontal rule ~L aligns text left ( Example: ~L Left aligned text. ~L) ~C aligns text centrally ( Example: ~C Centered text. ~C) ~R aligns text right ( Example: ~R Right aligned text. ~R)
1426296992
Gen Kitty
Forum Champion
That's really really odd. I'll do another round of testing with it later.
Just installed 2.4.6, and it doesn't seem to work with the /talktomyself feature. This also affected 2.3.5 which I was running previously. !powercards don't output content when /talktomyself is enabled. Crit ranges are working now though, which is brilliant.
Pretty sure the talktomyself stuff doesn't work with any api script that outputs to chat.
1426333636
Gen Kitty
Forum Champion
HB is correct.
That's a shame. As GM, how do people test macros they don't want players to see before they actually 'encounter' it in game? Currently I'm regularly using the "Clear chat history" option.
1426415372

Edited 1426415766
Starting work on PowerCards 3 which will include helper functions like what roll templates have, despite my distaste for automation. :P No idea when it'll be ready. I'm having to re-write the core of the script so that crit, hit, miss info can be passed where needed and row colors are properly maintained. Would be easier if I had access to css classes and pseudo-classes though. :( PowerCards 2 is on the backburner now and I will only be doing bugfixes. One thing to note... you can avoid the formatting oddity of XPND'd rolls by putting [XPND] in front of each die roll inside the inline roll. This is probably the only way to completely fix that without creating a bigger mess in the script. [[ [XPND] 1d6 + [XPND] 1d6 + ((18/2)-5) ]] will work properly and show up as [ (4) + (1) + 4 = 9 ] and the (1) will not be oddly colored or sized. It looks like floor() and ceil() however is not supported and will crash the script. Which means you can't use this with any character sheets like the D&D 5e sheet that uses these in their auto-calc formulas.
Samuel Penn said: That's a shame. As GM, how do people test macros they don't want players to see before they actually 'encounter' it in game? Currently I'm regularly using the "Clear chat history" option. I just use clear chat history. I never use it anyway since the games I run or play in primarily use voice/video chat. You could also have a second campaign for just building/testing monsters, maps, and more and then transmogrify them into your actual campaign.
1426417316
Ziechael
Forum Champion
Sheet Author
API Scripter
I set up a 'DM Test Token' that i use as the 'selected' and 'target' for all my power cards when testing in the main campaign (to make sure i haven't broken anything between beta testing in my testing campaign and trying it in my main). Then i just announce in chat... DM TESTING COMMENCING for dramatic effect then do all my tests with the only spoilers being the lovely new layout or weapon choice but not the beastie wielding them. Naturally for dramatic effect i then announce DM TESTING COMPLETE! to highlight i'm done... then clear chat history... that way if they look at the full chat log at least they don't get confused with the random outputs ;)
Going to update the script with a bugfix for using XPND'd rolls with character sheets. Thanks to 'The Aaron', he pointed me towards a way to make floor() and ceil() work with XPND'd rolls. Tested it and it works great.
Ok... I lied... I have one last feature to include with PowerCards 2... TIMESTAMPS! What do ya think?
1426433796
vÍnce
Pro
Sheet Author
Have you added up the total amount of options you offer using PowerCards...? I'm starting to suffer from analysis paralysis because of you. Thanks a lot HB
1426435536
vÍnce
Pro
Sheet Author
Is there an API suggestion for allowing API/css access?
Eh, it just looks like a lot... but most of it boils down to: Flexible formatting Variable repeated rolls Timestamps (Soon!)™ Everything else is in Roll20 by default now. I've actually removed features as Roll20 has added stuff (crit ranges).
Vince said: Is there an API suggestion for allowing API/css access? Not that I know of. It would open up a lot of interesting stuff for me if I could define a stylesheet.
1426438196
Gen Kitty
Forum Champion
HoneyBadger said: Starting work on PowerCards 3 which will include helper functions like what roll templates have, despite my distaste for automation. :P No idea when it'll be ready. I'm having to re-write the core of the script so that crit, hit, miss info can be passed where needed and row colors are properly maintained. Try not to think of it as automation, but just the sorting of information, aimed at making more streamlined macros. I still view the hit/miss helper functions with a jaundiced eye; I see them as a trap if there's no way to retrieve the hidden information in the case of a forgotten bonus -- but I guess 'reroll' will be good enough for everyone's purposes. I'm wildly excited by the crit-helper, on the other hand. I look forward to seeing what you come up with for PC3.x!
Ziechael said: I set up a 'DM Test Token' that i use as the 'selected' and 'target' for all my power cards when testing in the main campaign (to make sure i haven't broken anything between beta testing in my testing campaign and trying it in my main). Then i just announce in chat... DM TESTING COMMENCING for dramatic effect then do all my tests with the only spoilers being the lovely new layout or weapon choice but not the beastie wielding them. Naturally for dramatic effect i then announce DM TESTING COMPLETE! to highlight i'm done... then clear chat history... that way if they look at the full chat log at least they don't get confused with the random outputs ;) I've had a number of creatures called 'Bob' and 'Alice' at various points, but sometimes spell and ability descriptions (or simply the fact that 'Bob' has rolled 75 on their attack roll) can give away information.
I will try to put the hidden info into a tooltip on the title of the card somehow. That way you can mouseover and see what it was.
noice! will help parsing chatlogs for specific sessions
1426445633
Gen Kitty
Forum Champion
*yays at HB* That would be rather nice, and might actually make me use such in the game I GM.
Bugfix & Update: March 15th, 2015 ~ 4:00 pm eastern Version: 2.4.7 Script Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: XPND will no longer crash when you use multiple dice in a roll and will not crash if a character sheet uses floor() or ceil() in an auto-calculated formula. You still will need to add [XPND] in front of each die in an inline roll to prevent formatting issues. Bad Usage: [[ [XPND] 1d6 + 1d6 ]] Good Usage: [[ [XPND] 1d6 + [XPND] 1d6 ]] Update: Added timestamps. Set USE_TIMESTAMPS to true to turn them on.
No issues?
1426489534
Gen Kitty
Forum Champion
*batbat* I haven't had a chance to test the new stuff, I had a game to GM today. Will be testing here in a bit!
1426490548

Edited 1426491733
Gen Kitty
Forum Champion
We're back to having 'undefined' showed up on the line before the card if you have no --emote| defined. Timestamps seem to be on by default, which is NOT what your update notes seem to indicate should be the case (and I think it should be off by default, but you might disagree and that's fine, but then the update notes should be very clear that it IS on by default). At this point, I think there's more than enough stuff to config for the base program that something like Aaron's 'program configurator' should be considered for the Powercards 3.x re-write, though more user-friendly than his :> His GroupInit script has a configurator that lets you set the global aspects of the program from within chat, but it's a touch clunky. This may prove to be a less intimidating method for new GMs coming to your program for the first time, and I think there WILL be more GMs coming to this as an alternative to roll-templates (but that may be overly wishful thinking on my part).
1426491671
Gen Kitty
Forum Champion
Expanded dice working for me, and my little test of NOT expanding the second die had it work anyway and not crash the server, so that's great. ~R and ~C not working at all, they just print ~R and ~C to the card. ]_[ works mostly as expected, the HR is a extremely subtle. Which values in this line should I tweak to make it a little thicker or darker? .replace(/\]\_\[/g,"<hr style='border: 0; height: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.3); margin-bottom: 3px; margin-top: 3px;'/>") [[1d2cf0cs3]] works as EXPECTED now, no idea why it didn't work before. (I use this as a non-powercarded [NH], for my damage dice) I think that's everything I needed to test out! As always, I adore you for all the hard work you put into this and how responsive you are to user requests.
1426508933

Edited 1426509193
GenKitty said: We're back to having 'undefined' showed up on the line before the card if you have no --emote| defined. Timestamps seem to be on by default, which is NOT what your update notes seem to indicate should be the case (and I think it should be off by default, but you might disagree and that's fine, but then the update notes should be very clear that it IS on by default). At this point, I think there's more than enough stuff to config for the base program that something like Aaron's 'program configurator' should be considered for the Powercards 3.x re-write, though more user-friendly than his :> His GroupInit script has a configurator that lets you set the global aspects of the program from within chat, but it's a touch clunky. This may prove to be a less intimidating method for new GMs coming to your program for the first time, and I think there WILL be more GMs coming to this as an alternative to roll-templates (but that may be overly wishful thinking on my part). i dropped mad money on a years worth of mentor when my Co-DM found this API. i have no doubt what so ever that if HB made setting up the powercards easier for the lowest common denominator... that we will see an influx of mentors. not to mention LFG games of better quality. i do have a question tho... if i rewrote a character sheet, would i still need mentor to embed powercards into the sheets rolls?
1426509445
Gen Kitty
Forum Champion
You'd need Mentor to use a custom character sheet, so the question is moot -- but yes, you would need Mentor for the API as well.
1426509639
The Aaron
Pro
API Scripter
GenKitty said: At this point, I think there's more than enough stuff to config for the base program that something like Aaron's 'program configurator' should be considered for the Powercards 3.x re-write, though more user-friendly than his :> His GroupInit script has a configurator that lets you set the global aspects of the program from within chat, but it's a touch clunky. This may prove to be a less intimidating method for new GMs coming to your program for the first time, and I think there WILL be more GMs coming to this as an alternative to roll-templates (but that may be overly wishful thinking on my part). Sad Panda! Yeah, that one is a bit confusing... now I really have to go work on it..
1426509801
The Aaron
Pro
API Scripter
GenKitty said: ]_[ works mostly as expected, the HR is a extremely subtle. Which values in this line should I tweak to make it a little thicker or darker? .replace(/\]\_\[/g,"<hr style='border: 0; height: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.3); margin-bottom: 3px; margin-top: 3px;'/>") The rgba()'s last value is the transparency. 0 is fully transparent, 1 is fully opaque. The first one is the black top line, which is 10% visible, the second is the white bottom line which is 30% transparent. If you bumped both those up by .3 or so, you'd probably get a much less subtle effect.
1426509906
The Aaron
Pro
API Scripter
GenKitty said: You'd need Mentor to use a custom character sheet, so the question is moot -- but yes, you would need Mentor for the API as well. Technically, I think you could setup the custom character sheet on a campaign and let your membership lapse, but still have the custom sheet, just no ability to modify it.
GenKitty said: Expanded dice working for me, and my little test of NOT expanding the second die had it work anyway and not crash the server, so that's great. ~R and ~C not working at all, they just print ~R and ~C to the card. ]_[ works mostly as expected, the HR is a extremely subtle. Which values in this line should I tweak to make it a little thicker or darker? .replace(/\]\_\[/g,"<hr style='border: 0; height: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.3); margin-bottom: 3px; margin-top: 3px;'/>") [[1d2cf0cs3]] works as EXPECTED now, no idea why it didn't work before. (I use this as a non-powercarded [NH], for my damage dice) I think that's everything I needed to test out! As always, I adore you for all the hard work you put into this and how responsive you are to user requests. Did you put ~R and ~C on both sides of the text to be aligned? It should look like this: !power --name|Alignment Test --!1|~C Attack ~C --Attack:|~R [[1d20]] | [[1d20]] ~R --!2|**Damage** (piercing): ~R [[1d6]] ~R Horizontal Rules: As Aaron said, you'll want to tweak the fourth value of the rgba setting to create a darker line. You could also increase the size of the border-top or border-bottom to create a really thick line. Regarding Configuration Options... I could always have the script create PowerCard Formats and PowerCard Config handouts so that GM's could just make their changes there and the script would reload those when the on:change event is triggered by saving the handouts.
GenKitty said: We're back to having 'undefined' showed up on the line before the card if you have no --emote| defined. Timestamps seem to be on by default, which is NOT what your update notes seem to indicate should be the case (and I think it should be off by default, but you might disagree and that's fine, but then the update notes should be very clear that it IS on by default). 1. Dammit... I didn't change anything regarding the logic behind which sendChat to use... so I have no idea why undefined is showing up again. >_< I'm gonna have to figure out a better way to deal with the whisper/emote logic to prevent this issue from cropping up again. 2. I'll turn them off by default. I had them on for testing and just didn't turn them off is all. 3. Ken L. asked for a feature that sorta mimics something character sheets/roll templates do and it's being added in a fashion... hiding tag and content with a tag option. In 2.4.8, you'll be able to use a roll query to add or remove a $ dollar sign in front of a tag to hide the tag and contents. For example, a 5e warlock with the Hex spell could add this to their Eldritch Blast macro: --?{Hit delete to show hex damage|$}Hex:|[[1d6]] necrotic damage
Bugfix & Update: March 16th, 2015 ~ 11:15 am eastern Version: 2.4.8 Script Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: The undefined emote bug crept back in again... it is fixed... again. Bugfix: Timestamps are turned off by default now. Set USE_TIMESTAMPS to true to turn them back on. Update: Added logic to show/hide the entire tag and contents of a tag by adding or removing a $ (dollar sign) in front of the tag. I am sure there are bugs that will arise from this... and will try to fix them quickly --?{Hit delete to show hex damage|$}Hex:|[[1d6]] necrotic damage The above tag would pop up a roll query to the player that asks them to hit delete to show the hex damage. Otherwise they can just hit enter and the powercard will completely ignore that tag and its content.
Here's my warlock's eldritch blast macro... !power --name|Eldritch Blast (Repelling) --title|Components: V, S ^^ Duration: Instantaneous ^^ Eldritch Blast creates additional beams at 5th, 11th, and 17th level. You can direct all the beams on the same target or at different ones. Make a separate attack roll for each beam. --leftsub|Standard Action --rightsub|Range 120 ft. --Attack:|[[ 1d20 + 4 [Cha Mod] + 2 [Proficiency] ]] | [[ 1d20 + 4 [Cha Mod] + 2 [Proficiency] ]] vs AC --Hit:|[[ [NH] 1d10 ]] force damage and the target is pushed up to ten feet away --?{Hit delete to show hex damage|$}Hex:|[[1d6]] necrotic damage --Critical Hit:| --!Crit1|^* **+** [[1d10]] force damage --?{Hit delete to show hex damage|$}!HexCrit|^* **+** [[1d6]] necrotic damage ... which look like this:
1426534597
Gen Kitty
Forum Champion
Just to be ultra-clear, your macro example is not using any kind of crit-helper? This is just your formatting layout? You and I have vastly different layouts :> I went back and retested, and you're right, I'd not encased the test text with the formatting for some reason. And my HR is suitably less subtle. ^_^
No, no crit helper. That's just how I do crit damage. It's there if I need it.
1426539525
Gen Kitty
Forum Champion
Feature Request: Some sort of charm to pull the ids of whoever triggers a card, to be used mainly in conjunction with API Command Buttons. I need root playerID (for OOC readychecks), but I can also see value in being able to grab whatever characterID the /as is set to player-side.
GenKitty said: You'd need Mentor to use a custom character sheet, so the question is moot -- but yes, you would need Mentor for the API as well. so if i built my own 5e sheet i couldnt share it unless they had mentor too? bummer... if I have already done the leg work is there really a need to make everyone reinvent the wheel to build a wagon? anyhoo back on topic, i have to make powercards for a few spells that can mutitarget, but the number of targets grow by spell level. could some one please give me a good example of how to do that, without having to click 11 targets when i only plan on using 4-5. i am not really understanding how to alter the target list and #of targets in the OP above.
1426548302

Edited 1426548977
Gen Kitty
Forum Champion
In order for the variable-number multiattack to work, you have to click on enough targets to fill the whole target list for the maximum number of targets, there's no way around that limitation. I generally pad out the target list with my own token. Let me see if I can help you out with understanding how the target list and # of targets works. !power --name|Bop! --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --!Bop#?{Number of targets|1} |%%token_name%% gets bopped on the nose! This is a simple proof of concept macro. It will ask you to select three targets, then ask how many you're actually targeting. If you're only targeting 1 or 2, use your own token to pad out the list. Once you have that macro working, we expand upon the concept, by adding more targets to the maximum number of targets. !power --name|Bop! --target_list|@{target|1st|token_id} | @{target|2nd|token_id}| @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} --!Bop#?{Number of targets|1} |%%token_name%% gets bopped on the nose! As you can see, the maximum target count has increased to six targets, denoted by adding 4th through 6th targeting instructions. I've bolded, in both examples, where the roll-query asking how many targets is located. I hope this helps you out. If not, ask more questions and I'll tackle it :> Addendum: Sometimes for a macro that could target lots and lots of targets, but likely won't , I make two versions: One for the full number of targets, and one for a lesser number. I still have to pad out the list, but padding out a list of 25 targets is more annoying than 5-6 targets.
1426550368

Edited 1426565896
GenKitty said: In order for the variable-number multiattack to work, you have to click on enough targets to fill the whole target list for the maximum number of targets, there's no way around that limitation. I generally pad out the target list with my own token. <SNIP> Addendum: Sometimes for a macro that could target lots and lots of targets, but likely won't , I make two versions: One for the full number of targets, and one for a lesser number. I still have to pad out the list, but padding out a list of 25 targets is more annoying than 5-6 targets. Thank you for the explanation, bummer about having to over click tokens tho ><, the idea of having a macro for a small number and one for max number of targets is a good one i will use that if u dont mind. using someone's (i thnk Aaron's) PCPP mod lets me at least input a variable amount of targets based on spell level. this help both new players and dnd vets in my campaign.
Sorry, I had an appointment yesterday in another part of the state to help determine whether the VA would perform total knee replacement surgery on both my knees, so I didn't see the HR questions. Yeah, I had the colors subtle for my HR simply because the (original) design was so I could subtly separate and organize charm reliant rolls. For me (and only me), I wanted to ensure they were organized, and nothing was taken away visually from the card itself - hence why I also had every roll aligned to the right, so no searching for information was done.
1426682608

Edited 1426682652
HoneyBadger said: Target Info Charms are almost done... trying to figure out a way to get them to show up as inline rolls as well, as a formatting option. Right now, they cannot. Will work on this later... goin' to bed now. Hi! Sorry to disturb your discussion, i don´t understand this language from macros/ power cards. But i use. Somebody can tell me how can i put in the macro the image and the text as the power card above? The image inside the circle and the text "Meri call uppon..."?
!power --charid|@{character_id} --emote|Your text goes here. --name|Emote Test --Text|Hello!
HoneyBadger said: !power --charid|@{character_id} --emote|Your text goes here. --name|Emote Test --Text|Hello! Ok, but what i put in "character_id"? The html adress from image?
1426684054
The Aaron
Pro
API Scripter
No, the image comes from a specific character. If you have the powercard as a token action for a character named Bob, it will show Bob's portrait picture. @{character_id} in a token action is equivalent to @{Bob|character_id} in the chat. It expands to the unique id for that character.
You can use a token's image if you replace --charid|@{character_id} with --tokenid|@{token_id}.
Sorry but i still don´t understand. See i´m just using this api´s, i don´t understand it kkkk What exactly i need to put in the @{character_id}? Will be the name of the character and the id code? So, if i have a character with the name Alex, and the id who i write in the chat is -JP0o8yCVTvGCFMchFpv i put @{Alex_-JP0o8yCVTvGCFMchFpv}?
You put --charid|@{character_id}. Just that. Not Alex or the -JP stuff. Just @{character_id}. When you hit the macro, it will get the information it needs and send it to the script.
Minor Update: March 18th, 2015 ~ 10:45 am eastern Version: 2.4.9 Script Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c %%who%% - Per yet another request from GenKitty, use this charm to add the player's display name to a powercard. Example: [Ready Check](!power --name|%%who%% is ready! --corners|0) If you just want to add this to your existing install, replace Line 48 with the following: var n = msg.content.replace("%%who%%", player_obj.get("displayname")).split(" --");