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

Coding Question

1430805214

Edited 1430805227
Hey guys, I have a player who is using Eldritch Blast. Their current code is: Creates [[((@{level} + 1) / 6 + 0.5)d1]] rays of fire to hit enemies with. 2nd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC Crit: [[1d10]] 3rd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC Crit: [[1d10]] 4th: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC Crit: [[1d10]] Is there anyway to make it so it does not show the extra rays if they do not use them but keep the code hidden?
The only way I can think of doing it would be with an API script.
not without a custom roll template from a character sheet...
1430809861

Edited 1430809884
Gen Kitty
Forum Champion
This looks to be a static number of rays, so just comment out the rays you don't need with // ? If it is a variable number of rays, I have a solution for that too.
1430837278

Edited 1430837340
You can use an API Hack to do it... it uses the exclamation point (!) character.... 1.) When the prompt comes up with the ! for an additional attack hit Enter if DO NOT want the additional attack to show. 2.) If you want the additional attack to show then hit Backspace to delete the ! and then hit Enter. /emas @{selected|token_name} creates [[((@{selected|Level} + 1) / 6 + 0.5)d1]] rays of fire to hit enemies with. ?{2nd|!} 2nd Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] ?{3rd|!} 3rd Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] ?{4th|!} 4th Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] Just make sure that all your query names match up to the character sheet.
1430850222
Gen Kitty
Forum Champion
Yep. That was the variable-number of rays solution I was going to propose. But the leading dice roll shows a STATIC number of rays, so the easier path is to just comment out the unneeded rays until the character is of the right level to have them.
Drohem said: You can use an API Hack to do it... it uses the exclamation point (!) character.... 1.) When the prompt comes up with the ! for an additional attack hit Enter if DO NOT want the additional attack to show. 2.) If you want the additional attack to show then hit Backspace to delete the ! and then hit Enter. /emas @{selected|token_name} creates [[((@{selected|Level} + 1) / 6 + 0.5)d1]] rays of fire to hit enemies with. ?{2nd|!} 2nd Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] ?{3rd|!} 3rd Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] ?{4th|!} 4th Attack: [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] | [[1d20+ @{selected|Charisma_Mod}+@{selected|PB}]] vs AC | Crit: [[1d10]] Just make sure that all your query names match up to the character sheet. This solution was not working for me, it just shows a "!" or not depending if you leave it in the input box.
1430889464
Lithl
Pro
Sheet Author
API Scripter
The roll queries need to be the very first thing on a line in order for this to work.
You mean i need to do it like ?{2nd|!} [[1d20 + @...]] :2nd attack "..." being the rest of that line
1430895944
Gen Kitty
Forum Champion
Yes.
Still isn't hiding it for me... to simplify it, only testing the second line... using this code currently: Creates [[((@{level} + 1) / 6 + 0.5)d1]] rays to hit enemies with. ?{2nd|!} [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC giving the output of when I leave a "!" in there: Creates 1 rays to hit enemies with. ! 20 | 9 vs AC giving the output of when I take the "!" out of there: Creates 1 rays to hit enemies with. 20 | 9 vs AC
1430938768
Gen Kitty
Forum Champion
Here is an easier macro to test with: Target 1: @{target|Target1|token_name} ?{target2|!} Target 2: @{target|Target2|token_name} I know this macro works because it is a part of a larger macro used by my spouse. However , I still say you're taking the more difficult path. You're never going to have a choice to how many blasts you have -- you're granted a level-dependent number of blasts, and i don't think anyone in the history of ever has chosen to not use all their possible blasts. The easier route is to comment out (prefacing a line with //) the blasts you can't yet access and remembering on level-up to update your macros. Creates [[((@{level} + 1) / 6 + 0.5)d1]] rays of fire to hit enemies with. 1st: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC Crit: [[1d10]] // 2nd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]] // 3rd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]] // 4th: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]]
1431060560

Edited 1431060958
GenKitty said: Here is an easier macro to test with: Target 1: @{target|Target1|token_name} ?{target2|!} Target 2: @{target|Target2|token_name} I know this macro works because it is a part of a larger macro used by my spouse. However , I still say you're taking the more difficult path. You're never going to have a choice to how many blasts you have -- you're granted a level-dependent number of blasts, and i don't think anyone in the history of ever has chosen to not use all their possible blasts. The easier route is to comment out (prefacing a line with //) the blasts you can't yet access and remembering on level-up to update your macros. Creates [[((@{level} + 1) / 6 + 0.5)d1]] rays of fire to hit enemies with. 1st: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC Crit: [[1d10]] // 2nd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]] // 3rd: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]] // 4th: [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] | [[1d20+ @{Eldon Leagallow|Charisma_Mod}+@{Eldon Leagallow|PB}]] vs AC // Crit: [[1d10]] OMG... i didn't even read that part where you said i can comment it out like that... i'm so sorry... that was all i really needed.. thanks lol edit: for the record, used that targeting macro. but still had the same results as before... maybe its because i'm using the 5e shaped? edit #2: the // for commenting isn't working either :(
I'm going to wager a guess here and say that the reason these solutions arnt working is that they require mentor status and the campaign Tim is playing on does not have a Mentor level GM
1431064501
Gen Kitty
Forum Champion
Neither of the suggestions given (commenting out and the API hack) require any level of subscription. At this point, it going to take someone physically going into his campaign and seeing what the heck is up.
He's probably pasted it into a class action field or maybe a macro and keeps using the button from the html character sheet instead.
I tested the macro before I posted it and it worked fine.
Drohem said: I tested the macro before I posted it and it worked fine. Yeah, it works as a macro, but not inside a spell. Even when I link the macro into the spell, it still does not work.