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 ~ Now contains logic!™

1432865520

Edited 1432879125
Muse
Pro
Made a new campaign, added powercards and it works. Add another script with just the following: on("change:graphic", function(obj) { //do stuff }); and i get the error: For reference, the error message generated was: Unexpected token ) EDIT: This does seem to be an API window issue. I put all the scripts into a single script tab and it's back to working just fine.
Same error message I was getting with the bloodied status script : <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/Bloodied%20and%20Dead%20Status%20Markers" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/Bloodied%20and%20Dead%20Status%20Markers</a>
1432867013

Edited 1432867100
DRB GM said: Made a new campaign, added powercards and it works. Add another script with just the following: on("change:graphic", function(obj) { //do stuff }); and i get the error: For reference, the error message generated was: Unexpected token ) I just tried that myself and it did not give me that error. Even with copy and paste straight from the gist. Maybe you have a phantom script leftover like GenKitty did. I dunno. Ok, now I am getting the error, but only after disabling and re-enabling my script. I don't know... seems like something funky with the api page itself.
1432867166

Edited 1432867628
Is it possible to combine the targeted list with the conditional logic for the outcome of each target? I'm guessing not yet, as you would need to set a different variable for each target from the list, or have the conditional logic inline rather than its own tag?
corey m. said: Is it possible to combine the targeted list with the conditional logic for the outcome of each target? Should be... %%AC%% for the target in the conditional should work. I haven't tested it though.
Actually, now that I think about it... that kind of multi-target comparison is not something powercards can do and it may be awhile before it can. That's going to take a lot of work to get right.
1432868761

Edited 1432868891
HoneyBadger said: Actually, now that I think about it... that kind of multi-target comparison is not something powercards can do and it may be awhile before it can. That's going to take a lot of work to get right. Yeah and it is work around-able... (Is that a word?)
I'm not having luck trying it out a couple different ways. I think the conditional would have to be inline on the target list roll? It works when I only select 1 target, but not when i select more with the following: !power {{ --format|atwill --name|Multi target attack --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --!Attack#?{Number of targets|1} | [[ [$Atk] 1d20 - %%RFX%% ]] vs the RFX of %%token_name%% --?? $Atk total &gt;= 0 AND $Atk base &lt;&gt; 1 AND $Atk base &lt;&gt; 20 ?? !Hit: | %%token_name%% is **HIT** for [[2d4sd]] damage --?? $Atk total &lt; 0 AND $Atk base &lt;&gt; 20 ?? !Hit: | %%token_name%% is **MISSED**. --?? $Atk base == 20 ?? !Hit: | %%token_name%% is **CRITICALLY HIT** for [[8+3d10]] damage }}
Conditionals do not work with multi-target macros using the repeating tag option. I don't know when or if this will be something that works.
The new [trkr] roll option is working well. Just need to make it so that it replaces an initiative value instead of adding a new entry, if that token or character already exists.
May 29th, 2015 ~ 1:15 am eastern Version: 3.1.0 Update: Added [trkr] to the list of roll options. This will add the following to the Turn Order Tracker in this order... Token Name / Picture (requires use of --tokenid|@{selected|token_id} ) Character Name (requires use of --charid|@{character_id} ) Display Name Example: [[ [trkr] 1d20 + 4 [Dex Mod] ]] Bugfix: Fixed problem with looking for inline rolls or rollable tables in non-existent emotes... shouldn't crash now if you use a powercard that does not use the --emote tag.
1432881997
Gen Kitty
Forum Champion
You wanted crash reports. For reference, the error message generated was: evalmachine.&lt;anonymous&gt;:590 RollBase = x[0].inlinerolls[Roll].results.rolls[RollCount + 1].results[0].v; ^ TypeError: Cannot read property 'v' of undefined at evalmachine.&lt;anonymous&gt;:590:94 at Array.forEach (native) at evalmachine.&lt;anonymous&gt;:580:39 at checkFinishedOps ( !power {{ --name|Silva~~~Shocking Pistol^^Single Shot --bgcolor|#E6BE8A --txcolor|#000000 --titlefont|Helvetica --subtitlefont|Helvetica --titlefontsize|18px --subtitlefontsize|12px --bodyfontsize|12px --leftsub|Ranged --rightsub|Non-provoking --Target:|@{target|Target|token_name} --Hitting:|[[ [$Shot1]1d20cf&lt;?{MaxMisfire (+1 if Paper)|2} + @{Silva|Double}[NormalBonus] +?{PointBlank?|1}[PB] +?{MiscToHitBonus?|0}[MiscHitBonus] ]] vs **Touch AC** --??$Shot1 base &lt;= ?{MaxMisfire (+1 if Paper)|2}??!Misfire|$$#F30|**Misfire!**$$ No Damage --??$Shot1 base &gt; ?{MaxMisfire (+1 if Paper)|2}??Possible Damage:|^^//(B/P+bonuses+shock+?{Divine Bond Type?|NoBond})//^^[[ [NH]1d8 + @{Silva|Double|max}[GunBonuses] + ?{MiscDamageBonus|0}[Misc] +?{PointBlank?|1}[PB] ]] }} I figured out the error before posting this; I neglected to have a space between the end of the misfire line and the -- of the next line. I don't think you can do any error checking for this, but you DID want the crash reports :&gt;
1432882272

Edited 1432883135
Actually there might be something I can do to stop that one. Edit - Fixed! ^_^ Will be in the next update.
1432883294

Edited 1432883324
Gen Kitty
Forum Champion
New and interesting bug: This fails: (B/P+bonuses+shock+?{Divine Bond Type?|NoBond})//^^[[ [XPND] [NH]1d8 + [[ @{Silva|Double|max} [GunBonuses] + ?{MiscDamageBonus|0} [Misc] +?{PointBlank?|1} [PB] ]] +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] This doesn't: (B/P+bonuses+shock+?{Divine Bond Type?|NoBond})//^^[[ [XPND] [NH]1d8 + @{Silva|Double|max} [GunBonuses] + ?{MiscDamageBonus|0} [Misc] +?{PointBlank?|1} [PB] +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] The difference is encasing the non-dice rolls in brackets. This isn't a dealbreaker, for the macro I'm building, but it IS frustrating. Yes, i know XPND is buggy :/ It is a silently failing bug, so it took me AGES to track down the issue.
1432883560
Gen Kitty
Forum Champion
Replace the brackets with parenthesis and it turns into a crashing bug! YAY... or something. undefined:1 +(1 SyntaxError: Unexpected end of input at processRoll (evalmachine.&lt;anonymous&gt;:1000:34) at evalmachine.&lt;anonymous&gt;:889:22 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:888:30) at evalmachine.&lt;anonymous&gt;:830:66 at Array.forEach (native) at evalmachine.&lt;anonymous&gt;:827:43 at checkFinishedOps ( !power {{ --name|Silva~~~Shocking Pistol^^Single Shot --bgcolor|#E6BE8A --txcolor|#000000 --titlefont|Helvetica --subtitlefont|Helvetica --titlefontsize|18px --subtitlefontsize|12px --bodyfontsize|12px --leftsub|Ranged --rightsub|Non-provoking --Target:|@{target|Target|token_name} --Hitting:|[[ [$Shot1]1d20cf&lt;?{MaxMisfire (+1 if Paper)|2} + @{Silva|Double}[NormalBonus] +?{PointBlank?|1}[PB] +?{MiscToHitBonus?|0}[MiscHitBonus] ]] vs **Touch AC** --??$Shot1 base &lt;= ?{MaxMisfire (+1 if Paper)|2}??!Misfire|$$#F30|**Misfire!**$$ No Damage --??$Shot1 base &gt; ?{MaxMisfire (+1 if Paper)|2}??Possible Damage:|^^//(B/P+(bonuses)+shock+?{Divine Bond Type?|NoBond})//^^[[ [XPND] [NH]1d8 + (@{Silva|Double|max} [GunBonuses] + ?{MiscDamageBonus|0} [Misc] +?{PointBlank?|1} [PB]) +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] }}
Try combining your roll options... they're not meant to be used separately. [xpnd|nh] instead of [xpnd] [nh].
1432884510

Edited 1432884631
This is how I did a 13th Age style expanded attack roll... and it works with no crashing or silent failing. !power {{ --charid|@{character_id} --emote|//Nameless strides forward and attacks with his spectral blade.// --title|HoneyBadger --name|Long Sword --leftsub|Melee Attack --rightsub|Reach 5 ft --Attack:|[[ [$Atk|nh|xpnd] 1d20 + [[ 3 [Strength Mod] + 3 [Proficiency] + 0d0]] ]] vs AC --Hit:|[[ [nh] 1d8 + [[3 [Str Mod] + 1 [Magic] + 0d0 ]] ]] slashing damage --?? $Atk base == 20 ??Critical Hit:|[[ [nh] 1d8]] additional slashing damage }}
1432884609
Gen Kitty
Forum Champion
Combining my tags doesn't with the silently failing issue for the nested inline roll. Nor does it help the crashing issue for the ()'d section of the roll.
1432884647

Edited 1432884720
Gen Kitty
Forum Champion
Yes, the roll works PERFECTLY if I don't try to NEST anything :&gt; And i really want to be able to nest to make the roll look cleaner. (I wouldn't need xpnd to work on nested rolls if you had variables working ^_- )
GenKitty said: Combining my tags doesn't with the silently failing issue for the nested inline roll. Nor does it help the crashing issue for the ()'d section of the roll. What's failing? I have nested inline rolls in my example and it works.
1432884787
Gen Kitty
Forum Champion
Huh, I skimmed your macro too quickly. Why the heck is yours working and mine isn't?
1432884899
Gen Kitty
Forum Champion
undefined:1 +(1 SyntaxError: Unexpected end of input at processRoll (evalmachine.&lt;anonymous&gt;:1000:34) at evalmachine.&lt;anonymous&gt;:889:22 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:888:30) at evalmachine.&lt;anonymous&gt;:830:66 at Array.forEach (native) at evalmachine.&lt;anonymous&gt;:827:43 at checkFinishedOps ( !power {{ --name|Silva~~~Shocking Pistol^^Single Shot --bgcolor|#E6BE8A --txcolor|#000000 --titlefont|Helvetica --subtitlefont|Helvetica --titlefontsize|18px --subtitlefontsize|12px --bodyfontsize|12px --leftsub|Ranged --rightsub|Non-provoking --Target:|@{target|Target|token_name} --Hitting:|[[ [$Shot1]1d20cf&lt;?{MaxMisfire (+1 if Paper)|2} + @{Silva|Double}[NormalBonus] +?{PointBlank?|1}[PB] +?{MiscToHitBonus?|0}[MiscHitBonus] ]] vs **Touch AC** --??$Shot1 base &lt;= ?{MaxMisfire (+1 if Paper)|2}??!Misfire|$$#F30|**Misfire!**$$ No Damage --??$Shot1 base &gt; ?{MaxMisfire (+1 if Paper)|2}??Possible Damage:|^^//(B/P+(bonuses)+shock+?{Divine Bond Type?|NoBond})//^^[[ [XPND|NH]1d8 + (@{Silva|Double|max} [GunBonuses] + ?{MiscDamageBonus|0} [Misc] +?{PointBlank?|1} [PB]) +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] }} Silently fails: !power {{ --name|Silva~~~Shocking Pistol^^Single Shot --bgcolor|#E6BE8A --txcolor|#000000 --titlefont|Helvetica --subtitlefont|Helvetica --titlefontsize|18px --subtitlefontsize|12px --bodyfontsize|12px --leftsub|Ranged --rightsub|Non-provoking --Target:|@{target|Target|token_name} --Hitting:|[[ [$Shot1]1d20cf&lt;?{MaxMisfire (+1 if Paper)|2} + @{Silva|Double}[NormalBonus] +?{PointBlank?|1}[PB] +?{MiscToHitBonus?|0}[MiscHitBonus] ]] vs **Touch AC** --??$Shot1 base &lt;= ?{MaxMisfire (+1 if Paper)|2}??!Misfire|$$#F30|**Misfire!**$$ No Damage --??$Shot1 base &gt; ?{MaxMisfire (+1 if Paper)|2}??Possible Damage:|^^//(B/P+(bonuses)+shock+?{Divine Bond Type?|NoBond})//^^[[ [XPND|NH]1d8 + [[@{Silva|Double|max} [GunBonuses] + ?{MiscDamageBonus|0} [Misc] +?{PointBlank?|1} [PB]]] +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] }}
I tried [[ [xpnd|nh] 1d8 + [[ 4 ]] ]] and that works. Adding [Gun Bonuses] after the 4 causes it to fail and not even be sent to the API scripts to be processed. Which is really weird... because it works in my macro. o_0 Works: [[ [xpnd|nh] 1d8 + [[ 4 ]] ]] Fails: [[ [xpnd|nh] 1d8 + [[ 4 [Gun Bonuses] ]] ]] Fails: [[ [xpnd|nh] 1d8 + [[ 4 [Gun Bonuses] + 0d0 ]] ]]
1432887508
Gen Kitty
Forum Champion
Ah ha! With that knowledge i did THIS: [[ [XPND|NH]1d8 + [[ @{Silva|Double|max} + ?{MiscDamageBonus|0} +?{PointBlank?|1} ]] [Gun Bonuses + MiscBonuses + Point Blank] +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] I pulled the inline labels out of the nested section and then added them AFTER the nested section. THIS works. THANK YOU .
Okay... got this version working. Apparently nested inline rolls have to be last in this case and math only rolls need that 0d0. I don't know why. I'll have to check it out later though. I'm starting to doze off at my desk. --?? $Shot1 base &gt; ?{MaxMisfire (+1 if Paper)|2} ?? Damage:| ^^ //(B/P + shock + ?{Divine Bond Type?|bond} + bonuses)// ^^ [[ [xpnd|nh] 1d8 + 1d6 [Shock] + ?{Divine Bond Dmg|1d0} [Divine Bond] + [[ @{Silva|Double|max} [Gun Bonuses] + ?{Misc. Dmg Bonus|0} + ?{Point Blank?|1} + 0d0]] ]]
GenKitty said: Ah ha! With that knowledge i did THIS: [[ [XPND|NH]1d8 + [[ @{Silva|Double|max} + ?{MiscDamageBonus|0} +?{PointBlank?|1} ]] [Gun Bonuses + MiscBonuses + Point Blank] +[NH]1d6 [Shock] + [NH]?{Divine Bond Damage|1d0} [Divine Bond] ]] I pulled the inline labels out of the nested section and then added them AFTER the nested section. THIS works. THANK YOU . Huh... weird. Glad you got one version working. :) Still, I'll continue to work on it.
A simple initiative macro example... !power {{ --name|Pikkle's Initiative [[ [trkr] 1d20 ]] --charid|@{character_id} --titlefont|Helvetica --titlefontsize|16px --corners|0 }}
1432888293
Gen Kitty
Forum Champion
I'm happy to report that the sample init macro worked perfectly for me :&gt;
Ok, got the crashes sorted. A workaround I'd added earlier, before nested inline rolls, isn't needed anymore and was actually causing problems. I'm surprised it hadn't come up before though. It was something that could have caused crashes before nested rolls came about. Will have an update here shortly.
1432892720
Gen Kitty
Forum Champion
Crash bug, attempting an avatar-less custom emote For reference, the error message generated was: evalmachine.&lt;anonymous&gt;:644 x; vertical-align: middle; text-align: " + EmoteTextAlign + ";'&gt;" + doInlineFo ^ ReferenceError: doInlineFomatting is not defined at evalmachine.&lt;anonymous&gt;:644:178 at checkFinishedOps ( !power {{ --tokenid|@{selected|token_id} --emote|!~L//Thrusting her holy symbol into the air, Esme beseches Desna's divine presence. Within a heartbeat, the symbol pours forth a cloud of butterflies formed from motes of silver light.//~L --name|Esme~~~☼ @@<a href="http://www.d20pfsrd.com/classes/core-classes/cleric#TOC-Channel-Energy-Su-||$$#FFF|__Channel" rel="nofollow">www.d20pfsrd.com/classes/core-classes/cleric#TOC-Channel-Energy-Su-||$$#FFF|__Channel</a> Energy: Undead__$$@@ ☼ --bgcolor|#9F00C5 --txcolor|#FFFFFF --titlefont|Helvetica --subtitlefont|Helvetica --titlefontsize|14px --subtitlefontsize|12px --bodyfontsize|12px --leftsub|Positive Energy --!Effect|Everything undead within 30 feet of Esme takes [[ [NH]3d6]] damage. Will (DC [[10+2+@{Cha}]] for 1/2) }}
1432892908

Edited 1432893129
Fixed. Glad you posted this before I updated the thread. doInlineFomatting should be doInlineFo r matting... oops.
1432893158

Edited 1432893357
Also, it's beseeches... :D
1432893646
Gen Kitty
Forum Champion
GAH. I thought I'd fixed that! You'll likely be happy to know I've finished testing for the night. Every macro I and my spouse need for our Friday night Pathfinder game are now working, one way or another! I'm overjoyed to finally be able to hide single-target critical info!
GenKitty said: GAH. I thought I'd fixed that! You'll likely be happy to know I've finished testing for the night. Every macro I and my spouse need for our Friday night Pathfinder game are now working, one way or another! I'm overjoyed to finally be able to hide single-target critical info! Yay. I'll post the updated thread here in a moment. Just going over it for anything I can clean up or any temporary messes I may have forgotten to remove.
May 29th, 2015 ~ 6:20 am eastern Version: 3.1.1 Bugfix: Fixed the script crashing if you had two tags next to each other without spaces. Example: --tag 1|content--tag 2|content Bugfix: Fixed a type (doInlineFomatting -&gt; doInlineFormatting) Bugfix/Update: Removed old code that didn't need to be in the script anymore regarding expanded rolls. Expanded rolls should work very much better now. If you want to combine a bunch of modifiers together, wrap them in a nested inline roll and be sure to add + 0d0 at the end if there are no dice rolls inside the nested roll or you are adding comments for readability. Good: [[ 1d20 + [[ floor(@{Strength}/2)-5 [Str Mod] + 3 [Weapon Proficiency Bonus] + 0d0 ]] ]] Good: [[ 1d20 + [[ floor(@{Strength}/2)-5 + 3 ]] ]] Bad: [[ 1d20 + [[ 4 [Str] + 3 [Wpn] ]] ]] &lt;-- This will fail.
1432895670

Edited 1432895726
HoneyBadger's Honeydew List 1. Extend conditionals into the content of tags to selectively show or hide specific information 2. Create a way to show only the image from rollable table results (such as rolling Edge of the Empire dice) 3. Implement the ability to refer to the value of a previous roll (result or total) inside following rolls as a variable of sorts 4. Add background image support to replace the colored backgrounds in both the title and the even/odd rows
1432903832

Edited 1432918430
Hrm...just updated to 3.1.1, and now receiving an error on a card that was working before--did I miss something I was supposed to change for new code? Error: evalmachine.&lt;anonymous&gt;:1618 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ").replace( ^ TypeError: Object 20 has no method 'replace' at processRoll (evalmachine.&lt;anonymous&gt;:1618:27) at evalmachine.&lt;anonymous&gt;:1513:14 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:1512:26) at evalmachine.&lt;anonymous&gt;:1458:50 at Array.forEach (native) at evalmachine.&lt;anonymous&gt;:1455:31 at checkFinishedOps ( Card code: !power {{ --charid|@{character_id} --emote|Oswald casts Hail Hail at @{target|Target1|token_name}! --format|atwill --name|Hail Hail --leftsub|Ranged, At-Will --rightsub|Standard Action --Target|@{target|Target1|token_name} --Attack|[[ [$Atk|XPND] 1d20+@{Level}+@{WISMOD}+@{SpellMagicAtkBonus}+@{TempAtkBonus}+@{tracker|Escalation Die}]] --PD|[[@{target|Target1|RPD}]] --Crit Range|[[20-?{Crit Range Expansion|0}]] to [[20]] --?? $Atk base &gt; 1 AND $Atk total &gt;= [[@{target|Target1|RPD}]] AND $Atk base &lt; [[20-?{Crit Range Expansion|0}]] ?? Hit:|[[5d6+@{WISDAM}+@{SpellMagicDamBonus}+@{TempDamBonus}]] cold damage. --?? $Atk base &gt;= [[20-?{Crit Range Expansion|0}]] ?? Critical Hit:|[[(5d6+@{WISDAM}+@{SpellMagicDamBonus}+@{TempDamBonus})*2]] cold damage. --?? $Atk base % 2 AND $Atk base &lt;&gt; 1 AND $Atk total &gt;= [[@{target|Target1|RPD}]] ?? Natural Even Hit:|A different nearby enemy takes [[@{Level}+@{SpellMagicDamBonus}+@{TempDamBonus}]] cold damage. --?? $Atk base ~% 2 AND $Atk base &lt;&gt; 1 AND $Atk total &gt;= [[@{target|Target1|RPD}]] ?? Natural Odd Hit:|Each nearby mook takes [[1d10+@{SpellMagicDamBonus}+@{TempDamBonus}]] cold damage. --?? $Atk base == 1 OR $Atk total &lt; [[@{target|Target1|RPD}]] AND $Atk base &lt; [[20-?{Crit Range Expansion|0}]] ?? Miss|[[@{Level}+@{SpellMagicDamBonus}+@{TempDamBonus}]] cold damage. }} (Error is also happening with this set of code, which has less of the conditionals): !power {{ --charid|@{character_id} --emote|Kaltion swings his maul at @{target|Target1|token_name}! --format|atwill --name|Big-BLEEP Maul --leftsub|Melee, At-Will --rightsub|Standard Action --Target|@{target|Target1|token_name} --Attack|[[ [$Atk|XPND] 1d20+@{Level}+@{STRMOD}+@{MeleeMagicAtkBonus}+@{TempAtkBonus}+@{tracker|Escalation Die}]] --AC|[[@{target|Target1|MAC}]] --Crit Range|[[20-?{Crit Range Expansion|0}]] to [[20]] --?? $Atk base &gt; 1 AND $Atk total &gt;= [[@{target|Target1|MAC}]] AND $Atk base &lt; [[20-?{Crit Range Expansion|0}]] ?? Hit:|[[@{Level}d10+@{STRDAM}+@{MeleeMagicDamBonus}+@{TempDamBonus}]] damage. --?? $Atk base &gt;= [[20-?{Crit Range Expansion|0}]] ?? Critical Hit:|[[(@{Level}d10+@{STRDAM}+@{MeleeMagicDamBonus}+@{TempDamBonus})*2]] damage. --?? $Atk base == 1 OR $Atk total &lt; [[@{target|Target1|MAC}]] AND $Atk base &lt; [[20-?{Crit Range Expansion}]] ?? Miss:|[[@{Level}+@{MeleeMagicDamBonus}+@{TempDamBonus}]] damage. }} Of Note: MAC, STRMOD, and STRDAM are all autocalculated values from the character sheet.
Oh, the initiative macros work great, though. Wanted to get that out there too. :-)
1432904018

Edited 1432904064
If it helps, this code does not cause an error (though the XPND now behaves oddly, expanding everything): !power --charid|@{character_id} --emote|Oswald casts Flame Spear at @{target|Target1|token_name}! --format|atwill --name|Flame Spear --leftsub|Ranged, At-Will --rightsub|Standard Action --Target|@{target|Target1|token_name} --Attack|[[ [XPND] 1d20+@{Level}+@{WISMOD}+@{SpellMagicAtkBonus}+@{TempAtkBonus}+@{tracker|Escalation Die}]] --PD|[[@{target|Target1|RPD}]] --Hit|[[5d8+@{WISDAM}+@{SpellMagicDamBonus}+@{TempDamBonus}]] fire damage.^^//**Natural Odd Hit:** One of your allies engaged with the target, if any, takes [[2d8+@{SpellMagicDamBonus}+@{TempDamBonus}]] fire damage.// --Miss|No effect. Results in:
1432914332

Edited 1432914584
I'm getting a similar crash with one of my macros. (Version 3.1.1) Error: evalmachine.&lt;anonymous&gt;:735 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ") ^ TypeError: Object 2 has no method 'replace' at processRoll (evalmachine.&lt;anonymous&gt;:735:36) at evalmachine.&lt;anonymous&gt;:622:22 at Array.forEach (native) at buildInline (evalmachine.&lt;anonymous&gt;:621:30) at evalmachine.&lt;anonymous&gt;:563:66 at Array.forEach (native) at evalmachine.&lt;anonymous&gt;:560:43 at checkFinishedOps ( Macro that causes the crash: !power {{ --tokenid|@{selected|token_id} --emote|Erandr taps his foe with his weapon, while a rune shines on the back of his hand. A coil of power comes out of it, surrounding his enemy. --title| Divine, Runic, Weapon --target_list|@{target| |token_id} --format|atwill --name|Word of Binding --leftsub|Standard Action --rightsub|Melee weapon --Target:|%%token_name%% --Attack:|[[ [$Atk] 1d20 + @{STR} + @{MProf} + @{Half_Level}]] vs AC --?? $Atk base &lt;&gt; 20 ?? Hit:|[[ [NH] @{MDam} + @{STR} + ?{1 for Defiant Word|0}*@{WIS}]] damage, and the target is immobilized until the end of your next turn or you aren't adjacent to it. --?? $Atk base == 20 ?? CRIT:|[[ @{MDam_Max} + @{STR} + ?{1 for Defiant Word|0}*@{WIS} ]] damage, and the target is immobilized until the end of your next turn or you aren't adjacent to it. --?? ?{0 for Rune of Destruction, 1 for Rune of Protection|} base == 0 ?? ^1Rune of Destruction| Before the end of your next turn, the next attack against a target from an ally deals [[@{WIS}]] extra damage. --?? ?{0 for Rune of Destruction, 1 for Rune of Protection|} base == 1 ?? ^1Rune of Protection| One ally adjacent to either you or the target gains a +@{WIS} modifier power bonus to AC until the end of your next turn. }} The other macros use the same conditionals but work as intended.
1432914739

Edited 1432916604
Ok, a couple of errors with the new update 3.1.1 ERROR evalmachine.:591 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ") ^ TypeError: Object 23 has no method 'replace' at processRoll (evalmachine.:591:36) at evalmachine.:478:22 at Array.forEach (native) at buildInline (evalmachine.:477:30) at evalmachine.:419:66 at Array.forEach (native) at evalmachine.:416:43 at checkFinishedOps ( From this Code !power {{ --whisper|self --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|DEFENSES --leftsub|@{Selected|Token_Name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!AC|[[@{selected|AC}]] **AC** [[@{selected|FORT}]] **FORT** [[@{selected|REF}]] **REF** [[@{selected|WILL}]] **WILL** }} The above was not crashing in the 3.0.6 release... Also, the [trkr] works good matching up the rolled number in chat to the turn order, but the name ends up being the players name set from the As: from the chat box. Here is the code I am using for initiative. !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --leftsub|@{selected|token_name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} As DM, I usually like the name in turn order to be the token_name for adding monsters to the turn order.
Just crashed the API script again with a simple power macro. ERROR MESSAGE evalmachine. :591 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ") ^ TypeError: Object 5 has no method 'replace' at processRoll (evalmachine. :591:36) at evalmachine. :478:22 at Array.forEach (native) at buildInline (evalmachine. :477:30) at evalmachine. :419:66 at Array.forEach (native) at evalmachine. :416:43 at checkFinishedOps ( MACRO CODE !power {{ --emote|@{selected|token_name} ♦ @{Selected|RACE} @{Selected|RACE|Max} --format|atwill --name|BITE --leftsub|At-Will --rightsub|Standard Action --Keywords|Fire --Range|Melee 2 --Target|One creature --Attack|[[1d20+12]] vs AC --Hit|[[2d10+6]] damage. The target is grabbed and takes ongoing [[5]] fire damage, or ongoing [[10]] fire damage if the dragon is bloodied, until the grab ends (escape DC 19). }}
Master MJ said: Just crashed the API script again with a simple power macro. ERROR MESSAGE evalmachine.:591 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ") ^ TypeError: Object 5 has no method 'replace' at processRoll (evalmachine.:591:36) at evalmachine.:478:22 at Array.forEach (native) at buildInline (evalmachine.:477:30) at evalmachine.:419:66 at Array.forEach (native) at evalmachine.:416:43 at checkFinishedOps ( MACRO CODE !power {{ --emote|@{selected|token_name} ♦ @{Selected|RACE} @{Selected|RACE|Max} --format|atwill --name|BITE --leftsub|At-Will --rightsub|Standard Action --Keywords|Fire --Range|Melee 2 --Target|One creature --Attack|[[1d20+12]] vs AC --Hit|[[2d10+6]] damage. The target is grabbed and takes ongoing [[5]] fire damage, or ongoing [[10]] fire damage if the dragon is bloodied, until the grab ends (escape DC 19). }} JB, I figured out what was causing this crash. Adding the [[5]] fire damage, under the --Hit| code, was causing the crash. When I changed it too **5** fire damage, it worked just fine. Also, I changed the [[10]] fire damage to **10** fire damage too...
Master MJ said: Ok, a couple of errors with the new update 3.1.1 ERROR evalmachine.:591 return { value: roll.expr.replace(/\+/g, " + ").replace(/\-/g, " - ") ^ TypeError: Object 23 has no method 'replace' at processRoll (evalmachine.:591:36) at evalmachine.:478:22 at Array.forEach (native) at buildInline (evalmachine.:477:30) at evalmachine.:419:66 at Array.forEach (native) at evalmachine.:416:43 at checkFinishedOps ( From this Code !power {{ --whisper|self --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|DEFENSES --leftsub|@{Selected|Token_Name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!AC|[[@{selected|AC}]] **AC** [[@{selected|FORT}]] **FORT** [[@{selected|REF}]] **REF** [[@{selected|WILL}]] **WILL** }} Also, the [trkr] works good matching up the rolled number in chat to the turn order, but the name ends up being the players name set from the As: from the chat box. Here is the code I am using for initiative. !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --leftsub|@{selected|token_name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} As DM, I usually like the name in turn order to be the token_name for adding monsters to the turn order. I think that this code is crashing the API because of the same problem from above. When there is a value inbetween [[ ]] it seems to crash the API.
Master MJ said: Here is the code I am using for initiative. !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --leftsub|@{selected|token_name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} As DM, I usually like the name in turn order to be the token_name for adding monsters to the turn order. MasterMJ, it looks like your code doesn't start with the --charid|@{character_id} in this case...I think that's necessary for initiative to be added properly based on some stuff HoneyBadger said above?
Master MJ said: When there is a value inbetween [[ ]] it seems to crash the API. Ah, okay, so maybe that's it on mine too. I have [[20]] in those codes where I show the critical hit range. So that's what HoneyBadger was talking about with the +0d0, maybe.
Robert M. said: Master MJ said: When there is a value inbetween [[ ]] it seems to crash the API. Ah, okay, so maybe that's it on mine too. I have [[20]] in those codes where I show the critical hit range. So that's what HoneyBadger was talking about with the +0d0, maybe. Yeah, I think that is correct. Robert M. said: Master MJ said: Here is the code I am using for initiative. !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --leftsub|@{selected|token_name} --rightsub|@{Selected|RACE} @{Selected|RACE|Max} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} As DM, I usually like the name in turn order to be the token_name for adding monsters to the turn order. MasterMJ, it looks like your code doesn't start with the --charid|@{character_id} in this case...I think that's necessary for initiative to be added properly based on some stuff HoneyBadger said above? Let me give that a try and see what it does...
1432918403

Edited 1432918497
Yup. I changed my crit line to remove the [[20]] and it worked. !power {{ --charid|@{character_id} --emote|Kaltion swings his maul at @{target|Target1|token_name}! --format|atwill --name|Big-BLEEP Maul --leftsub|Melee, At-Will --rightsub|Standard Action --Target|@{target|Target1|token_name} --Attack|[[ [$Atk|XPND] 1d20+@{Level}+@{STRMOD}+@{MeleeMagicAtkBonus}+@{TempAtkBonus}+@{tracker|Escalation Die}]] --AC|[[@{target|Target1|MAC}]] --Crit At|[[20-?{Crit Range Expansion|0}]] --?? $Atk base &gt; 1 AND $Atk total &gt;= [[@{target|Target1|MAC}]] AND $Atk base &lt; [[20-?{Crit Range Expansion|0}]] ?? Hit:|[[@{Level}d10+@{STRDAM}+@{MeleeMagicDamBonus}+@{TempDamBonus}]] damage. --?? $Atk base &gt;= [[20-?{Crit Range Expansion|0}]] ?? Critical Hit:|[[(@{Level}d10+@{STRDAM}+@{MeleeMagicDamBonus}+@{TempDamBonus})*2]] damage. --?? $Atk base == 1 OR $Atk total &lt; [[@{target|Target1|MAC}]] AND $Atk base &lt; [[20-?{Crit Range Expansion}]] ?? Miss:|[[@{Level}+@{MeleeMagicDamBonus}+@{TempDamBonus}]] damage. }} (censored this time) Results in: So now it's just the over-expanded roll. It used to show like: (17) + 12 = 29
1432918655

Edited 1432918774
Ok, I know how to fix that issue. Give me a few minutes and I'll have it updated. @Robert: Yeah, if you want to hide the full mess of numbers... you'll need to wrap them in a nested inline roll as below: --Attack|[[ [$Atk|XPND] 1d20 + [[@{Level} + @{STRMOD} + @{MeleeMagicAtkBonus} + @{TempAtkBonus} + @{tracker|Escalation Die} ]] ]]