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

[PF] Macro Help: Conditional Value H

Hello and thank you to anyone that can assist me with this following conundrum. Below I have linked an example of what I would like to modify: /me strikes with his Greatsword &{template:default} {{name=Melee Attack}} ♦ Hit:=[[1d20cs>19 + 2[STR] + 4[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] ♦ Dmg:=[[2d6 + 2[STR] + 0[WeaponBonus] + ?{DamageMod|0} ]] ♦ Confirm:=[[1d20cs>19 + 2[STR] + 4[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] ♦ Extra CritDmg:=[[2d6 + 2[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] What I want to know is if there is a way to hide the: ♦ Confirm:=[[1d20cs>19 + 2[STR] + 4[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] ♦ Extra CritDmg:=[[2d6 + 2[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] portion of the block at all times unless a crit occurs in this portion of the macro: ♦ Hit:=[[1d20cs>19 + 2[STR] + 4[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] I'm honestly at a loss as to how to make this occur if there is even a way to do so. I feel as though this is possible as the normal combat buttons that create attacks only show the critical confirmation score and damage value in this conditional hiding  way.
1497393513
The Aaron
Pro
API Scripter
The only way to accomplish this is with a custom Roll Template on a character sheet.  You don't have access to creating them without a Pro account, but Character Sheet authors make use of precisely this when they create their sheet output.
Ok but if I did make a Roll Template would I be able to use it in any game I play in or would it only work if the DM allowed my custom sheet? Essentially what I'm asking is this client side only so that I can use it in any and every game I play in (without having to go through another person) or is it decidedly limited in use to the few DM that would allow such a thing? Also if I create a custom Roll Template for a game that DM can my players also use it or would they all need to have Pro  accounts to do so?
1497402830
The Aaron
Pro
API Scripter
A Game can have only a single character sheet, only the default template and templates provided by the character sheet can be used in a Game. A Game can use any character sheet in the Roll20 accepted character sheets dropdown, unless it is a Game created by an active Pro subscriber in which case it can use a custom character sheet.  The practical upshot being its global on the game.  However, if you have access to the API (game created by active pro subscriber) then you can use an API script to do this sort of thing (PowerCards being a orine example). 
Well that's depressing. I can already imagine what I'll get when I ask a DM to use this custom sheet  XD well at any rate I do appreciate the information as it gives me much to contemplate. At the least this should be useful to give quality macro options to players in games I DM.
1497441881
Silvyre
Forum Champion
The existing Pathfinder Character Sheet has built-in  Roll Templates which conditionally hide critical hit information.
Do you know if I need to have a pro subscription to play with the built-in Roll templates?
1497488326

Edited 1497488370
Silvyre
Forum Champion
Nope, no subscription needed [to use any non-Custom Character Sheet which does not rely on an API Script]!
That's very useful. Is there a way to extract the code from the template? I would like to modify some of the generic attack roll buttons to serve me better.
1497493137
Silvyre
Forum Champion
There's two ways you could do that: Acquire the macro code of a clicked sheet button , or Locate the macro code within the sheet's HTML
Ok so I have a working idea now on how to manipulate the built in pathfinder templates but I would like some coding assistance as I'm missing something. So here is the new piece of code: &{template:pf_attack} {{name=Test Attack}} {{color=darkyellow}} {{Attack=[[1d20cs>19 + 3[DEX] + 1[BAB] +0[WeaponBonus] + ?{AttackMod|0}]] }} {{Damage=[[1d4 + 0[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] }}      {{confirm=[[1d20 + 3[DEX] + 1[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] }} {{Crit Damage=[[1d4 + 0[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] }} But I would like to add the helper function: {{#rollWasCrit() <Attack> }}      {{/rollWasCrit() <Attack> }} If im not mistaken it is this helper function that is responsible for hiding text until a Crit is detected. How do I make this work? When I've tried to add the function like this: &{template:pf_attack} {{name=Test Attack}} {{color=darkyellow}} {{Attack=[[1d20cs>19 + 3[DEX] + 1[BAB] +0[WeaponBonus] + ?{AttackMod|0}]] }} {{Damage=[[1d4 + 0[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] }}     {{#rollWasCrit() <Attack>  }}  {{confirm=[[1d20 + 3[DEX] + 1[BAB] +0[WeaponBonus] + ?{AttackMod|0} ]] }} {{Crit Damage=[[1d4 + 0[STR] + 0[WeaponBonus] + ?{DamageMod|0}]] }} {{/rollWasCrit() <Attack> }} I can't seem to make it work like this which is confusing for me. If your willing, can you explain where I've made my mistake?
1497572375
Silvyre
Forum Champion
Roll Template Helper Functions are coded within the HTML of a Character Sheet as a part of building the Roll Template. For example, the Pathfinder Sheet's HTML uses #rollWasCrit() to conditionally display the {{crit_confirm}} and {{crit_damage}} properties if and only if the {{attack}} property contains a critical success roll. All of these pf_attack Properties are case-sensitive, so you'll want to replace "{{Attack=" with "{{attack=", etc.
Ah my issue was case sensistivity. Now the code works and I truely do appreciate your help in this matter you where without question indispenceable.
I do have 1 last question. For the Pathfinder sheets the template is linked via: &{template:pf_attack} However this template does not seem to exist in the Pathfinder Simple Sheet. So my question is, does the Simple sheet offer a different template name such as &{template:generic} etc... so that I may use these macros on that sheet type.
1497578078

Edited 1497578251
vÍnce
Pro
Sheet Author
I don't believe the simple sheet uses roll templates, but a couple other PF sheets do. Pathfinder(neceros) <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>... Pathfinder(old) <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>... Pathfinder(cazra) <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>...
I assumed it used some kind of template as it has buttons that out put values in a formatted way.&nbsp;
1497588169

Edited 1497588675
vÍnce
Pro
Sheet Author
Arch Fline said: I assumed it used some kind of template as it has buttons that out put values in a formatted way.&nbsp; hmm, I did a quick look at the simple sheet's html( <a href="https://raw.githubusercontent.com/Roll20/roll20-ch" rel="nofollow">https://raw.githubusercontent.com/Roll20/roll20-ch</a>... ) and it didn't seem to include any type of roll template... &nbsp; I wonder if another sheet is being used as Pathfinder simple? &nbsp;Do you have a screen shot of the sheet you are using?
1497588387

Edited 1497588623
vÍnce
Pro
Sheet Author
Seems that Pathfinder Cazra is the new "Pathfinder Simple" sheet. I thought this sounded familiar. &nbsp;;-) Vince said: I think the "New" Pathfinder (simple) sheet is the Cazra sheet. You could PM Stephen L. (sheet author) or maybe make a public post with "Pathfinder Simple/Cazra" in the title for clarity. You can find the code here: <a href="https://github.com/Roll20/roll20-character-sheets/...Hope" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/...Hope</a> this helps. Cheers