This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 3)

1439991627

Edited 1439991668
DK Heinrich
Marketplace Creator
Sheet Author
EDIT: Double Post. 
1439991813
Sky
Pro
At the end of the PowerCards.Process function, you would basically do a AlterScript.Process(NewMsg, who); after going through x.inlinerolls  to get the information needed and format that as NewMsg.content and tack on NewMsg.who as well. It would actually be pretty easy for me to do... but I dislike automation. Too many variables in most rpg's and double clicking a macro could have unintended consequences, making it more difficult for the GM to undo.
1439992467
DK Heinrich
Marketplace Creator
Sheet Author
i have thought that it might be pushing the edges of to much automation.  If you decide to play around with it great, if not - once I decide I know enough to break it I will try and see what happens. Thanks again!
1439993490
Sky
Pro
Yeah, most people know I'm anti-automation. There are places for it and adding conditionals was more than I really wanted to do... but I had to keep up with Roll Templates, lol.
1440019621

Edited 1440019990
Conditionals make long cards into short cards, while making short macros into epic length macros.  We appreciate having them! ^_^  (Sadly, the game I really needed the bells and whistles for has ended, so less envelope-pushing from me for now) Edit, as a thought hit me... HB, how much work would it take to do the following: A) Roll 1d6+2d6 and flag doubles/triples as critical success B) Same as above, but just roll 3d6 This would support Fantasy AGE and Dragon AGE which uses a 'roll 1 stunt die plus 2 normal dice, if any of the dice come up doubles/triples you get to do something cool based on the stunt die'.  Generally we use the first or last die rolled for the stunt die (GM sets convention at start of game) and mouseover to see if there were doubles.  I'm starting to make powercards for the Fantasy AGE game I'm in and I'd LOVE to be able to color the dice based on doubles.   Right now I'm just using NH and XPND. If you had variables it would be easy-ish ^_-
1440020655
Sky
Pro
Dropdown queries helped turn my epic macros into tiny epic macros, lol. It probably wouldn't be super difficult to add support for AGE rolls. It'd just be another roll type in the comments like [nh].
1440021280
Sky
Pro
Do you always roll just three dice with AGE rolls? Are there any other mechanics involved?
1440022816
It's 3d6+mods for attacking/skills/initiative rolls, assorted dice for damage, and damage can't generate stunt dice. (I've played a grand total of 2 sessions, and I don't have the books.  I'll direct my GM to this thread so he can comment on anything I've missed!)
1440042719
Andrew R.
Pro
Sheet Author
{Smoke Cloud} Your wish is my command! I'm GenKitty's GM for Fantasy Age. Here's some quotes from the rulebook about Ability tests and the Stunt Die in FAGE. Combat to-hit rolls are Accuracy or Fighting Ability tests. Ability Tests To make an ability test, first pick up three six-sided dice (3d6). Two of the dice should be one color and the third a different color. The off-color die is known as the Stunt Die (see The Stunt Die). Roll all three dice and add the results together; you want to roll high. You then add the ability you’re testing and another 2 if you have an applicable ability focus. The final number is your test result. Test Result = 3D6 + Ability + Focus Even if you have several focuses that could apply, you can only use one on a test. You can never gain the benefits of more than one focus on an ability test. The Stunt Die You always roll three dice when taking an ability test, two dice of one color and one die of another. The off-colored die is known as the Stunt Die and it has several uses in the game system. It is used to generate stunt points (SPs), measure degrees of success, and to break ties. When you see a reference to the Stunt Die, just remember it’s the off-colored die from ability tests. An Ability can range from -2 to 4 inclusive for PCs, more for GMCs like dragons or whatever. An Ability Focus is either 0, +2, or +3 for Level 11+ PCs who've taken the Focus twice. The GM can impose a penalty / bonus of -3 to +3 inclusive depending on circumstance.
1440055155
Sky
Pro
So even if it automatically showed doubles or triples, you'd still be using xpnd to be able to sort out which die is which, right?
1440056786
Yes, that seems the simplest way.
1440775452
Hi, I've been having same issue as @Lake / James with charms and DnD 4e character sheet. This sheet has attributes with references to other attributes for auto-calculation purposes, which is problematic for PowerCards' charm functionality (great script, thank you!). I added this call at the end of getTargetInfo function, before it returns the value: attr = getAttrRefValues(Character.id, attr); And this is what the called function does:     // Searches for character's attribute references and gets its values     // (if find, returns an inline roll of them)     function getAttrRefValues(char_id, attribute) {         var n_ref = 0;         var attr = attribute;         if (/.*@{.*/.test(attribute)) {             n_ref = attribute.match(/@{/g).length;         }         if (n_ref > 0) { //there are references to attributes             for  (var i = 0; i < n_ref; i++) {                 attr = attr.replace(/@{(.*?)}/, function(e) {                     var attr_ref = e.replace(/@{/, '').replace(/}/, '');                     attr_ref = getAttrByName(char_id, attr_ref);                     return getAttrRefValues(char_id, attr_ref);                 });             }             //transforms reference to inline roll             if (attr != '') { //avoiding inline rolls of nulls                 attr = "[[" + attr + "]]";             } else { //value 0 for void attribute references                 attr = "0";             }         }         return attr;     }; It solves the problem for me. I don't know if it creates new ones yet. But maybe you want to try it Lake / James: just insert the first code at line 805 (before "return (Character && attr) || 'ERROR';") and the second code at line 780 (before "function getTargetInfo(content, TargetList) {").
1440776274
Sky
Pro
I'll look at adding that eventually.
1440859088
Hi HoneyBadger! When I use the following roll formatting to reroll a 1, I would like the condition color boxes around the result to be determined using the 2nd roll and not the first. Can that be done? I think you did it one time for me but may have been lost in the later versions. d20ro<1+2
1440865089
Silvyre
Roll20 Mod Team
[[d20ro<1cf0 + 2]]
1440871787
Sky
Pro
Thomas C. said: Hi HoneyBadger! When I use the following roll formatting to reroll a 1, I would like the condition color boxes around the result to be determined using the 2nd roll and not the first. Can that be done? I think you did it one time for me but may have been lost in the later versions. d20ro<1+2 Hrm, I don't recall doing that at any point.
1440944852
Looks like you fixed something similar once, but it was not this exact problem. It was nothing highlighting. So you are correct. But, can this problem (highlighting based on the first roll instead of the second) be fixed?
1440945307
Silvyre said: [[d20ro<1cf0 + 2]] Thank you Silvyre, but I would like to retain the red on a 1 if possible.
1440968333
Sky
Pro
I'll check github tomorrow and see what I changed then. Not sure how it got unchanged.
1441021486
Sky
Pro
Thomas C. said: Looks like you fixed something similar once, but it was not this exact problem. It was nothing highlighting. So you are correct. But, can this problem (highlighting based on the first roll instead of the second) be fixed? What I fixed was re-rolls not highlighting the second roll at all... as in say you have 1d20ro<4 and if you got a 3 on the first roll and a 20 on the second, it wouldn't highlight the twenty. The bugfix in 2.4.12 was to make the 20 highlight as it should. It was never intended to not highlight the initial roll. I'd have to add in something special to do that and you'd have to add in a roll option like nh or trkr to every roll with a re-roll function.
1441029711
Uh oh, the FMyFJ on the latest PowerCard build: !power --charid|@{character_id} --emote|Azrael burns away at his foes as Kergan cries out in awe! --format|ranged --name|Inferno Pistol, Deadly Aim --leftsub|Ranged --rightsub|Standard Action --Attack|[[1d20 + 11]] vs Touch AC --Inflicts|[[1d6 + 11]] fire damage
1441054967
Sky
Pro
I believe that's an issue with the character id having some combination of characters that makes it think it's a new tag or something. Make a copy of the character and it should make a new id and get rid of that problem.
1441106380
That did it, thanks!
1441115835
Hi! I've got a problem, namely that when we try to roll a power, the Sandbox shuts down and i get this error: "There was an error communicating with the QuantumRoll server." What to do?
1441116868

Edited 1441116877
The Aaron
Roll20 Mod Team
API Scripter
Re-saving your scripts did not fix the issue?
1441121204
Samuel Penn
KS Backer
Is there a way to reference the index number in a repeated line? e.g., when making multiple attacks in d20, each subsequent attack is at a further -5, so I can't find a way to make use of the repeat option since each line needs a different penalty. Being able to reference the index number would greatly simplify full attack macros. e.g., something like:     Attack#4|[[d20 + @{AtkBonus} - (5 * #)]] This would give -0, -5, -10, -15 for each repeat (assuming a zero based index). Does this facility exist currently, or could it be added? Thanks.
1441124521
Silvyre
Roll20 Mod Team
Why not create a tag for each attack, each with its own modifiers?
1441196435
Sky
Pro
The repeat option is for repeating the same roll over and over. More for aoe attacks and such. 
1441254154
Though it probably shouldn't need to work (I simply found out it doesn't), if you make a PowerCard for initiative, and add an option to do standard, disadvantage, advantage (like a lot of rolls), the field which shows is the appropriate one, but the one which is added to the tracker, is whichever the last one is. For example: !power {{ --charid|@{character_id} --name|@{character_name} Initiative Roll --leftsub|Start of round --hroll|[[ [$Adv] ?{Advantage?|No,0|Advantage,1|Disadvantage,2} +0d0 ]] --?? $Adv == 0 ?? Roll:|~R[[ [trkr] 1d20 + [[@{initiative_overall}]] ]]~R --?? $Adv == 1 ?? Roll:|~R[[ [trkr] 2d20kh1 + [[@{initiative_overall}]] ]]~R --?? $Adv == 2 ?? Roll:|~R[[ [trkr] 2d20kl1 + [[@{initiative_overall}]] ]]~R }} The only reason I know it's the last one, is because if (in this case), I select Disadvantage, the appropriate number appears in the tracker corresponding with the PowerCard. Any of them I move to the bottom by rearranging, the tracker corresponds to that roll and that one only. I normally hard code Advantage initiative rolls for my players, but I wondered if this would work (like it does for attacks, etc.) And.... not in the current form. I might be doing something wrong in this instance though. I'm not too worried if it doesn't work normally, I was just trying to set it to be an option so that those who have Advantage on initiative, can roll standard if they suddenly lose their ability to have Advantage.
1441265466
Sky
Pro
Use a drop down query for advantage this way instead to get around that: [[ [trkr] ?{Initiative|Standard, 1d20|w/Advantage, 2d20kh1|w/Disadvantage, 2d20kl1} + [[@{initiative_overall}]] ]] It also has that advantage of shortening your powercard macros to do adv/dis that way, since you don't need to test for it via adv == 0 and such.
1441309658

Edited 1441309723
Ah, thank you sir. You are a gentleman and a scholar! I can't believe I didn't think of that. I guess I'm going through an intellectual burnout lately...
Is there a possible way of adding API buttons to the Script, in order to make a nice formatted Menu or along those lines?
1441330653

Edited 1441339824
Silvyre
Roll20 Mod Team
Calhanol said: Is there a possible way of adding API buttons to the Script, in order to make a nice formatted Menu or along those lines? Yes. API Command Buttons can be nested within a PowerCard macro (and vice versa). However, to make this possible, you must first do the following: 1. Add a whisper tag (if not already present) to any PowerCard macro containing API Command Buttons (or Markdown links/images, for that matter).* 2. Replace any and all PowerCards/Roll20 syntax within the would-be contents of your API Command Button with HTML entities.** * i.e. --whisper|GM, You, Foo, Bar, Baz ** You could use regular expressions ( PRCE ) to help convert PowerCard macros into the [probably functional] contents of an API Command Button. I use Notepad++ to facilitate this process—first, open your PowerCard macro in a new N++ document. Open the Replace menu and toggle the Search Mode from Normal to Regular expression . Copy and paste the regular expressions below into the specified fields. Hit Replace All. Place the resultant code within the [...](body) of your new API Command Button. Find what : (\Q?\E)|(\Q@\E)|(\Q%\E)|(\Q[[\E)|(\Q]]\E)|(\Q*\E)|(\Q)\E)|(\Q--\E)|(\Q//\E)|(\Q~\E)|(\Q^\E)|(\Q}\E)|(\Q$\E)|(\r\n)|(\Q`\E)|(\Q_\E) Replace with : (?1&#63;)(?2&#64;)(?3&#37;)(?4&#91;[)(?5]&#93;)(?6&#42;)(?7&#41;)(?8&#45;-)(?9&#47;/)(?10&#126;)(?11&#94;)(?12&#125;)(?13&#36;)(?14 )(?15&#96;)(?16&#95;)
1441915621
Samuel Penn
KS Backer
Silvyre said: Why not create a tag for each attack, each with its own modifiers? Because that is 4x as much work. I'm looking for a way to reduce the amount of work I have to do to prepare for a game, and currently a lot of time is spent writing macros. Even though I've adding more and more into variables, it's still a lot of work when I have to tweak a macro because this creature does attacks in a slightly different way.
1441915745
Samuel Penn
KS Backer
For the last few weeks I've been getting the following script errors: events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:904:11) at Server._listen2 (net.js:1023:19) at listen (net.js:1064:10) at Server.listen (net.js:1132:5) at Sandbox.start (/home/symbly/www/d20-api-server/sandcastle/lib/sandbox.js:35:15) at Object. (/home/symbly/www/d20-api-server/sandcastle/bin/sandcastle.js:11:9) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) Clicking 'Save Script' to restart the sandbox fixes things, but until I do, PowerCards don't work. I've no idea what is causing it, but it's often broken when I start a new session, and may break one or twice during the session. I'm running 3.2.10
1441916906
Sky
Pro
That's an API thing, not a powercards thing.
1441969760
Sky
Pro
Samuel Penn said: Silvyre said: Why not create a tag for each attack, each with its own modifiers? Because that is 4x as much work. I'm looking for a way to reduce the amount of work I have to do to prepare for a game, and currently a lot of time is spent writing macros. Even though I've adding more and more into variables, it's still a lot of work when I have to tweak a macro because this creature does attacks in a slightly different way. If you post some of your macro's, there may be ways to trim them down to be easier to edit.
Thanks for the assiatance Silvyre, now I have a menu system for my group's abilities, and with the conditionals and ammo script, I can hide encounter and daily moves that they used with ease. And I reset them all using a custom script. So now instead of 20 odd buttons per character Token, they now have 5, 1 each for At-Wills, Encounters Etc.
1442001424
Silvyre
Roll20 Mod Team
Sounds awesome!
1442002133
Sky
Pro
Calhanol said: Thanks for the assiatance Silvyre, now I have a menu system for my group's abilities, and with the conditionals and ammo script, I can hide encounter and daily moves that they used with ease. And I reset them all using a custom script. So now instead of 20 odd buttons per character Token, they now have 5, 1 each for At-Wills, Encounters Etc. Awesome indeed. ::teal'c voice::
1442007849
Ravenknight
KS Backer
HoneyBadger said: Calhanol said: Thanks for the assiatance Silvyre, now I have a menu system for my group's abilities, and with the conditionals and ammo script, I can hide encounter and daily moves that they used with ease. And I reset them all using a custom script. So now instead of 20 odd buttons per character Token, they now have 5, 1 each for At-Wills, Encounters Etc. Awesome indeed. ::teal'c voice:: Powercards are pure awesome-sauce.
1442577419

Edited 1442577435
I'm trying to sort out criticals and damage calculation right now and it isn't working, here is what I have right now: /me fires from his Lutebow !power {{ --name|Songful Full Attack --leftsub|LuteBow --rightsub|Ranged --Attack 1:|[[ [$Atk] 1d20 + 7 [BAB] + 1 [MC] + ?{Point Blank?|0}]] vs AC --Attack 2:|[[ [$Atk2] 1d20 + 7 [BAB] + 1 [MC] - 5 + ?{Point Blank?|0}]] vs AC --Damage:|[[ [$Damage]1d8 + ?{Point Blank?|0}]] + [[ [$Damage2]1d8 + ?{Point Blank?|0}]] --Crit Damage:|[[3*3]] --?? $Atk.base == 20 ?? Crit Confirm 1:| [[ 1d20 + 7 [BAB] + 1 [MC] + ?{Point Blank?|0}]] --?? $Atk2.base == 20 ?? Crit Confirm 2:| [[ 1d20 + 7 [BAB] + 1 [MC] - 5 + ?{Point Blank?|0}]] }} For Crit damage I want to be able to call the [$Damage] and either *2 or *3 but I haven't found a way to do that yet. I also want to try and add [$Damage] with [$Damage2] and then show that on the card so people don't have to do as much maths (some people aren't too good with it). Also is there a cleaner way to work the crit confirm out besides writing out the entire attack again like I have?
1442577963
Sky
Pro
You can't do math with roll id's yet and with my wedding coming up in a month, I haven't had the time to work on updating that part of PowerCards yet.
1442581448

Edited 1442581513
DK Heinrich
Marketplace Creator
Sheet Author
my set up for rogue is basically this if hit do x damage (normal roll) if hit and crit do y damage (normal roll with condition to trigger crit) if hit and crit and bonus do z damage (normal roll with condition to trigger crit and condition triggered by roll query(s)) and with conditionals you should be able to make it only show the answer you want it to show.  This is portion of rogue attack macro shooting a bow. Checks to see that he has arrows, if yes then looks at Roll Result to see if he hits, if not - failure (rollable table is just for flavor). If yes and he did not use his Trickery (a rogue thing in the game) he does 1d6, If yes and he did you it, he does 2d6. --?? $Arrows.total > 0 AND $RollRes < $DEF ?? ^1 Failure|[[ [txt] 1t[Failure] ]] --?? $Arrows.total > 0 AND $RollRes >= $DEF AND $TRICK == 0 ?? ^1Success|Deal [[ [nh] 1d6]] damage --?? $Arrows.total > 0 AND $RollRes >= $DEF AND $TRICK == 1 ?? ^1Tricky Success| Deal [[ [nh] 2d6]] damage poping in the whole macro would be more confusing than help as it is not for D&D game, but this portion might help you.
1442581634
Sky
Pro
Yeah, if you roll the crit damage separate and just show the crit total and not the regular damage on a crit... players will never know if they could have had a few more points of damage.
1442602724
DK Heinrich
Marketplace Creator
Sheet Author
ok, my brain is melted. I need to be able to target between 1 and 3 bad guys (I can use %%), and then assign 7 points of damage among those targets (maybe drop down menu for each target?). Once I get close I can do all the conditionals to only show what I want when I want to show it, but I am stuck getting to that point.  
1442631704

Edited 1442631745
Silvyre
Roll20 Mod Team
?{How many bad guys?| 1, --Bad guy 1:&#124;[[?{Damage #1&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] | 2, --Bad guy 1:&#124;[[?{Damage #1&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] --Bad guy 2:&#124;[[?{Damage #2&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] | 3, --Bad guy 1:&#124;[[?{Damage #1&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] --Bad guy 2:&#124;[[?{Damage #2&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] --Bad guy 3:&#124;[[?{Damage #3&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#125;]] }
1442685373

Edited 1442686971
I am in a game using the D&D 4E character sheet. We are using  PowerCards 3.2.10. I have been successfull pulling most the information out of the character sheet for use in the macro, but i seem to be having troubles getting  this Sword Burst macro working. !power {{ --corners|0 --bgcolor|#54804E --txcolor|#ffffff --erowbg|e9e8dd --orowbg|#ffffff --name|Sword Burst --leftsub|At-Will --rightsub|Standard Action --Aecris Longsword:|+8 vs. @{power-4-def}, 1d6+5 damage^^^^**Close** burst^^**Targets:** Each enemy in the burst. --|A sweep of your sword blasts those around you with force. --Keywords:|Arcane, Force, Implement --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} | @{target|7th|token_id} | @{target|8th|token_id} --Attack#?{Number of targets|1}|[[ 1d20 + @{power-4-attack} ]] vs. %%@{power-4-def}%% @{power-4-def} (%%token_name%%) --Hit:|[[ (floor(@{level}/21)*(@{power-4-weapon-num-dice}d@{power-4-weapon-dice})) + @{power-4-weapon-num-dice}d@{power-4-weapon-dice}+@{power-4-damage} ]] damage. }} I also tried the sample macro from the from the beginning of this post. !power --name|Scorching Burst | Nine Targets --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} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id} --Attack#?{Number of targets|1}|[[1d20+5]] vs %%Reflex%% Reflex (%%token_name%%) --Hit|[[1d8+3]] fire damage It also did not work for me. I tried them with generic tokens with just a name and tokens with a character sheet. I also tried this with tokens of the same name and different names. Neither macro worked for me in any of the scenarios I tried. So what it does is the select target dialogue box asks me to click on the targets, which I do. Then the popup for number of targets which I input the number of targets. Then nothing happens and the select target dialog box is present. I then have to cancel the select target dialogue box to be able to continue. Any suggestions? Thanks in advance.
1442699691

Edited 1443292594
I have gotten this to work with a restart of the script. I did make some minor changes, but do not think that effected the macro to start working. Here is that macro just for reference. !power {{ --corners|0 --bgcolor|#54804E --txcolor|#ffffff --erowbg|e9e8dd --orowbg|#ffffff --name|Sword Burst --leftsub|At-Will --rightsub|Standard Action --Aecris Longsword:|+8 vs. @{power-4-def}, 1d6+5 damage^^^^**Close** burst^^**Targets:** Each enemy in the burst. --|A sweep of your sword blasts those around you with force. --Keywords:|Arcane, Force, Implement --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} | @{target|7th|token_id} | @{target|8th|token_id} --Attack#?{Number of targets|1}|[[ 1d20 + @{power-4-attack} ]] vs. @{power-4-def} (%%token_name%%) --Hit:|[[ (floor(@{level}/21)*(@{power-4-weapon-num-dice}d@{power-4-weapon-dice})) + @{power-4-weapon-num-dice}d@{power-4-weapon-dice}+@{power-4-damage} ]] damage. }} Now if I can just figure out how to use [$Atk] to display critical damage on any roll that is a crit. Currently I can only get it to display if the last roll is a crit. --?? $Atk.base == 20 ?? Critical Hit:#|[[ (floor(@{level}/21)*(@{power-4-weapon-num-dice}*@{power-4-weapon-dice})) + @{power-4-weapon-num-dice}*@{power-4-weapon-dice} + @{power-4-damage} + @{weapon-2-enh}d@{weapon-2-per-plus} ]] damage.
1442703064
It doesn't work for Charms at the moment. It's the only reason I haven't implemented for attack spells on my own stuff.