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

Script question

Hi team I hope this is the correct place. It has been a very long time since I used this script and this is for ADND initiative. The goal is to have a player roll initiative and then add modifiers. So for example a player rolls a d10 ands the 3 potential modfiers: - Weapon Speed - Spell casting time - Dex Bonus  So I roll with one example just the weapon speed but it doesnt add the mod - just displays the result of the initial die Here is the script &{template:default}  {{name=Initiative}}   /roll 1d10 + ?{Weapon Speed}  + ?{Spell} + ?{Dex} &{tracker} ?{What is your action} &{template:default} {{name=}}   Also, if I add two modifers example weapon speed of 5 and dex of -3 it only seems to add the first modifer. Any help would be greatly appreciated. Thanks Dave
1752833319

Edited 1752833473
Gauss
Forum Champion
Hi Dungeon Master,  Just to clarify, what you have above isn't a script. It is a macro. A Mod (API Script) would begin with an !  If you are using a script, please indicate which one.  Assuming it is a macro, I think the problem is the default template isn't finished. Here is what it should look like. Note: you cannot stick /roll inside a template, you need to use inline roll brackets [[ stuff ]] to make the roll.  &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed} +?{Spell} +?{Dex} &{tracker}]]}} Did you want the ?{What is your action} query to also be part of the template? If so that would look like this:  &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed} +?{Spell} +?{Dex} &{tracker}]]}} {{My Action=?{What is your action}}} If not you can just put it after the template and it will put that as text in the chat. Example:  &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed} +?{Spell} +?{Dex} &{tracker}]]}} ?{What is your action}
Many thanks!   Yes you are right sorry its a macro I used this format you suggested below looks much nicer in the format / template - it still displays the base roll and does not add the modifiers but may be doing something wrong my side. I appreciate the help. &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed} +?{Spell} +?{Dex} &{tracker}]]}} {{My Action=?{What is your action}}}
1752865155

Edited 1752867893
Gauss
Forum Champion
Dungeon Master said: Many thanks!   Yes you are right sorry its a macro I used this format you suggested below looks much nicer in the format / template - it still displays the base roll and does not add the modifiers but may be doing something wrong my side. I appreciate the help. &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed} +?{Spell} +?{Dex} &{tracker}]]}} {{My Action=?{What is your action}}} Are you filling out numbers for every query? You cannot skip past any of the queries with a blank spot.  Edit: Here is a modified version which will not let you put in any skipped values.  &{template:default} {{name=Initiative}} {{Initiative roll=[[1d10+ ?{Weapon Speed|0} +?{Spell|0} +?{Dex|0} &{tracker}]]}} {{My Action=?{What is your action}}}
Excellent! thanks - that worked. Much appreciated :)