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

Trying to create a skill macro for Starfinder

January 18 (7 years ago)
Lessy
Plus
So long story short the Operative class in Starfinder gets a +1 bonus to all skill checks and initiative at level 1. This bonus increases to +2 at level 3, and gains another +1 for every four levels afterwards, so +3 at 7th, +4 at 11th, +5 at 15th and +6 at 19th. I'm trying to make a macro that will calculate this automatically based on my level, here's what I have so far, but it always gives me a result of 1 regardless of what I set class-0-level to;

[[1+((0d0+@class-0-level/3)ceil(0d0+@class-0-level/4+1)kh1)]]

The wisdom behind this is that at less then level 3 it will only be a 1. At level three it should be 2, and is overridden at level 7+, but I don't think got it right. Can anyone suggest a better way to do this? I need the bonus to be as follows for quick ref:

1st +1
3rd +2
7th +3
11th +4
15th +5
19th +6

Thanks in advance for any help.
January 18 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You are referencing the attribute incorrectly. Attributes are referenced by @{attribute-name}, so do @{class-0-level}
January 18 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
There's a simpler formula that should work:

[[ceil((@{class-0-level}+2)/4)]]
Since ceil() always rounds up, adding 2 to the level then dividing the total by 4 gives you a +1 at level 1-2, +2 at level 3-6, +3 at levels 7-10 and so on. 
January 18 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
seconding GG's simpler macro, and also realized your keep highest call was also incorrect:
[[1+{(0d0+@class-0-level/3),ceil(0d0+@class-0-level/4+1)}kh1]]
January 18 (7 years ago)
Lessy
Plus
Ah many thanks, that's perfect. The feedback is wonderful too, I always forget the {} to be honest.