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 .
×

Need help with a multiplier variable

Hello All Just stating i am garbage when it comes to programming code, just useless. Im just trying to do some of the leg work for my DM to get a macro to allow for an input table for multi target saving throw. As it stands my DM is opting for a single roll for multi save vs suck saving throws, and i hate that its literally all or nothing, when some is better than none. Anyways trying to google to see what i could find, i found a nice table setup on an old post from 8 years ago that serves its purpose. Credit to Mick H. &{template:default} {{name=?{Type of Save|DEX|STR|CON|WIS|INT|CHAR} Saving Throws}} {{Modifier=?{Modifier|+2}}} {{DC=?{DC|15}}} {{Victim 01=[[1d20?{Modifier}]]}} {{Victim 02=[[1d20?{Modifier}]]}} {{Victim 03=[[1d20?{Modifier}]]}} {{Victim 04=[[1d20?{Modifier}]]}} {{Victim 05=[[1d20?{Modifier}]]}} What I want to change but have no idea how is to instead of having the 5 victim rolls have a final input for how many victims, then it populates and numbers the victims as needed. i realise im taking the easy way just asking someone else to do this, but i dont know all the macro options to even hazard a guess. So any help would be appreciated.
This can not be done with just Macros... You need to use Scripts for that... Cody A. said: Hello All Just stating i am garbage when it comes to programming code, just useless. Im just trying to do some of the leg work for my DM to get a macro to allow for an input table for multi target saving throw. As it stands my DM is opting for a single roll for multi save vs suck saving throws, and i hate that its literally all or nothing, when some is better than none. Anyways trying to google to see what i could find, i found a nice table setup on an old post from 8 years ago that serves its purpose. Credit to Mick H. &{template:default} {{name=?{Type of Save|DEX|STR|CON|WIS|INT|CHAR} Saving Throws}} {{Modifier=?{Modifier|+2}}} {{DC=?{DC|15}}} {{Victim 01=[[1d20?{Modifier}]]}} {{Victim 02=[[1d20?{Modifier}]]}} {{Victim 03=[[1d20?{Modifier}]]}} {{Victim 04=[[1d20?{Modifier}]]}} {{Victim 05=[[1d20?{Modifier}]]}} What I want to change but have no idea how is to instead of having the 5 victim rolls have a final input for how many victims, then it populates and numbers the victims as needed. i realise im taking the easy way just asking someone else to do this, but i dont know all the macro options to even hazard a guess. So any help would be appreciated.
1691570735
Gauss
Forum Champion
Hi Cody, Yes you can do this but not in the fashion you are trying.  I would create 5 macros, then I would call them via a chat menu.  Each macro looks like the one you made above, but the number of Victims is different each time.  Macro 1 = one victim Macro 2 = two victims Macro 3 = three victims and so on.  Then you call the proper macro with a chat menu macro such as this one: &{template:default} {{name=number of victims}} {{=[Victim 1](~charactername|Victim1)[Victim 2](~ charactername| Victim2)[Victim 3](~ charactername| Victim3)[Victim 4](~ charactername| Victim4)[Victim 5](~ charactername| Victim5)}}
1691578445
GiGs
Pro
Sheet Author
API Scripter
Just to bring clarity from the last two posts. Markus is correct: you cannot do what you want without tha API. Roll20 cannot take a variable (number of targets) and populate its macro with just enough rolls for that variable. Gauss is also correct: you can achieve you goal via a workaround. Instead of a macro for how many targets, you can create separate macros for each specific number of targets, then choose between them via a chat button. It's also possible to go further and choose between them with a dropdown, but that is really not advised, wince it'll involve using html substitutions and trust me, you do not want to do that.
Thanks all, didnt even occur to do that, make individual macros with preset amount of victims, and just choose that. Thanks again :)