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 (Thread 2)

1428461570
Gen Kitty
Forum Champion
Alex P. said: GenKitty said: floor and ceil which do not play well with inline rolls. Any known workarounds for this? Find ways to make the automatic rounding work for you. This is a less than satisfactory answer for those dividing by dynamic numbers.
GenKitty said: This is a less than satisfactory answer for those dividing by dynamic numbers. Guess I'll just have to stop being lazy and do some basic math myself.
1428467498

Edited 1428469163
The Aaron
Pro
API Scripter
@Bruticus: <a href="https://github.com/shdwjk/Roll20API/blob/master/PCPP/PCPP.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/PCPP/PCPP.js</a> (Now with GenSAS: the GenKitty Software Announce System! =D)
The Aaron said: @Bruticus: <a href="https://github.com/shdwjk/Roll20API/blob/master/PCPP/PCPP.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/PCPP/PCPP.js</a> (Now with GenSAS: the GenKitty Software Announce System! =D) i disabled the original pcpp i had, and put the script from the link above in a new section. the {{ }} formating works now thank you.
1428473587
Gen Kitty
Forum Champion
The Aaron said: (Now with GenSAS: the GenKitty Software Announce System! =D) I'll sass you plenty, Aaron :&gt;
How can one not want to derail the thread? Hell, I derailed it from the first reply.
Hrm... timestamps on the dev server... lol. Leaving for work now, so I have no idea how well PowerCards2 plays with the dev server updates. Will check in the morning of others don't first.
HeBadger, Master of the Universe, He who has the Power(cards)! were you able to find a solution to the formulas with floor( and ciel( in them not working? i noticed a post somewhere from Mr. R saying they are working on a way to clean up mouseovers on the dev-side Soon(tm). and now that i have the "mentor" and access to the Dev-side, this time around i can help break your scri.... err i ment bug hunt... yup bug hunt, lets go with that.
1428637214
vÍnce
Pro
Sheet Author
First roll templates, basic chat markdown formatting, and now time stamps and nested inline rolls... I think we have a mole amongst us.
Vince said: First roll templates, basic chat markdown formatting, and now time stamps and nested inline rolls... I think we have a mole amongst us. brb going to petsmart to get some "His and Hers" mole viagra in the hopes the moles in this thread rapidly reproduce... but is it surprising? of all the API's roll 20 has this is ALWAYS at the top of the forum, and i bet it is the most used of all the API's. the user-to-API-developer communication is strong here, and most of the vocal forum community visits here if not post... Gen kitty, Honey Badger, you Vince, the Scriptomancer and more... Not to mention when new and innovative features the Roll 20 Dev's produce hit Dev-side-servers... this forum thread user group makes a habit of breaking everything down, and pushing boundaries i bet the devs didnt even know they could breach. in short... Powercards API thread leads the way!
i copied my PC and PCPP api scripts to the dev, is there anything els ei need to do to enable them there? PCards is not working for me at all even with my macros copied from Prod. servers.
1428664915
Gen Kitty
Forum Champion
You're going to need to give us more than 'not working'. What happens when you try to use a macro?
Bruticus said: HeBadger, Master of the Universe, He who has the Power(cards)! were you able to find a solution to the formulas with floor( and ciel( in them not working? i noticed a post somewhere from Mr. R saying they are working on a way to clean up mouseovers on the dev-side Soon(tm). and now that i have the "mentor" and access to the Dev-side, this time around i can help break your scri.... err i ment bug hunt... yup bug hunt, lets go with that. I'm still not entirely sure what problem you're having. Powercards work with ceil/floor just fine.
1428666359

Edited 1428667176
Just fyi everyone... PowerCards does not play well with some change Riley is doing on the dev server. edit - Nevermind, after a bit of testing, it appears that putting comments in an inline roll is causing one such issue. For example [[1d20 [Comment] ]] will work, but [[1d20 [Comment]]] will not. Probably has something to do with regex and spacing. So if you're using comments in your rolls, make sure you put a space after the comment and before you close out the inline roll.
Vince said: First roll templates, basic chat markdown formatting, and now time stamps and nested inline rolls... I think we have a mole amongst us. Heh. I need to find some motivation to work on PC3 soon. Gotta get the helpers added. &gt;_&lt; Just keep getting distracted with my D&D 4e campaign I'm working on. Friends want to switch to 4e from 5e.
1428669269

Edited 1428669354
HoneyBadger said: Vince said: First roll templates, basic chat markdown formatting, and now time stamps and nested inline rolls... I think we have a mole amongst us. Heh. I need to find some motivation to work on PC3 soon. Gotta get the helpers added. &gt;_&lt; Just keep getting distracted with my D&D 4e campaign I'm working on. Friends want to switch to 4e from 5e. Derail incoming... I enjoy 5e immensely. I can't compare to 4e because I simply didn't play much, but my group switched from Pathfinder to 5e and I am happy as can be. Bounded accuracy, large elimination of wonky character builds (though don't get me wrong there are some power builds that can be wonky as well), but all in all enjoying the switch. Converting old content is not hard at all if that is a concern (at least from Pathfinder it was easy, converted Rise of the Runelords chapter 5 and 6). Edit: Just so I am not too far off topic... there is a lot of great Roll20 support for 5e as well, between the sheet(s) and statblock parsers, makes GM setup time a breeze!
Plenty of 4e support too. I actually wrote the importers for characters and monsters. I haven't kept up to date on them however. Will prolly need to do that at some point.
1428671137
Gen Kitty
Forum Champion
4e brings its own quirks for making macros. Only in 4e do I need variable multi-attack macros with regularity, because in 3.5/PF/5e AoEs tend to force saves... which 4e doesn't have. Only firearms in Pathfinder have me needing the same. As far as motivation to work on Powercards 3... Pride/Ego? Keeping ahead of the curve? Being able to say, "Yeah, my script does all that AND this other stuff too" ? :)
1428690926

Edited 1428691005
GenKitty said: You're going to need to give us more than 'not working'. What happens when you try to use a macro? never mind i found the problem i think, disabling PCPP and its formatting "[=[ [#[" fixed powercards not going past the "click target" phase...(but broke my multi-target spells T.T), as well as fixing the [Label]]] to [Label] ]] formatting helped... i also think Mr R's 23 | [17] fix might have helped too.
is there a Powercard PreProcessor API forum? i couldnt locate one by search.
1428778457
The Aaron
Pro
API Scripter
There isn't. What do you want to know about it?
1428784240

Edited 1428784573
discussion about how pcpp will work with the features being tested on dev right now, but i guess we can take it to a different forum. right now im having to disable the pcpp so powercards will work on dev, specifically **vs AC [=[@{target|ac}]=]**
HoneyBadger said: Heh. I need to find some motivation to work on PC3 soon. Gotta get the helpers added. &gt;_&lt; Just keep getting distracted with my D&D 4e campaign I'm working on. Friends want to switch to 4e from 5e. this is hands down one of the most anticipated features of PCv3 for me, i am really looking forward to tuning my attack macros to take advantage of them, i was wondering tho, would it be possible using the crit success options to be included in a single inline roll? something to go from this when crit rolls true: [27] | [17] vs AC [16] for [12] slashing ( on crit [9]) to this: [27] | [17] vs AC [16] for [21] slashing
1428885283

Edited 1428885327
That might be possible. Not sure if it really should be added though... since some creatures can be immune to crit.
1428910747

Edited 1428910815
Gen Kitty
Forum Champion
Bruticus, you need to remember we're not all playing 5e :&gt; Pathfinder, and 3.5&before need Powercards to support the 'reroll to confirm crit' system, and few GMs make the AC of the creature available for macros so a crit-helper has to be separate from a hit/miss helper. The easiest way to do that is simply having another line show if the natural die roll was BLAH and let the GM decide if it really was a crit or not, and do his/her own math for final total damage. This is once place variables would come in very handy, being able to retain previous roll results and show them on other lines.
GenKitty said: Bruticus, you need to remember we're not all playing 5e :&gt; Pathfinder, and 3.5&before need Powercards to support the 'reroll to confirm crit' system, and few GMs make the AC of the creature available for macros so a crit-helper has to be separate from a hit/miss helper. The easiest way to do that is simply having another line show if the natural die roll was BLAH and let the GM decide if it really was a crit or not, and do his/her own math for final total damage. This is once place variables would come in very handy, being able to retain previous roll results and show them on other lines. i agree, the more options available, and the more systems PC can work for is def the way to go (hell some systems don't even use d20's). I would never expect PC to favor one system over another, I was just asking if a "is crit?" check might be able to be used within an inline roll to add variables, if it could be used in the attack roll to see if it was a crit, confirm it, double check it... or in the damage section to add additional math, depending on the DM's/Player's needs. i do believe forced automation is a bad thing as it removes freedom of use, but at the same time, allowing automation by design is a good thing, placing the amount of automation used into the DM and Players hands is the best approach in my opinion. (Me personally, i use automation where i can to speed up combat resolution, to get back to the roleplay. that is why i tie handouts to abilities and spells in the powercard header. decreasing overall rule "lookup this/that" is what i aim for to prevent combat lull/drag.)
If I use the reroll once option (such as [[d20ro&lt;1]]) it no longer highlights a 1 or a 20. Is there a way to make this happen automatically without adding the cs&gt;20 and cf&lt;1.
Thomas C. said: If I use the reroll once option (such as [[d20ro&lt;1]]) it no longer highlights a 1 or a 20. Is there a way to make this happen automatically without adding the cs&gt;20 and cf&lt;1. Yup. Will post a bugfix here shortly.
1429157505

Edited 1429157623
April 16th, 2015 ~ 12:10 am eastern Version: 2.4.12 Bugfix: Added code to highlight dice rolls using the re-roll once roll option (1d20ro&lt;1 for example). The same issue exists for penetrating and compounding rolls. Not really sure to handle those however, since the highlight really doesn't matter as much.
1429178006
Gen Kitty
Forum Champion
I need help making a new macro, and I don't know how to go about it. I do have a workaround if I can't make this work. One of my characters just received a magical weapon that allows for me to forgo rolling and choose to proceed as if I had rolled a 10. Is there a way to do this with existing powercard code? If not, I'll just make another macro, but I thought I would ask.
Hrm. You could make two lines with roll queries using the hide tag/content modifier ($) to pick which one to use or a single roll query with 1d20 for the roll, which you could replace with a 10 when you want to use that instead, but no... there's no way to decide on the fly without using a roll query.
1429180655
Gen Kitty
Forum Champion
Ah ha. The roll query method will work PERFECTLY. I should have thought of it myself. x.x
You were just trying to get another feature added, lol. :D
1429187793
Gen Kitty
Forum Champion
Nay! I wish for all your attention to be focused on adding hit/miss/crit helpers to PC3.0! I wouldn't dare distract you from that vital quest! :&gt;
GenKitty said: Nay! I wish for all your attention to be focused on adding hit/miss/crit helpers to PC3.0! I wouldn't dare distract you from that vital quest! :&gt; seconded!
1429277300

Edited 1429277336
Thank you HoneyBadger for the d20ro&lt;1 fix! So fast as always!
I have ran into a odd problem, i'm setting up some macros for a shadowrun 5e game and i made a test campaign on the dev sever so i could play around and test them out, i got it an initiative test to work and recreated it in our game on the main servers but as soon as I used it power cards died a horrible screaming death. the error i get is this "Could not determine result type of: [{"type":"M","expr":"floor(0/3)+floor(0/3)"},{"type":"C","text":" Results: ( 2 + 3 + 3) + 6 + 5 - = 8\" class=\"a inlinerollresult showtip tipsy\"&gt;8 "}]" the floor (0/3 etc comes from my wounds modifier macro that i have nested inside my initiative macro. any thoughts on why it works on dev and not normal severs ? oh the macro itself looks like this !power --format|gray --name|Initiative --title| Initiative --leftsub|PC --rightsub|@{selected|token_name} --@{selected|token_name}| rolls a [[@{selected|initiativedice}d6 + @{selected|reaction} + @{selected|Intuition} - #woundmod &{tracker} ]] for Initiative. if I remove the #woundmod it works just fine on normal severs.
1429803048
Wes
Sheet Author
That's a "Nested" inline roll, they will be coming to the production servers soon, as they are currently in testing on the Dev server.
1429803157

Edited 1429805356
yeah, i just sort of figured that out, any idea how i can replace the #woundmod with this floor(@{selected|physical}/@{selected|paintolerance}) + floor(@{selected|stun}/@{selected|paintolerance}) .. however i try to write it it hates me. edit: nevermind, just made my group move to the dev server ;)
1429811529

Edited 1429811717
So I have ran into a bit of a bug here with the horizontal rule: after one is used in macro, only the very next roll will be 'properly rolled', and the rest will be displayed with the result, but as if it had not been rolled: plain text, no tooltip, etc. The only way to get one to roll again is to insert another horizontal rule, which will again, only roll the next inline roll following the rule. This wouldn't be so problematic, but it wreaks havoc with repeated lines, where only the first value is generated each time, and then following rolls display the same result for each repeat. Here is an example of what I mean: This: !power {{ --name|Attack --first tag|here will be a horizontal rule, and the problem comes when i use rolls after the rule ]_[ --second tag|[[1d20]] [[1d20]] [[1d20]] ^^ as you can see, only the first inline roll is displayed as such, the rest just as numbers ]_[ --third tag#8|[[1d20]] [[1d20]] [[1d20]] ^^ and this becomes especially problematic now with repeated rolls, as it just continues with the first value generated --fourth tag|[[1d20]] [[1d20]] [[1d20]] ^^ and if you continue to omit a horizontal rule, you won't get the correct rolling back, no matter what else you do }} generates this: Edit: Though I forgot to show it in my example, you can use as many inline rolls as you want before a horizontal rule shows up and it works fine. The horizontal rule only starts breaking things AFTER it. So yeah. Not anything that can't be worked around with formatting, but I imagine this is an unintended side effect (and it does limit the way I'd like to exploit this script :) ). And for reference, I did make sure I'm running the latest version before posting this. Thanks!
1429817295
The Aaron
Pro
API Scripter
Looks like a conflict with the inline rolls syntax. Are you on Dev or Prod? I'm betting you're on Dev. I'll try this out tonight when I get home and see if I can find the reason. Probably it is happening before API is invoked, likely as a result of the new dice parsing engine on Dev.
I am indeed on the Dev server. Thanks so much!
Intriguing. Yeah, this is definitely limited only to Dev, as Production works as intended. By far, the easiest method to fix this for you, is to modify line 348 from this: .replace(/\]\_\[/g, "&lt;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;'/&gt;" To something like this: .replace(/\~\_/g, "&lt;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;'/&gt;") Ultimately, that will simply mean that instead of using ]_[ for a horizontal rule, you would use ~_.
1429830841

Edited 1429834272
On the other hand, you could also change it to: .replace(/\[\_\]/g, "&lt;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;'/&gt;" Doing that would change it to [_]. I ended up changing mine to the following which still portrays the concept of a horizontal rule to me: .replace(/\=\=/g, "&lt;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;'/&gt;" Edit: Removed the _ suggestion because it then turned around and broke anytime you used an underscore for anything...
1429835833
The Aaron
Pro
API Scripter
Great, I won't bother checking it out then. =D I'd probably use ==== for the rule, but it's all personal preference. =D
I thought about how long it needed to be. I tested it with just == to make sure it wouldn't have some sort of ill-effect on the script itself, but nothing arose. I was positive = would be too short, and just ran with == instead. I'm not sure why ]_[ was wreaking havoc on the Dev server, but there is no doubt it was.
I will post an update in the morning when I get home from work and change the HR rule to === so as to avoid any further issues with nested inline rolls.
Rock on.
Hrm, I should prolly do ~~~ instead of === since that one is used in javascript.