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

Mistake in this macro ?

Hi, I'm a french newbie I try to do macro. Please do you see a mistake in this ? It is impossible to target ennemy with it. !power {{ --name|Rapière --Attaque:|[[ [$Atk] 1d20+3]] vs @{target|ac} CA --?? $Atk <= @{target|ac} ?? !Missed|**raté!** --?? $Atk > @{target|ac} AND $Atk.base <> 18 ?? Touché:|[[ [$Dmg] 1d6]] dommages perforants --?? $Atk >= @{target|ac} AND $Atk.base <> 18 ?? alterbar1|_target|@{selected|token_id} _bar|1 _amount|-[^Dmg] _show|GM --?? $Atk.base >= 18 ?? Critical Hit:|[[ [$CritDmg] 2d6]] dommages perforants }}
1706496531

Edited 1706496623
Andrew R.
Pro
Sheet Author
Since you are a newbie, I recommend you switch to ScriptCards instead of PowerCards immediately. ScriptCards is being actively developed by the same person who maintains PowerCards. You can run both while you switch over.  I will look at your PowerCards script and see what I can do to help. I’ll post again once I have something for you.  It would help if you told us what game system and character sheet you are using so I can replicate the environment for testing. 
Thx for your answer and for the advice The system is DD 5e It seems me that is the first character sheet avalaible when the site propose to create a new game.
D&D 5E by roll 20 for the name of character sheet
1706784645
Andrew R.
Pro
Sheet Author
I setup a test game with a Halfing Rogue PC and a Goblin NPC and a Macro Mule for your macro.  Removing the line that I think is trying to call the alterbar Mod, which isn't in the One Click Install, and correcting your use of the @{target} to get the right number for an NPC's bar2 AC value, it works OK.  !power {{ --name|Rapière --Attaque:|[[ [$Atk] 1d20+3]] vs @{target|foe|bar2} CA --?? $Atk <= @{target|foe|bar2} ?? !Missed|**raté!** --?? $Atk > @{target|foe|bar2} AND $Atk.base <> 18 ?? Touché:|[[ [$Dmg] 1d6]] dommages perforants --?? $Atk.base >= 18 ?? Critical Hit:|[[ [$CritDmg] 2d6]] dommages perforants }} I don't recommend automatically adjusting the NPC's bar1 HP value. I've been GMing with the API / Mods since 2015 and I've never needed that.  If you switch to ScriptCards, you can do it directly inside a ScriptCards macro, no Mod calls needed. It supports that itself. I'm writing a demo ScriptCards macro for you now. 
1706787167

Edited 1706787348
Andrew R.
Pro
Sheet Author
Here's a ScriptCard macro that does what the PowerCards macro above does. I don't play D&D 5e, but I think you have an error in your Conditionals for a regular hit and a critical hit.  !scriptcard {{ --#title|Rapière  --#emoteState|invisible --#targetToken|@{target|Foe|token_id} --=Attack|1d20 + 3  --=FoeAC|[*T:t-bar2_value]  --=Damage|1d6  --=CriticalDamage|2d6  --+Attaque:|[$Attack] vs [$FoeAC] CA  --?[$Attack] -le [$FoeAC]|[ --+raté!| --]| --?[$Attack] -gt [$FoeAC] -and [$Attack.Base] -ne 18|[ --+Touché:|[$Damage] dommages perforants --]| --?[$Attack.Base] -ge 18|[ --+Critical Hit:|[$CriticalDamage] dommages perforants --]| }}
1706790618

Edited 1706790868
Hi Yannick L Echoing Andrew R and his recommendation to switch to scriptcards, the Scriptcards wiki is excellent (and the Scriptcard Discord is VERY helpful) <a href="https://wiki.roll20.net/Script:ScriptCards" rel="nofollow">https://wiki.roll20.net/Script:ScriptCards</a> there is a longsword script there that forms the basis of any melee attack you might wish to create, which uses alterbars to amend Bar3, so just change that to whatever you use. The author of Scriptcards has a 5e Token Action Menu, which we use.&nbsp; It requires a few moments setup to adapt it to your preferences, but it is fantastic, basically a mini-charachter sheet in chat.&nbsp; We have it configured so the target AC is not shown to the players, so they can't meta-game
Thank you very much for your very usefull answers Simon G and Andrew R. I'm starting to try with scriptcard, and it's getting better.
1707011982

Edited 1707012008
Andrew R.
Pro
Sheet Author
You should follow the ScriptCards thread for updates, and post there for help, etc.,&nbsp; <a href="https://app.roll20.net/forum/permalink/11175456/" rel="nofollow">https://app.roll20.net/forum/permalink/11175456/</a> see you there!&nbsp;