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

[5E OGL] Inline @{global_skill_mod} method

Hi everyone! I was wondering if there was a way to apply the global skill mod in an inline roll. When I attempt this, it won't parse(? is that the word?) the @{selected|global_skill_mod} properly due to the attribute adding {{ }} or something in there. Because of this, it functions great when tacked onto simple templates making rolls, but not so well inline. I'm also aware of the @{global_skill_mod_field} which would work well, except that it will still add its value even when the global skill mod checkbox is toggled off. Is there an attribute for the state of global skill mod checkbox (that translates to 1 and 0 for on/off)? That way I may be able to multiply the result of the global_skill_mod_field by it to emulate the field being active/inactive, as a workaround. I don't have API access unfortunately. Here's an example of what I'm trying to get this to work with...I like the template allowing for flavor text and whatnot more than the simple roll: &{template:npcaction} {{normal=1}} {{rname=Skulking...}} {{name=*With heightened awareness, @{selected|character_name} attempts to conceal their presence...*}} {{description= **Stealth:** [[1d20+@{selected|stealth_bonus}[Stealth]+@{selected|global_skill_mod}[Global] ]] | [[1d20+@{selected|stealth_bonus}[Stealth]+@{selected|global_skill_mod}[Global] ]] **Perception:** [[1d20+@{selected|perception_bonus}[Percep]+@{selected|global_skill_mod}[Global] ]] | [[1d20+@{selected|perception_bonus}[Percep]+@{selected|global_skill_mod}[Global] ]] }} An inline method would be ideal but if there is another way like a simple template supporting multiple skill checks at once, feel free to mention it. Thanks for all the great macro help over the years all!
Stale A. said: Is there an attribute for the state of global skill mod checkbox (that translates to 1 and 0 for on/off)? Yep, it's @{global_skill_mod_flag}
1529810980

Edited 1529811400
Heya.  Thanks for the reply.  I think the @{global_skill_mod_flag} might control the toggle in the options for whether or not the global skill field is displayed, rather than activating/deactivating the effect of @{global_skill_mod_field} itself.
Ah, you're correct. Here's a little "hack" that should work for you: [[1 - @{global_skill_mod}1]] When global_skill_mod is unchecked, the inline roll resolves to equal 0 When global_skill_mod is checked, the inline roll will look like [[1 - {{global=[[@{global_skill_mod_field}]]}}1]], which resolves to equal 1 (ignores invalid syntax).
1529847939

Edited 1529852234
Oh that is clever! It works, thanks! Though I noticed if theres text afterwards, linebreaks are no longer supported.  In this case: &{template:npcaction} {{normal=1}} {{rname=Actioning...}} {{name=*@{character_name} flavor text...*}} {{description=**Stealth:** [[1d20+@{stealth_bonus}[Stealth]+[[([[@{selected|global_skill_mod_field}]]*[[1 - @{global_skill_mod}1]])]][Global]]] | [[1d20+@{stealth_bonus}[Stealth]+[[([[@{selected|global_skill_mod_field}]]*[[1 - @{global_skill_mod}1]])]][Global]]] **Line 2 text after line break** }} ...Will return something that shows an empty template box with "**Line 2 text after line break** }}" entered as plain text in the chatlog. Is there a way to continue a description on a new line after making this sort of inline roll?  Sorry I feel like I'm forcing a square peg into a round hole, but asthetically it'll allow for cleaner and more compact stuff on our chatlog. Edit:   html entity for a carriage return didn't work, but a slew of entities for spaces did in this case as it looks like this particular template has fixed dimensions.  Though still curious if there's a way to do a line break and more text and inline rolls, for flexibility
Stale A. said: Is there a way to continue a description on a new line after making this sort of inline roll? Try adding an additional pair of inline roll brackets: [[ [[1 - @{global_skill_mod}1]] ]]
I attempted to introduce and extra set of roll brackets as suggested: &{template:npcaction} {{normal=1}} {{rname=Actioning...}} {{name=*@{character_name} flavor text...*}} {{description=**Stealth:** [[1d20+@{stealth_bonus}[Stealth]+[[([[@{selected|global_skill_mod_field}]]*[[[[1 - @{global_skill_mod}1]]]])]][Global]]] | [[1d20+@{stealth_bonus}[Stealth]+[[([[@{selected|global_skill_mod_field}]]*[[[[1 - @{global_skill_mod}1]]]])]][Global]]] **Line 2 text after line break** }} But recieved the same error unfortunately.  (Both with and without the extra space between roll bracket sets) But it's okay. There's always the default or simple templates and other ways to do it if not possible.  Thanks for all the help Silvyre!
Cheers!