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

doubt with critic

In the form I'm creating I use some fields for damage: base damage: attribute modifier: extra 1, extra 2, extra 3, extra 4, extra 5, extra 6, extra 7, extra 8 (these fields are for the player to include values that are not multiplied in case of a critical hit). What I need: Let the file ask if it was a critical hit: If not: add base damage + attribute modifier + extras (1, 2, 3, etc ...) If yes: rolls the base damage 2x and only then adds attribute modifier + extras (1, 2, 3, etc ...)
1598306103

Edited 1598306118
GiGs
Pro
Sheet Author
API Scripter
I cant supply a complete macro, because i dont know the base form of the macro. But you can put the base damage in brackets like this fake code: (@{base_damage} * ?{Critical?|Yes,2|No,1}) + attributes + extras
Hello GiGs! Thanks again for your support. I had arrived at this syntax that you posted but the problem is that and this syntax just doubles the result of the roll, in the system I use instead of multiplying the result of the damage by 2, it just doubles the amount of dice rolled. For example: Damage = 1d10 (base_damage) +3 (Strenght mod) + 1d6 (feat) Critical damage = 2d10 (base_damage) +3 (Strenght mod) + 1d6 (feat) What is doubled is the amount of dice rolled from the base damage.
1598391372
GiGs
Pro
Sheet Author
API Scripter
Your first post asked for a solution which doubled the total, which is why I posted that :) If you want to double the number of dice, its the same technique, you just move the query a bit earlier. It's always easier to answer questions like this if you post the actual macro you want to modify . Without the actual macro, the best i can do is show you how to modify this: Damage = 1d10 (base_damage) +3 (Strenght mod) + 1d6 (feat) to this Damage = ?{Critical?|No, 1|Yes, 2}d10 (base_damage) +3 (Strenght mod) + 1d6 (feat)
Hi GiGs! It is not actually a macro, it is some fields on the character sheet. The code is this: <input type=text name="attr_PERICIASArmasCrit" value="" placeholder="Ex.1d10" style="background-color:#E5E7E9; width:4em;"> <input type=text name="attr_moddano" value="" placeholder="+2" style="background-color:#E5E7E9; width:3em;"> <button type="roll" style="border:2px solid grey;background:transparent;color:Black;" value="&{template:daemon-iniciativa} {{name=@{character_name}}} {{arma=@{PERICIASArmasNome}}} {{Resultado=[[1d10+@{Agi_ori}+@{Agi_temp}+@{PERICIASIniciativa}&{tracker}]]}}"</button> <button type="roll" style="border:2px solid grey;background:transparent;color:Black;" value="&{template:daemon-ataque} {{name=@{character_name}}} {{atrib=@{PERICIASArmasNome}}} {{val-teste=@{PERICIAS-armatotal}}} {{Resultado=[[1d100]]}} {{Facil=[[ceil(@{PERICIAS-armaTotal}*2)]]}} {{Dificil=[[ceil(@{PERICIAS-armaTotal}/2)]]}} {{Critico=[[ceil(@{PERICIAS-armaTotal}/4)]]}}"</button> <button type="roll" style="border:2px solid grey;background:transparent;color:Black;" value="&{template:daemon-defesa} {{name=@{character_name}}} {{atrib=@{PERICIASArmasNome}}} {{val-teste=@{PERICIAS-deftotal}}} {{Resultado=[[1d100]]}}{{Facil=[[ceil(@{PERICIAS-defTotal}*2)]]}} {{Dificil=[[ceil(@{PERICIAS-defTotal}/2)]]}} {{Critico=[[ceil(@{PERICIAS-defTotal}/4)]]}}"</button> <button type="roll" style="border:2px solid grey;background:transparent;color:Black;" value="&{template:daemon-dano} {{name=@{character_name}}} {{Pericia=@{PERICIASArmasNome}}} {{Dano=[[@{PERICIASArmasCrit}]]}} {{bonusdano=[[@{moddano}]]}} "></button> <div> <input type="checkbox" class="sheet-toggle-show" /> <span>Extras</span> <div class="sheet-body"> <input type="text" name="attr_nomeextra1" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra2" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra3" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra4" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra5" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra6" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra7" style="width:7em;" value=""/> <input type="text" name="attr_nomeextra8" style="width:7em;" value=""/> <br> <input type=number name="attr_valextra1" value="0" style='width: 7em;'> <input type=number name="attr_valextra2" value="0" style='width: 7em;'> <input type=number name="attr_valextra3" value="0" style='width: 7em;'> <input type=number name="attr_valextra4" value="0" style='width: 7em;'> <input type=number name="attr_valextra5" value="0" style='width: 7em;'> <input type=number name="attr_valextra6" value="0" style='width: 7em;'> <input type=number name="attr_valextra7" value="0" style='width: 7em;'> <input type=number name="attr_valextra8" value="0" style='width: 7em;'> </div> </div> In the field attr_PERICIASArmasCrit the player types the damage of the weapon, which can be anything (1d6, 1d10, 1d8, 2d4 ...), in the field attr_moddano the player types the attribute modifier that is added to the damage (usually a strength modifier ). In the fields attr_nomeextra and attr_valextra (1, 2, 3, etc ...) the player types the name and the value (which can be absolute numbers or dice) of the feat that will be added in the final damage but that is not multiplied in case of a critic. Studying his scripts I can sum up all the values (attr_PERICIASArmasCrit, attr_moddano, attr_nomeextra and attr_valextra) but I don't know how to make him check if he is a critic and, in this case, roll 2x only the basic weapon damage (attr_PERICIASArmasCrit)