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

Chaos Bolt Almost Perfect

1739228478

Edited 1739228589
Hello, I have two players with access to Chaos Bolt. I found a solution from another post with credit to Oosh as found below:  {{name=Chaos Bolt (Select damage type)}}[[1t[[[1d8]]chaosbolt] ]] [[1t[[[1d8]]chaosbolt] ]]{{Damage=$[[0]] + $[[2]] + [[?{Spell level?|1}d6]]}} {{Damage Type 1 = $[[1]]}} {{Damage Type 2 = $[[4]]}} This included the creation of several roll tables with just one damage type. It works very well, however it does not total all damage and does not react to crit. I'm super novice to coding, is it possible to do so?
Which sheet is this? And what's the output of the tables, just the damage type names? It looks like you're putting this macro at the end of a spell description, but you didn't close out the description, so the rows don't quite come out right. If you give me those answers, I can probably improve that a bunch.
Thanks for stopping by. It is the Shaped 5e v19.3. The output of the tables are one damage type each as was recommended.         Let me know if you need more information! I appreciate the help. 
Alright, looking a bit more into this spell and the sheet, I can see the difficulty. If we use the dice rolls to control the tables, we can't sum them up - there's a hard rule that the parser can only iterate on each roll (including math-only rolls) once, and that includes using them in other rolls (including tables). In effect, all operations have to be linear. In addition, the template is not very forthcoming with the placement of the rows, making overwriting things difficult. But, here's what I could do - place this in the damage section of the attack, in the bonus field: [[ [[1t[chaosbolt] ]] + [[1t[chaosbolt] ]] + [[1d6 + ([[(@{higher_level_query_1} - 1) * 1]])d6]] ]] and this in the damage type field: = ($[[0.computed]]+$[[1.computed]]+$[[3.computed]]) And finally, make a single chaosbolt table, containing all the damage types, written as "1 [acid]", "2 [cold]", etc - no quotes. The roll takes the numbers from the table entries, and you can hover over the individual table rolls listed after the sum for the possible damage types. Unfortunately, the template doesn't seem to like tables in the critical damage row - for reasons I'm not quite certain of without digging a lot deeper, the inline roll for the attack roll gets unpacked if the critical damage field contains a table, and that breaks down the sheet's critical damage output - I recommend just clicking for the damage again (assuming that's how crits work on your table).
I wasn't quite happy with the solution I gave, so I sat back down and wrote something entirely overly complicated: }} {{[0](#" hidden)= }} {{[[[ {[[@{shaped_d20}@{d20_mod}cs>20@{spell_to_hit}]],0}=[[20@{spell_to_hit}]]*2]]](#" hidden)=[crit!](!/
%{@{character_name}|chaos-bolt-damage})[ ](#" hidden null=) }} {{[0]=[ ](#" hidden null=) }} {{[1]=[[1+1+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid damage, new attack![ ](#" hidden null=) }} {{[2]=[[1+2+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]]Cold or Acid damage[ ](#" hidden null=) }} {{[3]=[[2+2+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold damage, new attack![ ](#" hidden null=) }} {{[4]=[[1+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Fire damage[ ](#" hidden null=) }} {{[5]=[[1+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Force damage[ ](#" hidden null=) }} {{[6]=[[2+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Fire damage[ ](#" hidden null=) }} {{[7]=[[3+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire damage, new attack![ ](#" hidden null=) }} {{[8]=[[2+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Force damage[ ](#" hidden null=) }} {{[9]=[[1+5+ [[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Lightning damage[ ](#" hidden null=) }} {{[10]=[[3+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Force damage[ ](#" hidden null=) }} {{[11]=[[2+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Lightning damage[ ](#" hidden null=) }} {{[12]=[[1+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Poison damage[ ](#" hidden null=) }} {{[13]=[[4+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force damage, new attack![ ](#" hidden null=) }} {{[14]=[[3+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Lightning damage[ ](#" hidden null=) }} {{[15]=[[2+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Poison damage[ ](#" hidden null=) }} {{[16]=[[1+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Psychic damage[ ](#" hidden null=) }} {{[17]=[[4+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Lightning damage[ ](#" hidden null=) }} {{[18]=[[3+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Poison damage[ ](#" hidden null=) }} {{[19]=[[2+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Psychic damage[ ](#" hidden null=) }} {{[20]=[[1+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Thunder damage[ ](#" hidden null=) }} {{[21]=[[5+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning damage, new attack![ ](#" hidden null=) }} {{[22]=[[4+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Poison damage[ ](#" hidden null=) }} {{[23]=[[3+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Psychic damage[ ](#" hidden null=) }} {{[24]=[[2+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Acid damage[ ](#" hidden null=) }} {{[25]=[[5+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Poison damage[ ](#" hidden null=) }} {{[26]=[[4+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Psychic damage[ ](#" hidden null=) }} {{[27]=[[3+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Thunder damage[ ](#" hidden null=) }} {{[28]=[[6+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison damage, new attack![ ](#" hidden null=) }} {{[29]=[[5+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Psychic damage[ ](#" hidden null=) }} {{[30]=[[4+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Thunder damage[ ](#" hidden null=) }} {{[31]=[[6+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison or Psychic damage[ ](#" hidden null=) }} {{[32]=[[5+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Thunder damage[ ](#" hidden null=) }} {{[33]=[[7+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Psychic damage, new attack![ ](#" hidden null=) }} {{[34]=[[6+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison or Thunder damage[ ](#" hidden null=) }} {{[35]=[[7+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Psychic or Thunder damage[ ](#" hidden null=) }} {{[36]=[[8+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Thunder damage, new attack![ ](#" hidden null=) }} {{[[[{1,2,4,5,7,9,11,12,14,16,18,20,22,23,25,27,29,31,33,35,37,38,40,42,44,46,48,50,51,53,55,57,59,60,62,64}<[[1d64]] -1]]]=[ ](#) }} {{[0](#" hidden)=[ ](#" hidden null=) }} {{attack1=$[[0]] [ ](#" hidden null=) Place that in the spell content field, and the following chaos-bolt-damage &{template:5e-shaped} {{title=more damage[ ](#" hidden null=)}} {{[0]=[ ](#" hidden null=) }} {{[0]=[ ](#" hidden null=) }} {{[1]=[[1+1+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid damage, new attack![ ](#" hidden null=) }} {{[2]=[[1+2+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]]Cold or Acid damage[ ](#" hidden null=) }} {{[3]=[[2+2+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold damage, new attack![ ](#" hidden null=) }} {{[4]=[[1+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Fire damage[ ](#" hidden null=) }} {{[5]=[[1+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Force damage[ ](#" hidden null=) }} {{[6]=[[2+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Fire damage[ ](#" hidden null=) }} {{[7]=[[3+3+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire damage, new attack![ ](#" hidden null=) }} {{[8]=[[2+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Force damage[ ](#" hidden null=) }} {{[9]=[[1+5+ [[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Lightning damage[ ](#" hidden null=) }} {{[10]=[[3+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Force damage[ ](#" hidden null=) }} {{[11]=[[2+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Lightning damage[ ](#" hidden null=) }} {{[12]=[[1+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Poison damage[ ](#" hidden null=) }} {{[13]=[[4+4+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force damage, new attack![ ](#" hidden null=) }} {{[14]=[[3+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Lightning damage[ ](#" hidden null=) }} {{[15]=[[2+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Poison damage[ ](#" hidden null=) }} {{[16]=[[1+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Psychic damage[ ](#" hidden null=) }} {{[17]=[[4+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Lightning damage[ ](#" hidden null=) }} {{[18]=[[3+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Poison damage[ ](#" hidden null=) }} {{[19]=[[2+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Psychic damage[ ](#" hidden null=) }} {{[20]=[[1+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Acid or Thunder damage[ ](#" hidden null=) }} {{[21]=[[5+5+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning damage, new attack![ ](#" hidden null=) }} {{[22]=[[4+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Poison damage[ ](#" hidden null=) }} {{[23]=[[3+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Psychic damage[ ](#" hidden null=) }} {{[24]=[[2+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Cold or Acid damage[ ](#" hidden null=) }} {{[25]=[[5+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Poison damage[ ](#" hidden null=) }} {{[26]=[[4+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Psychic damage[ ](#" hidden null=) }} {{[27]=[[3+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Fire or Thunder damage[ ](#" hidden null=) }} {{[28]=[[6+6+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison damage, new attack![ ](#" hidden null=) }} {{[29]=[[5+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Psychic damage[ ](#" hidden null=) }} {{[30]=[[4+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Force or Thunder damage[ ](#" hidden null=) }} {{[31]=[[6+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison or Psychic damage[ ](#" hidden null=) }} {{[32]=[[5+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Lightning or Thunder damage[ ](#" hidden null=) }} {{[33]=[[7+7+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Psychic damage, new attack![ ](#" hidden null=) }} {{[34]=[[6+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Poison or Thunder damage[ ](#" hidden null=) }} {{[35]=[[7+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Psychic or Thunder damage[ ](#" hidden null=) }} {{[36]=[[8+8+[[1d6 + ([[@{higher_level_query_1} - 1]])d6]] ]] Thunder damage, new attack![ ](#" hidden null=) }} {{[[[{1,2,4,5,7,9,11,12,14,16,18,20,22,23,25,27,29,31,33,35,37,38,40,42,44,46,48,50,51,53,55,57,59,60,62,64}<[[1d64]] -1]]]=[ ](#) }} as an ability in the attributes & abilities tab of the same sheet. this is the output (don't mind the name, it'll use the spell name on the sheet). You'll just have to ignore the bracketed numbers - this is already slow to roll, a solution that would remove those numbers would be even slower.
Tuo said: ... You'll just have to ignore the bracketed numbers - this is already slow to roll, a solution that would remove those numbers would be even slower. You can speed up this roll by encourging the rolls to batch together If you change the first line from }} {{[0](#" hidden)= to }} [[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]] {{[0](#" hidden)= This will, generally, make all the random rolls be sent together instead of being spread across various timeout dependant batches
RainbowEncoder said: Tuo said: ... You'll just have to ignore the bracketed numbers - this is already slow to roll, a solution that would remove those numbers would be even slower. You can speed up this roll by encourging the rolls to batch together If you change the first line from }} {{[0](#" hidden)= to }} [[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]] {{[0](#" hidden)= This will, generally, make all the random rolls be sent together instead of being spread across various timeout dependant batches That is a very odd kind of optimization, but useful to know! Though placing it in the line with  }} {{[0]=[ ](#" hidden null=) as }} [[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]] {{[0]=[ ](#" hidden null=) maintains the attack roll's position in the roll index at 0, rather than offsetting it to 40.