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)

Finally put all of the crit tables in the macro. Works nicely. The macro is hitting 96 lines and has a reasonable lag time of around 2.6 seconds. I did notice that at level 10 the dice roll was 2d20 instead of 2d20+1d14. I couldn't figure out how to make the crit table roll 2d20+1d14 if warrior level &gt;= 10. --Attack|[[ [$Atk] 1d20cs&gt;[[19 - {@{selected|Level},0}&gt;5 - {@{selected|Level},0}&gt;9]] + [[{@{selected|Level},0}&gt;5]]d[[14 + 2 * {@{selected|Level},0}&gt;6 + 4 * {@{selected|Level},0}&gt;7]]cs0cf0 + [[{@{selected|Level},0}&gt;10]]d14cs0cf0 + [$Deed] 1d[[{@{selected|Level} + {@{selected|Level},0}&gt;7, 10 + 0d0&gt;0}kl1 + ]]cs0cf0 + [[{@{selected|Level},0}&gt;7 * (@{selected|Level} - 6)]] ]] Fumbles Silvyre said: Please do! Then we can get started on fumbles! As for fumbles, I've been trying to work it out myself but can't. My frustration is with the character sheet attribute for the fumble die based on armor type. The HTML for the character sheet lists these attributes for armor: &lt;input type="text" name="attr_ArmorName"/&gt; &lt;input type="text" name="attr_ArmorBonus"/&gt; &lt;input type="text" name="attr_ArmorCheck"/&gt; &lt;input type="text" name="attr_ArmorSpeed"/&gt; &lt;input type="text" name="attr_ArmorFumbleDie"/&gt; &lt;input type="text" name="attr_ArmorSpecial"/&gt; Reference: <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/DCC" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/DCC</a> None of those attributes return anything even when the values are filled in the character sheet: I get: No attribute was found for @{selected|ArmorName} The reason ArmorName is important is that the fumble die is based on armor type.&nbsp; Fumble logic and table Fumble roll = Armor Fumble Die + Reverse of luck modifier Example if your luck mod is +3 and your armor name is Hide : 1d12 - 3 Example if your luck mod is -3 and your armor name is Half-plate : 1d16 +3 Armor Fumble Die Table: Armor Name Fumble Die Unarmored 1d4 Padded 1d8 Leather 1d8 Studded Leather 1d8 Hide 1d12 Scale mail 1d12 Chainmail 1d12 Banded mail 1d16 Half-plate 1d16 Full plate 1d16
1479927694
Silvyre
Forum Champion
Grognard said: I did notice that at level 10 the dice roll was 2d20 instead of 2d20+1d14. Are you sure? This part in particular controls the addition of 1d14 at level 10: [[{@{selected|Level},0}&gt;10]]d14cs0cf0 Grognard said: I couldn't figure out how to make the crit table roll 2d20+1d14 if warrior level &gt;= 10. At level 10, the corresponding Crit Die/Table is "2d20/V". Unless I'm misunderstanding something, shouldn't the crit table roll just be 2d20?
1479928096

Edited 1479928231
Silvyre
Forum Champion
Grognard said: &lt;input type="text" name="attr_ArmorName"/&gt; &lt;input type="text" name="attr_ArmorBonus"/&gt; &lt;input type="text" name="attr_ArmorCheck"/&gt; &lt;input type="text" name="attr_ArmorSpeed"/&gt; &lt;input type="text" name="attr_ArmorFumbleDie"/&gt; &lt;input type="text" name="attr_ArmorSpecial"/&gt; Reference: <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/DCC" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/DCC</a> None of those attributes return anything even when the values are filled in the character sheet: I get: No attribute was found for @{selected|ArmorName} Those are Repeating Attributes , which are called differently than normal Attributes. For example, the call you want is @{selected|repeating_armor_$0_ArmorName}. However, instead of bothering with armor names, wouldn't it be easiest to just use [[ [$Fumble] @{selected|repeating_armor_$0_FumbleDie} - @{selected|LCK} ]]?
At level 10, the corresponding Crit Die/Table is "2d20/V". Unless I'm misunderstanding something, shouldn't the crit table roll just be 2d20? At level 10 the crit die roll is 2d20+1d14 on table V. I'll have to check my logs again.&nbsp; Those are Repeating Attributes , which are called differently than normal Attributes. For example, the call you want is @{selected|repeating_armor_$0_ArmorName}. :mindblown: Sweet, thanks. Yeah, this worked:&nbsp;@{selected|repeating_armor_$0_ArmorFumbleDie} Now to figure out the Fumble dice roll logic. Thanks for your help. After this portion is done I think I should be good while I build all the tables and macros.&nbsp;
Ryan T. said: This section of the Roll20 Wiki documents how to call Attributes. The Attribute in question ( according to the sheet's Wiki page ) is named strength-mod Thank you very much, I ended up using the sheet wiki page which lead me to&nbsp; <a href="https://wiki.roll20.net/DnD4e_Character_Sheet" rel="nofollow">https://wiki.roll20.net/DnD4e_Character_Sheet</a> , this has every hidden attribute which is making life so much easier for me. &nbsp;thank you for your assistance, I just gotta learn how to add the condition icons and see if these rolls can automatically influence attribute bar data like hp. &nbsp;I read it a bit on the home page but I'm going to tackle it and see what I can do.&nbsp; PowerCards does not include any methods of automation like that. It does not have any method by which it can adjust attributes of a token or character sheet.
Sines said: Hi Drew C. , You could try a modification I did to allow the use of autocalculated attributes of DnD 4e sheet. The code of PowerCards should be changed as following: 1. Add a new function (to treat attributes with references to other attributes): function getAttrRefValues(char_id, attribute) { &nbsp;&nbsp;&nbsp; var n_ref = 0; &nbsp;&nbsp;&nbsp; var attr = attribute; &nbsp;&nbsp;&nbsp; if (/.*@{.*/.test(attribute)) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n_ref = attribute.match(/@{/g).length; &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; if (n_ref &gt; 0) { //there are references to attributes &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for&nbsp; (var i = 0; i &lt; n_ref; i++) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr = attr.replace(/@{(.*?)}/, function(e) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var attr_ref = e.replace(/@{/, '').replace(/}/, ''); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr_ref = getAttrByName(char_id, attr_ref); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return getAttrRefValues(char_id, attr_ref); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; return attr; }; 2. On the function getTargetInfo, modify the default case of its "switch (charm)": default: &nbsp;&nbsp; &nbsp;attr = getAttrByName(Character.id, charm); &nbsp;&nbsp; &nbsp;attr = getAttrRefValues(Character.id, attr); Then, on the game, make sure your target charm is part of an inline roll. Your example "[[1d20+%%stealth_bonus%%]]" is already part of one, but I had to add 0d0 and brackets where some of my target charms are, like "[[ 0d0 + %%ac%% [AC] ]]". Hope it helps. I have added this to the PowerCards script. Thanks Sines!
November 23rd, 2016 ~ 5:00 pm eastern Version: 3.2.22 Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Update: Added getAttrRefValues function written by Sines . This allows you to use autocalculated attributes on character sheets with target charms. Such as the armor class attribute on most D&D character sheets. Note: This update is untested by me. I simply added the function as is into the script.
1479939380

Edited 1479939503
Silvyre
Forum Champion
Grognard said: At level 10 the crit die roll is 2d20+1d14 on table V. I'll have to check my logs again. Ah, I was just going off of the image you posted earlier. Well, you could add [[{@{selected|Level},0}&gt;10]]d14cs0cf0 right before you add LCK, then. Now to figure out the Fumble dice roll logic. Thanks for your help. After this portion is done I think I should be good while I build all the tables and macros. Great! Good luck!
Also... new thread: <a href="https://app.roll20.net/forum/post/4285059/script-powercards-3-thread-4/?pageforid=4285062" rel="nofollow">https://app.roll20.net/forum/post/4285059/script-powercards-3-thread-4/?pageforid=4285062</a>