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

Macro working from charsheet but not from quickbar?

Using the Pathfinder character sheet. Under class abilities, I make one with this macro code: &{template:pf_block} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{Class=**Class**: @{class-number}}} {{name=@{name}}} {{description = @{short-description}}} {{attack=**Ranged touch (30 ft)**: [[ 1d20cs>20 + [[ @{attk-ranged} ]] ]]}} {{damage=**Elettricity Dmg**: [[ 1d6 + [[ floor(@{class-0-level} / 2) ]] ]]}} If I use it from its own macro button (I mean the one in the same space where the ability details are entered), it works fine, but if I try to use it from the shortcut above (in the list of 0-26 class ability buttons), or drag & drop that shortcut to the quick bar, it only shows in chat the template, name of the ability and class, but not the rolls. What's wrong? How should I fix it?
%{selected|repeating_weapon_0_Attack}   should be all that's in your macro.  That "calls" the macro code from the repeating section.
Weapon attacks work fine, it's class abilities (which by default have no code about attack rolls, damage and such) that don't display the additional bits of code unless called from their very own button in the character sheet.
If your Class Ability has simple calculated rolls like a simple Channel Energy or something; you can place those as inline rolls in the Short Description and they will calculate on output.  Otherwise, for the full attack/critconfirm/damage/critdamage routine, you might be better off creating it in the Attack Section You might be able to change the Ability Code from pf_block to pf_attack, but that may not play nice either.
1449450519

Edited 1449450745
Inline rolls in short description do work, but they don't allow any kind of formatting (like a new line for each roll) and the whole thing looks cheesy. Also, beside the fact that I still don't understand why does the direct button works and the shortcut doesn't, what's the point of having a "Macro Text" field for each class ability, if you can't use it (well, unless you use it from the charsheet, but that defeats the whole purpose of shortcuts)? Also, I just noticed that whatever I put in the ("long") description field won't show, regardless if the macro is run from its button or from shortcut.
1449461376

Edited 1449461456
vÍnce
Pro
Sheet Author
Due to the way repeating sections work (which is changing in the next Roll20 update) there are two types of rolls on the sheet, the preset button bar that has it's macro "hard coded", that you cannot edit, but you can drag/drop and use the roll by it's button name.  It only includes @{repeating_class-ability_0_short-description} and the repeating section button.  To give you more control over your macro, you can use repeating section button and macro-text fields on the PF sheet to "customize" your macro.  You can edit the macro to include the full description by adding {{ description=@{description} }} in your macro text.  This is going to change soon.  With the update to repeating sections, the preset button bar is going to get removed from the sheet.  Repeating section buttons will be able to drag/drop and you can use their button name from within other macros.  If you want the logic built-into attacks, (crit_confirm and crit_damage) you have the use pf_attack roll template.
Alright, looks like this update will open all the fields I need.
I apologize for the double post, but maybe opening another discussion for this would be unnecessary: is there a way to define variables to use them further on in the code (or at least to reference to the result of a previous roll), and also a way to use some sort of if/else function? I've browsed the wiki a bit, but couldn't find such things. I'm asking to use them on the short description, as suggested above. My intention would be to define the result of a specific roll as a variable, and use that variable in an if/else case. For example (obviously not using Roll20's syntax but a made-up one for easy explanation purpose): Attack = 1d20 + str_mod + floor(class_level / 2); if(Attack > 15): "Hit" | "Miss";
1449532884

Edited 1449533000
Not without using a customized Roll Template or an API Script (access to the API is only available within games created by a Pro user). Regarding the latter, a PowerCard that does the above might look something like this: !power {{ --Attack|[[ [$Atk] 1d20 + @{str_mod} + floor(@{class_level} / 2) ]] -- ?? $Atk >= @{target|AC} ?? !|Hit -- ?? $Atk < @{target|AC} ?? !|Miss }}
Since no one in the group is a pro user, I tried dabbling with templates, but couldn't come up with a way to do those things in templates, only to use built-in predefined variables and functions. I mean, for example, using the attack template, there is a built-in function (that I can't see nor touch) that makes a crit confirmation roll appear if the attack roll was a critical success, but I can't switch it to appear if any other roll is a critical success (or anything else, for that matter).
1449600453

Edited 1449600609
Depending on the template being used, you might be able to opt to sacrifice that critical functionality in place of (half of) your own. For example, if a "critical" field normally only displays when 1d20cs>N resolves to be ≥ N, you could replace N with something like [[{@{target|AC} - (@{str_mod} + floor(@{class_level} / 2)), 2}kh1]] Then, that "critical" field will display on a hit (but not if a 1 is rolled on the d20), and not display on a miss. The full inline roll for the attack would look something like [[ 1d20cs>[[{@{target|AC} - (@{str_mod} + floor(@{class_level} / 2)), 2}kh1]] + @{str_mod} + floor(@{class_level} / 2) ]]
Uhm, wait, that will still make the critical info appear but not different kinds of things, or am I wrong? My main issue is that I'd like to make different kinds of roll (or info) appear. I guess one way would be setting crit-confirm and crit-damage to something different, but that would give me just two variable "slots" while also cutting a possible use of the actual crit function, and also the attack variable should be redesigned to whatever conditional roll is needed to display the additional stuff. Overall, a big number of troubles, unless the macro is very simple.
1449610049

Edited 1449610661
Apsu said: Uhm, wait, that will still make the critical info appear but not different kinds of things, or am I wrong? The contents (i.e. value) of the "critical" field, as with any field in any Roll Template, can be set to whatever you'd like. However, without editing the HTML of the Character Sheet that supplies the Roll Template, there wouldn't be a way to change the name of that field. And, yes, this would sacrifice the intended function of that field (you could opt to place the critical info in static tags that are always displayed). I agree that this is far from optimal, but it's probably the only way [to use logic to completely hide or display information] given your resources (or lack thereof).