Dylan S. said: OK, so I've suddenly been getting issues with my Replacements Handout and related macros. This is one of the macros I had working until a few minutes ago. It's a master list of Martial weapons for when I don't have characters equipped with macros in their ability section. It uses a repeating attack section so that it can act as a template for multiple-attack macros. !power {{
--replaceattrs|T-|@{target|character_id}
--replaceattrs|S-|@{selected|character_id}
--replacement|?{Weapon|Battleaxe|+1 Battleaxe|+2 Battleaxe|+3 Battleaxe|Two-handed Battleaxe|+1 Two-handed Battleaxe|+2 Two-handed Battleaxe|+3 Two-handed Battleaxe|Flail|+1 Flail|+2 Flail|+3 Flail|Glaive|+1 Glaive|+2 Glaive|+3 Glaive|Greataxe|+1 Greataxe|+2 Greataxe|+3 Greataxe|Greatsword|+1 Greatsword|+2 Greatsword|+3 Greatsword|Halberd|+1 Halberd|+2 Halberd|+3 Halberd|Lance|+1 Lance|+2 Lance|+3 Lance|Longsword|+1 Longsword|+2 Longsword|+3 Longsword|Two-handed Longsword|+1 Two-handed Longsword|+2 Two-handed Longsword|+3 Two-handed Longsword|Maul|+1 Maul|+2 Maul|+3 Maul|Morningstar|+1 Morningstar|+2 Morningstar|+3 Morningstar|Pike|+1 Pike|+2 Pike|+3 Pike|Rapier|+1 Rapier|+2 Rapier|+3 Rapier|Finesse Rapier|+1 Finesse Rapier|+2 Finesse Rapier|+3 Finesse Rapier|Scimitar|+1 Scimitar|+2 Scimitar|+3 Scimitar|Finesse Scimitar|+1 Finesse Scimitar|+2 Finesse Scimitar|+3 Finesse Scimitar|Shortsword|+1 Shortsword|+2 Shortsword|+3 Shortsword|Finesse Shortsword|+1 Finesse Shortsword|+2 Finesse Shortsword|+3 Finesse Shortsword|Trident|+1 Trident|+2 Trident|+3 Trident|Two-handed Trident|+1 Two-handed Trident|+2 Two-handed Trident|+3 Two-handed Trident|War pick|+1 War pick|+2 War pick|+3 War pick|Warhammer|+1 Warhammer|+2 Warhammer|+3 Warhammer|Two-handed Warhammer|+1 Two-handed Warhammer|+2 Two-handed Warhammer|+3 Two-handed Warhammer|Whip|+1 Whip|+2 Whip|+3 Whip|Finesse Whip|+1 Finesse Whip|+2 Finesse Whip|+3 Finesse Whip|Blowgun|+1 Blowgun|+2 Blowgun|+3 Blowgun|Hand Crossbow|+1 Hand Crossbow|+2 Hand Crossbow|+3 Hand Crossbow|Heavy Crossbow|+1 Heavy Crossbow|+2 Heavy Crossbow|+3 Heavy Crossbow|Longbow|+1 Longbow|+2 Longbow|+3 Longbow}
--name|?{Weapon} Attack
--charid|@{selected|character_id}
--emote|@{selected|token_name} tries to hit @{target|token_name} with their ?{Weapon}!
--leftsub|Action
--hroll| [#[ [$Crit] 20 + ~S-PB$ + ~HitBonus$ + 0d0 ]#] [#[ [$res1] round(1e1*(~DCode$*@{target|Resistance} - floor(~DCode$*@{target|Resistance}))) + 0d0 ]#]
--target_list|@{target|token_id}
--Attack#1| [#[ [$atk] ?{Roll Type|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1|Crit Test, 20} + ~S-PB$ + ~HitBonus$ + 0d0 ]#] vs %%npc_ac%% AC (%%token_name%%)
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 00 ?? Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$Dmg1] ~BaseDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 00 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 00 ?? Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$CritDmg1] ~CritDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage
--?? $atk_1 == $Crit AND $res1 == 00 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg1] _show|none
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$resDmg1] ceil((~BaseDamage$+~HitBonus$)/2) +0d0 ]#] ~DType$ damage
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar3|_target|@{target|token_id} _bar|1 _amount|-[^resDmg1] _show|none
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MresDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage resistance!
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|-[^MresDmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$resCritDmg1] ceil((~CritDamage$+~HitBonus$)/2 +0d0)]#] ~DType$ damage
--?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-[^resCritDmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MresCritDmg1] ~CritDamage$+~HitBonus$ +0d0)]#] ~DType$ damage and overcome damage resistance!
--?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar6|_target|@{target|token_id} _bar|1 _amount|-[^MresCritDmg1] _show|none
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$immuneDmg1] ceil((~BaseDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar7|_target|@{target|token_id} _bar|1 _amount|-[^immuneDmg1] _show|none
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MimmuneDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity!
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar8|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneDmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$immuneCritDmg1] ceil((~CritDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage
--?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar9|_target|@{target|token_id} _bar|1 _amount|-[^immuneCritDmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MimmuneCritDmg1] ~CritDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity!
--?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar10|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneCritDmg1] _show|none
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 03 ?? Weakness Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$weakDmg1] ceil((~BaseDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage
--?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 03 ?? alterbar11|_target|@{target|token_id} _bar|1 _amount|-[^weakDmg1] _show|none
--?? $atk_1 == $Crit AND $res1 == 03 ?? Weakness Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$weakCritDmg1] ceil((~CritDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage
--?? $atk_1 == $Crit AND $res1 == 03 ?? alterbar12|_target|@{target|token_id} _bar|1 _amount|-[^weakCritDmg1] _show|none
--?? $atk_1 < ~T-AC$ ?? Miss 1 |You miss @{target|token_name} with your 1st attack.
--?? $atk_1 >= ~T-AC$ AND ~DType$ == bludgeoning ?? soundfx1:|_audio,play,nomenu|Cestus
--?? $atk_1 >= ~T-AC$ AND ~DType$ == piercing ?? soundfx3:|_audio,play,nomenu|Pierce Attack
--?? $atk_1 >= ~T-AC$ AND ~DType$ == slashing ?? soundfx4:|_audio,play,nomenu|Sword 3 by d100GM
--?? $atk_1 < ~T-AC$ ?? soundfx5:|_audio,play,nomenu|Miss SFX - Roll20 by Spikkle
--?? $atk_1 == $Crit ?? soundfx6:|_audio,play,nomenu,delay=0.5|A Singular Strike 2
}} This is how my replacements look. I have pretty much every weapon in the game and +1, +2,+3, and monk versions in a single handout. (The DCode stuff is for dealing with resistance/immunity/weakness). There are Attribute replacements nested inside these replacements which initially caused issues because of load order, but moving the Attribute replacements above the handout replacements did the trick up until recently. Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Two-handed Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Flail:AttackName|Flail;AType|STR;DType|bludgeoning;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e3 Glaive:AttackName|Glaive;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, reach, two-handed;DCode|1e1 Greataxe:AttackName|Greataxe;AType|STR;DType|slashing;BaseDamage|1d12;CritDamage|2d12;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, two-handed;DCode|1e1 I honestly have no clue what happened. 1. I added all of the monk weapons to the handout today and rewrote the above macro to query them instead of the martial weapons. 2. I ran a few tests which worked just fine. There was a slight problem with my own DCode stuff in the monk weapons from when I handled magical weapons differently. 3. I changed the DCode values for the monk weapons to be the correct values for bludgeoning weapons. 4. I tested the Monk Unarmed attacks that are not magical against an enemy who was immune to bludgeoning damage which worked just fine. 5. I tested the Monk Ki Empowered Unarmed Strikes to see if they would bypass the enemy immunity and the macro spit this out: PowerCards: "Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" 6. I tried to monkey with the spacing and looked for errors on my end. 7. Found that all of my macros that rely on the replacements handout give the same error. 8. Got frustrated and posted here. Note: I am running Alter Bars and Roll20AM and a few more scripts that aren't directly related to power card functionality (group initiative, chatsetattr, etc). Any help would be greatly appreciated. My first suggestion would be to copy the whole handout to the clipboard and paste it into NotePad++. If you made any changes to the handout inside the Roll20 editor, there are probably extra hidden characters in it that can throw things off. Look for any extra junk and then paste it back into the handout. The biggest clue here is this line: Could
not determine result type of:
[{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\"
+ 2 + ~HitBonus$ + 0d0 \"}]" Which seems to indicate that the HitBonus replacement value is not being set (otherwise it wouldn't be shown as ~HitBonus$ but rather the replacement value).