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 3)

I tested it out (disabling HB's, of course), and it now shows the "--emote|" line like it did before this update. Thanks, TheAaron
1437795946
The Aaron
Pro
API Scripter
Nyghtmare said: (don't tell TheAaron I said that — he tends to get jealous lol), And I'm not even gonna get jealous about it!  =D
The Aaron said: Nyghtmare said: (don't tell TheAaron I said that — he tends to get jealous lol), And I'm not even gonna get jealous about it!  =D I was wondering if you would ever respond to that... *lol*
1437797326
The Aaron
Pro
API Scripter
Just waiting for the opportune moment. =D 
1437799943

Edited 1437799957
vÍnce
Pro
Sheet Author
Aaron's explanation has made me hungry.
Something made me sleepy. It is probably the fact that my alarm went off at 4:30am today, like it does every weekday, but I am still gonna blame TheArron anyways... ;)
Lake / James said: Just loaded this script up and am having an issue getting the defenses to show for a multiple target attack power. Specifically, the Scorching Burst example listed in HB's post. The defense attribute is called "ref" instead of "Reflex" and I tried using that, but it just spits out a list of what attributes are supposed to be added together, not the numbers and not adding anything together. These are the two different outputs I get, the first using "ref" and the second using "Reflex" (ignore the quicksilver motion block). The errors that appear in the API output console for the second one are beneath the image. "Error: No attribute or sheet field found for character_id -Jk9u2J9_ONGc30joq2- named Reflex" "Error: No attribute or sheet field found for character_id -JkTvdxthkejBUeOVSK3 named Reflex" "Error: No attribute or sheet field found for character_id -JkTvhFh4uzA4ciD-Sth named Reflex" Anyone able to come up with what I'm doing wrong here? Or if there even is a way to fix this?
@Lake / James, I don't know. I just tried and it worked for me. What character sheet are you using?
1437941889

Edited 1437942145
Using the normal DnD 4e sheet. I tried it in both of my 4e games, and it does the same thing in both. Edit - Just to clarify, it only breaks with the multi-target usages, and only when the targets "defense" is a calculated attribute.
1437946526
The Aaron
Pro
API Scripter
Update on line 63.  This should fix all inline roll problems ( floor() and ceiling() were still broken): msg.content = msg.content.replace("$[[" + Count + "]]", ("[[" + msg.inlinerolls[Count].expression + " ]]").replace(/\[\[\[/g, "[[ ["));
What happens if you put @{charactername|ref} into chat?
HoneyBadger said: What happens if you put @{charactername|ref} into chat? It gives me this. 10+floor(5/2)+floor((21-10)/2)+0+0+0+1+1+0
July 27th, 2015 ~ 8:15 am eastern Version: 3.2.9 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: Line 63 updated with TheAaron's latest fix for floor() and ceil() issues. Bugfix: Corrected default Roll20 emote display error, where it would clip the first word from the emote.
Lake / James said: Using the normal DnD 4e sheet. I tried it in both of my 4e games, and it does the same thing in both. Edit - Just to clarify, it only breaks with the multi-target usages, and only when the targets "defense" is a calculated attribute. Durr... I totally forgot that token info charms do not work with calculated character sheet attributes. You could create different named attributes on the character sheet and put [[@{ref}]] in that attribute. That would allow you to use multi-target attacks and pull the proper numbers. Or you could get whomever made the D&D 4e sheet you're using to put the calculated attribute into an inline roll in the sheet itself. I think that might work. I dunno.
HoneyBadger said: Lake / James said: Using the normal DnD 4e sheet. I tried it in both of my 4e games, and it does the same thing in both. Edit - Just to clarify, it only breaks with the multi-target usages, and only when the targets "defense" is a calculated attribute. Durr... I totally forgot that token info charms do not work with calculated character sheet attributes. You could create different named attributes on the character sheet and put [[@{ref}]] in that attribute. That would allow you to use multi-target attacks and pull the proper numbers. Or you could get whomever made the D&D 4e sheet you're using to put the calculated attribute into an inline roll in the sheet itself. I think that might work. I dunno. Nope, that just does the same thing. It's just weird to me that it works just fine for single target, but not for the multi target.
1438011043
Gen Kitty
Forum Champion
Single target and variable target use different parts of the program, so it makes perfect sense to me that the Charms don't handle calculated attributes.
The problem is that auto-calculated attributes like @{ref} turn into this when PowerCards sees it ... @{ref-ten}+@{ref-ability}+@{ref-armor}+@{ref-class}+@{ref-feat}+@{ref-enh}+@{ref-misc}+@{ref-misc2} ... which is not helpful at all. I've been trying to make it work, but each attempt messes up token charms or requires special formatting, which I've been trying to get away from. I'll keep poking away at this though.
Hi, Just catching up with months of changes. If I understand correctly, to use&nbsp; <a href="https://app.roll20.net/forum/post/1187040/script-s" rel="nofollow">https://app.roll20.net/forum/post/1187040/script-s</a>... the only change I need to do is to change lines like "--text1|^* some text" to "--^* some text", correct? Or am I missing something else? Cheers, Leo
Leo said: Hi, Just catching up with months of changes. If I understand correctly, to use&nbsp; <a href="https://app.roll20.net/forum/post/1187040/script-s" rel="nofollow">https://app.roll20.net/forum/post/1187040/script-s</a>... the only change I need to do is to change lines like "--text1|^* some text" to "--^* some text", correct? Or am I missing something else? Cheers, Leo What are you trying to do? If you're wanting just text with the first line indented, hide the tag with an exclamation mark --!tag 1|^*Text
1438099822

Edited 1438100139
Yes, even after copying the character, I'm still getting no picture and that weird&nbsp;FMyFJ after the title. -Nevermind, 3.2.9 fixed it. &nbsp;Thanks! Marko
1438191806
DK Heinrich
Marketplace Creator
Sheet Author
Is there an adjustment that I can make to the script to have the powercard (emote and avatar included) spread out further to the left, so that its even with the chat entry box? see blue line below...
1438193240
The Aaron
Pro
API Scripter
You can add "margin-left: -45px;" strategically throughout the script: Line 237 and 238 should handle the emote, line 242 should handle the powercard.
1438193564

Edited 1438194331
DK Heinrich
Marketplace Creator
Sheet Author
242 is showing a "margin-left: -10px" &nbsp;guessing I just adjust that to -45? Edit: Ok, -45 takes it all the way to the slide bar (max width), if you do -25 on line 237 & 238, and -35 on line 242 (the -25+-10 already in) they both line up with the chat entry box... or as close to it as I care to get.&nbsp; Thanks!! (the little bit of extra makes the majority of my x vs. y output stay on one line without having to resize the chat window.... its the little things in life)
1438194044
The Aaron
Pro
API Scripter
=D no worries!
1438201958

Edited 1438255692
If you turn off chat avatars, it collapses that gap. If you adjust it left with chat avatars and someone turns off chat avatars, it goes even more to the left and gets cut off.
I don't suppose there's a cap on conditionals in a single macro or anything is there? I have one that is 90% conditionals (~160 lines or so) and every once in a while it likes to just randomly throw the wrong answer, and no matter what I do I can't figure out why. The reason for the absurd size is basically it's the rogues primary shot. Manyshot has Sneak Attack and Spliting. I put up the macro in its entirety on github here <a href="https://gist.github.com/Mythrarin/5f6d1a9cea0fd8916537" rel="nofollow">https://gist.github.com/Mythrarin/5f6d1a9cea0fd8916537</a> Figured it'd be faster than trying to describe/explain it. Although, the reason I use "&gt; 18" rather than "&gt;= 19" is that it seems to work properly more often than the latter. Example issues are: This also happens periodically in the main attack line, but I couldn't find any examples from the other nights game. And it's not just this lone macro, although due to it's size it often comes out as the main attention. I'll have melee crits that don't double, or other such incidents elsewhere. Of course I would just like to clarify one thing. This issue seems to happen just enough for me and my players to notice. Almost all of the time it works perfectly, except when it doesn't those 5-10 times a night. (Across macros rolled by 6 players for ~5 hours. That's a good average.) Just figured I'd stick my head in and mention something.
o_0
1438259107
DK Heinrich
Marketplace Creator
Sheet Author
HoneyBadger said: If you turn off chat avatars, it collapses that gap. If you adjust it left with chat avatars and someone turns off chat avatars, it goes even more to the left and gets cut off. ok, thanks HB - I will make sure my players leave avatars on since I like the slightly wider format
July 31st, 2015 ~ 8:45 pm eastern Version: 3.2.10 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Bugfix: Passing a message to PowerCard.Process does not require a player object any longer and will not crash the script without one. What this allows you to do is write a script for whatever you want and send a message to PowerCard.Process (formatted like a powercard macro) and display it in chat. If you have questions about this and what you can do with it, just ask in the thread.
Awesome, I've been intending to do a few things like this for my game. Out of curiosity, will we be seeing 3D dice intergration any time soon?
1438396424

Edited 1438396458
Calhanol said: Awesome, I've been intending to do a few things like this for my game. Out of curiosity, will we be seeing 3D dice intergration any time soon? Doh, I forgot about that. Should be simply enough to add. Just need to add a reserved tag like --3D|true that defaults to false. Been doing a lot of planning for my wedding/reception and haven't had much time for scripting lately.
Pffft. Weddings are overrated. Receptions are where it's at. Of course, if my wife of 16 years read this, she would skin certain parts of my anatomy. This would be uncomfortable.
SeanOG said: Pffft. Weddings are overrated. Receptions are where it's at. Of course, if my wife of 16 years read this, she would skin certain parts of my anatomy. This would be uncomfortable. Heh, if my soon to be mother-in-law doesn't stop putting her nose where it doesn't belong, my fiancee is going to drag me to the court house, we'll have a small ceremony with the guy who introduced us and his wife and be done with it. And it won't be because I'm the one pissed off. She keeps ticking off my fiancee. 0_o On topic... I tried adding 3D dice support and it simply doesn't work. I don't know how to make it work either. Will keep trying though.
Is there a way to display use the value of a named roll in inline rolls further down? I don't want the players to see the rolls themselves, just the final result of the roll. With the -hroll feature i think I can do this but how to I use the $ID value in inline rolls later on?
Nate W. said: Is there a way to display use the value of a named roll in inline rolls further down? I don't want the players to see the rolls themselves, just the final result of the roll. With the -hroll feature i think I can do this but how to I use the $ID value in inline rolls later on? You can't yet. I'm slowly working on that.
1438542197

Edited 1438542275
Gen Kitty
Forum Champion
Disregard, API had crashed for some stupid reason :P
1438605183
DK Heinrich
Marketplace Creator
Sheet Author
ok, HB - I am slow and not sure what it is that your update does. would you be so kind as to toss out an example for the novice scripters :)
DK Heinrich said: ok, HB - I am slow and not sure what it is that your update does. would you be so kind as to toss out an example for the novice scripters :) It prevents the script from crashing if you send information to PowerCard.Process from another script without sending the player object. For example, the It'sATrap script can now be modified to output a powercard without crashing powercards. var TrapMsg = {}; var TrapMsg.who = (get name of token that triggered trap) var TrapMsg.content = "!power --name|Spear Trap --Attack:|[[1d20]] vs AC --Hit:|[[2d8]] damage"; PowerCard.Process(TrapMsg);
1438634410

Edited 1438634425
Also, PowerCards still remains incompatible with the current implementation of 3D dice and will remain that way until something else changes.
1438641091
DK Heinrich
Marketplace Creator
Sheet Author
ok, thanks - I think that helps. I will try it out soon and see what I can do with it.&nbsp;
1438641679
vÍnce
Pro
Sheet Author
HoneyBadger said: Also, PowerCards still remains incompatible with the current implementation of 3D dice and will remain that way until something else changes. That sucks. &nbsp;I think the dice have come a long way and I would like to use powercards and 3d dice. &nbsp;Bummer
1439337125

Edited 1439337163
Hey guys--I'm hoping this is an easy fix and I've just missed a minor change or something. Basically all of my PowerCards macros have stopped working--I think it may be related to the changes for Roll20's latest update and I might have missed having to update something. I went to find the simplest macro I've got that fails--this one fails silently. Doesn't display a PowerCard or affect the tracker, but no Javascript errors in the API settings page. !power {{ --charid|@{character_id} --emote|@{selected|token_name} rolls initiative! --format|battle --name|Initiative --Initiative|[[ [trkr] 1d20+@{Initiative}]] }} (In case it matters: 3d dice are disabled.)
...never mind, appears to have been the general API problem Roll20 was having tonight. O_O
No news on any PowerCards updates. Just been busy with work, overtime... lots of overtime, and wedding planning. And more overtime to pay for said wedding planning. I still intend to find some way to create true variables, but it will require a lot of work I just don't have time for at the moment.
1439989887
DK Heinrich
Marketplace Creator
Sheet Author
Good luck on the wedding planning - you only do it a few times in a lifetime... :) as far as this stuff goes - I am still hoping to find a way to make PowerCards and AlterBars to work at together - I hit my macro it spits out a pretty power card that sends the damage total to alterbars that in turn adjusts the bar on the target (that in turn triggers blood to splatter on the screen with use of Mark's new version of BloodSpatter and Conditions script).&nbsp;
You'd need to alter AlterBars to accept the x.inlinerolls object from PowerCards and parse through that to get the information you need/want.
1439991266
DK Heinrich
Marketplace Creator
Sheet Author
HoneyBadger said: You'd need to alter AlterBars to accept the x.inlinerolls object from PowerCards and parse through that to get the information you need/want. and someday soon I hope to know what that means :) &nbsp;- seriously my next project is to learn more about js so i can feel less helpless.&nbsp;
1439991528
The Aaron
Pro
API Scripter
I highly recommend Javascript: The Good Parts by Douglas Crockford . &nbsp;It's a short book with loads of good information about how to write good Javascript. &nbsp;Definitely ping me if you have any questions, I'm happy to talk at length about programming. &nbsp;=D&nbsp;
1439991615

Edited 1439991855
DK Heinrich
Marketplace Creator
Sheet Author
The Aaron said: I highly recommend Javascript: The Good Parts by Douglas Crockford . &nbsp;It's a short book with loads of good information about how to write good Javascript. &nbsp;Definitely ping me if you have any questions, I'm happy to talk at length about programming. &nbsp;=D&nbsp; actually I think I have heard you mention that before and I have it in my "roll20 random notes" file. Looking into it today - and expect a ping at some point... as you already know I am full of requests lol EDIT: the book is now mine!&nbsp;