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 .
×

macro problem to calculate a success

1662275092

Edited 1662277223
Hello to all, I am making my first macro and I have a small problem in its realization. &{template:default} {{name=@{selected|token_name} attaque au corps à corps @{target|character_name} }}  {{Jet d'attaque (@{selected|meleeweapon})=[[1d20>[[@{selected|finalmeleeattack}-@{target|finalmeleedefence}]]]]}}  {{Parade au bouclier=[[{1D6-@{target|shield}}<0]]}}  {{Transpercer armure (@{target|armour})= [[[[@{selected|meleeabr}]]>{@{target|totalaf}+1}]] }}  {{Dégâts=[[@{selected|meleedamage}]]}} The bold part should tell me if it's a success or not, but it tells me the result of the dice roll. @{selected|meleeabr} returns me for example 2D8 Can you help me to correct my mistake please?
You got the brackets you needed the wrong way round, plus some syntax for group roll comparison For the bold part try using [[{0d0,@{selected|meleeabr}}>[[@{target|totalaf}+1]] ]] That will compare the total rolled from meleeabr to (totalaf + 1)
1662489346

Edited 1662489612
Great, that's exactly what I wanted :-D Thanks a lot. I have another question. The code below is in 2 parts. The first one reminds the malus, the second one makes the caculs after indicating the modification due to the malus. Problem, the first part is displayed at the same time as the second. How to make that the help is displayed before ? &{template:default} {{name=Tableau de calcul des malus **@{selected|rangedweapon}**}} {{Courte distance Moyenne distance                            Longue distance Cible petite ou accroupie Déplacement lent Déplacement rapide Faible éclairage=0 (+0 à @{selected|weaponshortrange} m) +3 (@{selected|weaponshortrange} à @{selected|weaponmediumrange} m) +7 (@{selected|weaponmediumrange} à @{selected|weaponlongrange} m) +2 +2 +4 +3 ou davantage}} &{template:default} {{name=@{selected|token_name} attaque à distance @{target|character_name} }}  {{Jet d'attaque (@{selected|rangedweapon})=[[1d20>[[@{selected|finalrangedattack}-?{Modificateur|0}]]]]}}  {{Transpercer armure (@{target|armour})=[[[[@{selected|rangedabr}]]>{@{target|totalaf}+1}]]}}  {{Dégâts=[[@{selected|rangeddamage}]]}}
In order to not have them displayed at the same time they would have to be separate macros that you call individually.