Member
Join Date: Dec 2009
Posts: 33
|
That worked perfect! I finally got my previous code to work somewhat, but the abilities listed have level requirements attached to them. So when I added Bardic Music +4 to a character who didn't have 15 levels of Bard, HL freaked. This works great, thanks!
As a side note, how do you know the timing? Is there a timing chart somewhere or just experience? |
#11 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Here's another thing that can help, and is something I did while getting this code together. You can use the debug command to help you make sure the numbers you are getting are correct. For instance, in trying to use the value field to create my variable, I had the wrong timing and my results were incorrect. So I used the following code: Code:
var bonus as number bonus = hero.child[xBrdMInsC].field[Value].value debug bonus |
|
#12 |
Member
Join Date: Dec 2009
Posts: 33
|
Wow that's a huge help, thanks!
Also, your second formula does not work, so I went back to the first. I think the problem lies in the math. I am unclear what hero.child[xBrdMInsC].field[Value].value is, because it's not the bard level for the character (it showed up as a value 20 at level 11). So, when dividing it by 5, the feat at some point adds 2 to the Inspire Courage (at level 11 he went from a +3 to a +5). |
#13 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
I chose to use that value instead of straight bard level since I wasn't sure if there would be other class levels that grant the ability. If that's not the case, you could try: Code:
bonus = round(#levelcount[Bard]/5 + 1, 0, 1) Last edited by Sendric; January 9th, 2013 at 09:12 AM. |
|
#14 |
Member
Join Date: Dec 2009
Posts: 33
|
Are you calculating that a bard gets a +1 every 5 bard levels to their inspire courage? Is that what the "/ 5" is from? Maybe that's where my confusion is, because they get a +1 at 1st, +2 at 8th, +3 at 14th, and +4 at 20th.
And yes, the character in question has levels in other things. He has a template (half Fey, ECL +2). It does not add to hit dice but does add to level. Yes he is wearing the vest of Legends and it is applying properly. |
#15 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
EDIT: Ok, I'm not finding a simple formula that works from levels 1-20, so I guess if you wanted to base it off the level field, you'd have to do something like this: Code:
if (hero.childfound[cBrdMInsC].tagis[Helper.ShowSpec] = 1) then var level as number var bonus as number level = hero.child[xBrdMInsC].field[Value].value bonus = 2 if (level >= 20) then bonus += 3 elseif (level >= 14) then bonus += 2 elseif (level >= 8) then bonus += 1 endif hero.childfound[xBrdMInsC].field[xName].text = "Bardic Music: Inspire Courage +" & bonus & "" endif Quote:
NOTE: Incidentally, you can learn more about the round command and other math things here. Its a Pathfinder thread, but at least some of those commands also apply to d20. Last edited by Sendric; January 10th, 2013 at 05:13 AM. |
||
#16 |
Thread Tools | |
Display Modes | |
|
|