It was necessary to turn them into variables like that for --titlefont and such to work. But thanks! :)GenKitty said:
HB, you wonderful fellow, you put all the fonts in one place for me to edit :> Here, have cookies!
!power --emote|@{selected|token_name} slashes at his foe with a @{selected|meleeweaponname1} --format|atwill --name|Melee Attack --leftsub|Action --rightsub|Reach 5 ft. --Attack|[[1d20 + @{selected|meleetohit1} [To Hit] + (@{selected|global_melee_attack_bonus}) [Active Melee Attack Bonus] ]] | [[1d20 + @{selected|meleetohit1} [To Hit] + (@{selected|global_melee_attack_bonus}) [Active Melee Attack Bonus] ]] vs AC [[@{Target|AC_calc}]] --Hit| [[@{selected|meleedmg1} [Base damage] + @{selected|meleedmgbonus1} [Damage Bonus] + (@{selected|global_melee_damage_bonus}) [Active Melee Damage Bonus] + 0d0 [Bugfix 0] ]] @{selected|meleedmgtype1} damage (if a crit add an extra [[@{selected|meleedmg1}]])
TypeError: Cannot read property 'atwill' of undefined at Object.PowerCard.Process
atwill: --txcolor|#FFF --bgcolor|#040and
atwill: --txcolor|#FFFFFF --bgcolor|#004400and got the same error each time.
TypeError: Cannot call method 'forEach' of undefined at processRoll (evalmachine.:2044:16) at evalmachine.:1957:16 at Array.forEach (native) at buildInline (evalmachine.:1956:27) at Object.PowerCard.Process (evalmachine.:1811:16) at evalmachine.:1637:59 at eval (For clarity, I have this in my handout:
atwill: --txcolor|#FFFFFF --bgcolor|#004400 encounter: --txcolor|#FFFFFF --bgcolor|#440000
daily: --txcolor|#FFFFFF --bgcolor|#444444
item: --txcolor|#FFFFFF --bgcolor|#e58900
recharge: --txcolor|#FFFFFF --bgcolor|#000044
That's my guess... since processRoll only specifically deals with inline rolls. It's hard for me to bugcheck macros like that, since there are so many character specific attribute calls in them. Not without being invited to the campaign and promoted to GM.Josh said:
Thats odd, because I copied and pasted it from a macro I have been using for months. Ill go through each and see if I can find the culprit.
!power --emote|1 slashes at his foe with a 2 --format|atwill --name|Melee Attack --leftsub|Action --rightsub|Reach 5 ft. --Attack|[[1d20 + 3 [To Hit] + (4) [Active Melee Attack Bonus] ]] | [[1d20 + 5 [To Hit] + (6) [Active Melee Attack Bonus] ]] vs AC [[7]] --Hit| [[8 [Base damage] + 9 [Damage Bonus] + (10) [Active Melee Damage Bonus] + 0d0 [Bugfix 0] ]] 11 damage (if a crit add an extra [[12]])Should let you test the format of the command without the characters.
The Aaron said:
Here is his command with just monotonically increasing numbers replacing the attribute references:!power --emote|1 slashes at his foe with a 2 --format|atwill --name|Melee Attack --leftsub|Action --rightsub|Reach 5 ft. --Attack|[[1d20 + 3 [To Hit] + (4) [Active Melee Attack Bonus] ]] | [[1d20 + 5 [To Hit] + (6) [Active Melee Attack Bonus] ]] vs AC [[7]] --Hit| [[8 [Base damage] + 9 [Damage Bonus] + (10) [Active Melee Damage Bonus] + 0d0 [Bugfix 0] ]] 11 damage (if a crit add an extra [[12]])Should let you test the format of the command without the characters.
The Aaron said:
There is a space after --Hit| , could that cause the issue? I know you mention that as a bad tag in the insturctions.
{ . "dice": 0, . "sides": 0, . "type": "R" }looking at how it gets passed in there...
The Aaron said:
The issue seems to be this roll object:{ . "dice": 0, . "sides": 0, . "type": "R" }looking at how it gets passed in there...
_.each(roll.results,function(result) {It happily ignores when that's not an array.
var PowerCard_Formats = (state.PowerCard_Formats && state.PowerCard_Formats[PowerCard.format] !== undefined) ? state.PowerCard_Formats[PowerCard.format].split("--") : ["txcolor|#FFF", "bgcolor|#040", "titlefont|Georgia", "subtitlefont|Tahoma"];
The Aaron said:
I'd suggestion changing all your .forEach() calls to _.each( [potential array], function(){} ).
It will protect your code against having bad arrays like that.
Underscore is really powerful, but I agree that their site is more of a reference manual than a tutorial! It took me forever to figure out what the heck their _.chain() function did, but now it's pretty much my go-to hammer. :)HoneyBadger said:
Cool... that worked. Easy fix. The underscore website isn't very helpful to me. I've tried reading it, but pretty much all my "skill" with javascript is gleaned from Qbasic, maptool macro stuff, and google.
The Aaron said:
I should probably write some cookbook type examples on the wiki for underscore...
Have at it! =)
DRB GM said:
I'm getting:
Unexpected token *
for any use of the script, even a simple !power --name|Test
Nevermind, was a conflict with a different script, deleting the comments fixed it but it's odd that it works find with the comments in place without powercards enabled.
Was it a multi-line comment at the end of the other script or something? All scripts get copied into one mega-script when you run the game.
Bo KH said:
I've tried the following: [[ [HR@{target|ArmorClass}] 1d20]]
It didn't work and I didn't expect it would work either, but the idea is great.
Imagine that your attackroll will be highlighted green when you roll equal or above the targets armor class and red below.
ReferenceError: obj is not defined
at doInlineFormatting (evalmachine.<anonymous>:1797:28)
at evalmachine.<anonymous>:1652:13
at Array.forEach (native)
at Object.PowerCard.Process (evalmachine.<anonymous>:1650:7)
at evalmachine.<anonymous>:1514:59
at eval (
!power --name|Scorching Burst --AoE|Close Burst 1 --VS|Reflex --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} --Target#?{Number of targets|1}|[[1d20+5]] vs %%Ref%% %%token_name%% --Hit|[[1d8+3]] fire damage
Vince said:
Note to self: the diamond graphic used between --leftsub|, --rightsub| gets replaced with " ♦ " when copying from the github raw. So don't.
GenKitty said:
Bug: attack array consistently skips first two targets when doing a multiattack. Below is my test macro. Skips targets 1 & 2. If I use more than N-2 targets for the attack array, I get %%Ref%% %%token_name%% printed instead on those lines.!power --name|Scorching Burst --AoE|Close Burst 1 --VS|Reflex --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} --Target#?{Number of targets|1}|[[1d20+5]] vs %%Ref%% %%token_name%% --Hit|[[1d8+3]] fire damage
I get an Unexpected identifier when I use the script (2.2.1) on the dev server.