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

3.5 macro question

i recently learned how to work with queries and i have an idea as to how 1 query can answer multiple bonuses but i dont know the functions for each of them. is there a list of functions somewhere that i can reference like floor() round() ceil() and what not so i can make my macros cleaner. i would also like to know how certain calculations would work like with close range being 25 +5/2levels rounding down to the nearest 5 and such?
1504040074
The Aaron
Pro
API Scripter
This is a good place to start:&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Math_Operat" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Math_Operat</a>...
okay i have found that and my new question is how can i round to the lowest 5 like for range on a close range spell 25ft.+5ft. per 2 caster levels. if i am level 2 it would result in a range of 30ft.
1504040770
The Aaron
Pro
API Scripter
Something along the lines of: Range: [[ 25 + 5*floor(@{level}/2) ]]
so the query i have is this &nbsp;{{Shield Bonus: [[4+?{Extra Points|0 Points,0|4 Points,1|8 Points,2|12 Points,3|16 Points,4|20 Points,5} ]] Shield Bonus to AC}} in the portion of the query that says like 4 points,1 i would like to calculate the 4 points plus the 1 point it costs to use the ability, and then remove it from a total number which is stored in a token bar. while i know that i cant take away from the actual token bar with out api access i can still access the number&nbsp; so the whole thing would be something like 29-[1(point to use the ability)+4(extra points to gain a +1)] brackets replaced by parenthesis obviously
1504044407
Andrew C
Marketplace Creator
{{Shield Bonus:= [[4+floor(?{Extra Points|0}/4)]] bonus to AC}} {{Power Points:= Points Used [[?{Extra Points}+1]]}} {{Current PP:=[[@{selected|attribute_that_holds_my_power_points} - [[?{Extra Points}+1]] ]] }}
god you guys are great at this thank you so much
okay running into a problem with this macro now i understand how the above macro works but now i am trying to incorperate it into an attack roll and need some help here is what i have tried &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh}+?{Extra Points|yes,0}/3} ]] |no,0 } ]] }}
basically what i need is a macro that does this &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh}+(a query that lets me use a number of points that then grants a +1 bonus for every 3 additional points used to augment the attack)]]}}&nbsp;{{Power Points:= Points Used [[?{Extra Points}+1]]}} {{Current PP:=[[@{selected|attribute_that_holds_my_power_points} - [[?{Extra Points}+1]] ]] }}
1504473757
Ziechael
Forum Champion
Sheet Author
API Scripter
&{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh}+ floor(?{Extra Points (+1 bonus/3 points)|0}/3) ]]}} {{Power Points:= Points Used [[?{Extra Points (+1 bonus/3 points)}+1]]}} {{Current PP:=[[@{selected|attribute_that_holds_my_power_points} - [[?{Extra Points (+1 bonus/3 points)}+1]] ]] }} Annotated the query too for ease of reference in play... nothing worse that using 2 points when you need 3! You could also solve with a drop down if it is capped: &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh}+ ?{Extra Points|0,0|3,1|6,2|9,3|12,4|15,5} ]]}} {{Power Points:= Points Used [[ (?{Extra Points}*3) +1]]}} {{Current PP:=[[@{selected|attribute_that_holds_my_power_points} - [[ (?{Extra Points}*3) +1]] ]] }}
while that works for the power, now i have another question. is it possible to nest this within another query like so ?{Offensive Precognition|yes, floor(?{Extra Points (+1 bonus/3 points)|0}/3) ]]}} {{Power Points:= Points Used [[?{Extra Points (+1 bonus/3 points)}+1]]}}|no,0}
1504539936

Edited 1504540033
Ziechael
Forum Champion
Sheet Author
API Scripter
Yup: ?{Offensive Precognition|yes, floor(?{Extra Points (+1 bonus/3 points)&amp;#124;0&amp; #125; /3) ]] &amp; #125;&amp; #125; {{Power Points:= Points Used [[?{Extra Points (+1 bonus/3 points) &amp; #125; +1]] &amp; #125;&amp; #125; |no,0}
okay so here is another problem with it, it does not display the damage i added in there when i choose no for the power(look at bottom right corner you might have to zoom in) &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20cs&gt;19+@{str-mod}+@{weapon1focus}+@{weapon1enh}+?{Offensive Precognition|yes,floor(?{Extra Points (+1 bonus/3 points)|0}/3)]]}} {{Damage=[[1d8+@{weapon1enh}+@{str-mod}+@{weapon1specialize}]]}} {{Power Points:= Points Used [[?{Extra Points (+1 bonus/3 points)}+1]]}}|no,0}]]}}
1504565560
Andrew C
Marketplace Creator
Something off going on here Jaekaido... {{Power Points:= Points Used [[?{Extra Points (+1 bonus/3 points)}+1]]}}|no,0}]]}}
well i just figured out a work around as i need something simpler anyways here is what i came up with &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20cs&gt;@{weapon1critmin}+@{str-mod}+@{weapon1focus}+@{weapon1enh}+?{Points used|none,0|6points,1|9 points,2|12 points,3|15 points,4|18 points,5}+?{Bonus to hit|0}]]}} {{Damage=[[1d8+@{weapon1enh}+@{str-mod}+@{weapon1specialize}+?{Bonus damage|0}]]}} {{Power Points Used=[[?{Points used}*3+1]]}} {{Current Points=[[@{selected|bar2}-(?{Points used}*3+1)]]}}
okay now where have i gone wrong the macro doesn't work and not all the queries are showing up before it rolls &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh}+?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +{Points used|none,0|+1,7|+2,10|+3,13|+4,16|+5,19}+?{Bonus to hit|0}]]}} {{Damage=[[1d8+@{weapon1enh}+@{str-mod}+@{weapon1specialize}+?{Power Attack Bonus?|0}[Pwr Attk] +?{Bonus damage|0}]]}} {{Power Points Used=[[?{Points used}]]}}
1504685658

Edited 1504685691
Ziechael
Forum Champion
Sheet Author
API Scripter
You are missing a '?' and your power attack query won't work as intended (as written it would have reduced damage rather than increased it), also your bonus to attack won't function as intended since the value returned is the points used, for a +1 answer you'll be getting a +7 to attack!!: &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh} -?{Power Attack BaB Sacrifice|0}[Pwr Attk] + ? {Points used|none,0|+1,7|+2,10|+3,13|+4,16|+5,19}+?{Bonus to hit|0}]]}} {{Damage=[[1d8+@{weapon1enh}+@{str-mod}+@{weapon1specialize}+ ?{Power Attack BaB Sacrifice } [Pwr Attk] +?{Bonus damage|0}]]}} {{Power Points Used=[[?{Points used}]]}} Not sure how to advise on the power points bonus as I'm not sure which power you are using or it's rules but the question mark will at least allow the query to fire :)
okay well the power is offensive precognition, which by spending one power point i gain a +1 insight bonus to attack. but i can spend more power point in the form of for every 3 power points i spend i get a additional +1 bonus. for example a +1 bonus would cost 1 power point, but a +2 bonus would cost 4 power points. there is also another augmentation that allows me to spend 6 points to use the power as a swift action.
1504708233
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, how about: &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike}} {{Attack=[[1d20+@{str-mod}+@{weapon1focus}+@{weapon1enh} -?{Power Attack BaB Sacrifice|0}[Pwr Attk] + 1 &nbsp;+ ? {Augmented (extra +1/3 pp used)|No,0|+2 to Attack,1|+3 to Attack,2|+4 to Attack,3|+5 to Attack,4} +?{Bonus to hit|0}]]}} {{Damage=[[1d8+@{weapon1enh}+@{str-mod}+@{weapon1specialize}+ ?{Power Attack BaB Sacrifice } [Pwr Attk] +?{Bonus damage|0}]]}} {{Power Points Used=[[ 1 + (?{Augmented (extra +1/3 pp used)}*3) + ?{Cast as swift (6 pp)|No,0 ]]: cast as a standard action.|Yes,6 ]]: cast as a swift action.} }}
okay let me send you a list of all the bonuses and stuff i am going to need for this character and this specific macro&nbsp; TO HIT BONUSES ROLL20 FORMULA Dice roll [[1d20]] Strength bonus @{str-mod} Weapon enhancement @{weapon1enh} Weapon focus @{weapon1focus} Offensive Precognition floor(?{Offensive Precognition|0}/3+1) Additional attack bonus ?{Additional ATK Bonus|0} Power attack -?{Power attack|0} DAMAGE BONUSES ROLL20 FORMULA Weapon damage [[1d8]] Strength bonus @{str-mod} Weapon enhancement @{weapon1enh} Weapon specialization @{weapon1specialize} Power attack (?{Power attack}*2) Offensive prescience floor(?{Offensive Prescience|0}/3+2) Additional damage bonus ?{Additional DMG Bonus|0} POWER POINT USAGE ROLL20 FORMULA Offensive precognition (?{Offensive Precognition}+1) Offensive prescience (?{Offensive Prescience}+1) Swift use of Offensive precognition ?{Swift Precognition|yes,6|no,0} Swift Use of Offensive Prescience ?{Swift Prescience|yes,6|no,0} Only get one swift action per turn query of Precognition and Prescience (can only choose one)
that is everything i am going to need for this macro and i hope to god we can figure this out though it might take some time, but of course if you do not have the time then i will try and figure it out on my own using the reference document and get help when needed
1504711648
Ziechael
Forum Champion
Sheet Author
API Scripter
So are you looking for a specific macro that allows you to roll an attack and calculate damage while also being able to factor in bonuses from the two psionic powers? Not a problem if so as it is totally doable but you will have multiple queries per attack even when not using the powers. This is fine if you are using those powers on practically EVERY attack (two-handed weapon as well I assume?). If the powers are occasional features then I would suggest having macros to output the power details to the chat (so that when used you can show the world what you are doing, what it does for you and how many pp it costs) and simply use the ?{other bonus} queries to reflect the mechanics of the powers to avoid query spam on every attack. Theoretically you could also do what you seem to want with a single query but it would have a list of options as long as your arm to cover all permeations but then you'd only have one query to answer... probably shouldn't have even mentioned that since that way madness lies... ;)
1504714875

Edited 1504715160
yes that is what i am looking for i am using a one handed weapon yes i will be doing this for every attack but i would only get one attack per round doing this but it will be worth it in the end as i have additional forms of damage as well that are occasional which will have separate macros for them all in all i need all that in one macro where i can answer each individual query unless you think this is madness in which case i will leave you alone and you can go about your life
1504728700
Ziechael
Forum Champion
Sheet Author
API Scripter
Haha, no worries... I love a challenge. Will take a look tomorrow and give you an idea of a 'full package' solution that you can reverse engineer. Besides, us 3.5ers have to stick together ;) If the volume of queries aren't an issue the next question would be: What are the default values you'd want for things like augmentation, will you ALWAYS want to do it as a swift action or are you more conservative with your pp usage?
the number of queries is not the problem, the problem is having all the information in a nice clean format that wont take like three or four rolls to accomplish um as far as defaults go both of the powers cost one point just to use but then can further augment for a +1/3 points used extra, and 6 additional points to use them as a swift action but i can only apply one power at a time so if i am having trouble hitting i can buff my attack bonus and if not i can focus on damage&nbsp; i am not too concerned about points cos it is going to be a while before it actually get to use this but when i do i would like to be able to use it rather than having to figure it out &nbsp;when i need it if that makes any sense
i should probably mention that this is an ability that i want on the character sheet
1504765451
Andrew C
Marketplace Creator
You can load that stuff into the weapon details if you are using Diana P's sheet.
1504783190
Ziechael
Forum Champion
Sheet Author
API Scripter
Ziechael said: (two-handed weapon as well I assume?). Jaekaido said: i am using a one handed weapon Ok cool, thought I'd best ask since your list had *2 on the power attack which only applies to two handed weapons or one handed weapons wielded with two hands... will see what I can come up with as an all inclusive macro for you.
thank you so much i really appreciate it
well forget the *2 as as i will be using a shield my understanding of power attack was wrong
1504796386
Ziechael
Forum Champion
Sheet Author
API Scripter
You mean you don't know ALL the 3.5e rules inside out?? ;) Might not get to this until tomorrow now, the schedule has gone a bit insane but I'll try to come up with something interesting as compensation for the wait...
1504796603

Edited 1504796702
yeah i am not that great at remembering things as i have a traumatic brain injury ;) i am not too worried i am still only level 2 so it will be a while before i can use it the way i want to anyway
1504866160

Edited 1504866171
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, if I were taking this approach I would likely do it as follows to limit the number of questions per time run: &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike using ?{Power Used|None,their full martial prowess&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[ 1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125;|Offensive Precognition,Offensive Precognition&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + [[ 1 + ?{Augmented (extra +1/3 pp used)&amp;#124;No&amp;#44;0&amp;#124;+2 to Attack&amp;#44;1&amp;#124;+3 to Attack&amp;#44;2&amp;#124;+4 to Attack&amp;#44;3&amp;#124;+5 to Attack&amp;#44;4&amp;#125; ]][Precog] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[ 1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Power Points Used:=[[ 1 + (?{Augmented (extra +1/3 pp used)&amp;#125;*3) + ?{Manifest as swift for 6 pp&amp;#124;No&amp;#44;0 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Standard Action&amp;amp;#125;&amp;amp;#125;&amp;#124;Yes&amp;#44;6 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Swift Action&amp;#125;&amp;amp;#125;&amp;amp;#125;|Offensive Prescience,Offensive Prescience&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + [[ 2 + ?{Augmented (extra +1/3 pp used)&amp;#124;No&amp;#44;0&amp;#124;+3 to Damage&amp;#44;1&amp;#124;+4 to Damage&amp;#44;2&amp;#124;+5 to Damage&amp;#44;3&amp;#124;+6 to Damage&amp;#44;4&amp;#125; ]][Presci] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Power Points Used:=[[ 1 + (?{Augmented (extra +1/3 pp used)&amp;#125;*3) + ?{Manifest as swift for 6 pp&amp;#124;No&amp;#44;0 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Standard Action&amp;amp;#125;&amp;amp;#125;&amp;#124;Yes&amp;#44;6 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Swift Action&amp;#125;&amp;amp;#125;&amp;amp;#125;} And here is it again but with line breaks to help make it easier to understand (this version will not work due to the line breaks): &{template:DnD35StdRoll} {{basicflag=true}} {{name=@{character_name}}} {{subtags=focuses on his strike using ?{Power Used|None, their full martial prowess&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[ 1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; | Offensive Precognition, Offensive Precognition&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + [[ 1 + ?{Augmented (extra +1/3 pp used)&amp;#124;No&amp;#44;0&amp;#124;+2 to Attack&amp;#44;1&amp;#124;+3 to Attack&amp;#44;2&amp;#124;+4 to Attack&amp;#44;3&amp;#124;+5 to Attack&amp;#44;4&amp;#125; ]][Precog] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[ 1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Power Points Used:=[[ 1 + (?{Augmented (extra +1/3 pp used)&amp;#125;*3) + ?{Manifest as swift for 6 pp&amp;#124;No&amp;#44;0 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Standard Action&amp;amp;#125;&amp;amp;#125; &amp;#124;Yes&amp;#44;6 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Swift Action&amp;#125;&amp;amp;#125;&amp;amp;#125; | Offensive Prescience, Offensive Prescience&amp;#125;&amp;#125; {{Attack=[[ 1d20 + @{str-mod} + @{weapon1focus} + @{weapon1enh} - ?{Power Attack BaB Sacrifice&amp;#124;0&amp;#125;[Pwr Attk] + ?{Bonus to hit&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Damage=[[1d8 + @{weapon1enh} + @{str-mod} + @{weapon1specialize} + ?{Power Attack BaB Sacrifice&amp;#125;[Pwr Attk] + [[ 2 + ?{Augmented (extra +1/3 pp used)&amp;#124;No&amp;#44;0&amp;#124;+3 to Damage&amp;#44;1&amp;#124;+4 to Damage&amp;#44;2&amp;#124;+5 to Damage&amp;#44;3&amp;#124;+6 to Damage&amp;#44;4&amp;#125; ]][Presci] + ?{Bonus damage&amp;#124;0&amp;#125; ]]&amp;#125;&amp;#125; {{Power Points Used:=[[ 1 + (?{Augmented (extra +1/3 pp used)&amp;#125;*3) + ?{Manifest as swift for 6 pp&amp;#124;No&amp;#44;0 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Standard Action&amp;amp;#125;&amp;amp;#125; &amp;#124;Yes&amp;#44;6 ]] &amp;amp;#125;&amp;amp;#125; {{Manifestation Time:= 1 Swift Action&amp;#125;&amp;amp;#125;&amp;amp;#125; }
you are absolutely amazing it has everything i need and in a nice clean format holy crap i am going to save this macro on my pc so you dont have to do this again and if anyone needs something like this please refer them to this as this is just perfect for what i wanted. THANK YOU SO MUCH!!! i wish i could do something in return for this but alas i don't have anything i can do :( if you can think of anything i can do please let me know!!
1504883198
Ziechael
Forum Champion
Sheet Author
API Scripter
No worries at all, I enjoy a good mental exercise as much as the next macro obsessed person. Chief caveat here is that those pesky html entities will revert if reposted in the forums or added as a macro which is then saved and reopened. As an ability on a sheet however you will be fine to dip in and out as much as needed (to update the damage die rolled for example). There is one thing you can do in return, continue gaming, encourage others to do the same and be excellent to your fellow humans from now and for ever more :)
i can do that