Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
DarokinB
Member
 
Join Date: Dec 2009
Posts: 33

Old January 9th, 2013, 07:25 AM
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?
DarokinB is offline   #11 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old January 9th, 2013, 07:40 AM
Quote:
Originally Posted by DarokinB View Post
As a side note, how do you know the timing? Is there a timing chart somewhere or just experience?
For pretty much anything, there's a way to look up the timing. In this case, go to your specials tab, right-click on "Bardic Music: Inspire Courage" and select "Show Debug Tasks". This shows you the timing of various scripts being run. It doesn't say exactly what's being done, of course. You'd have to go look at the code to know that, but doing this can help you make an educated guess about when you want to run your code.

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
I then went to the Develop menu -> Floating Info Windows -> Show Debug Output. When you save and "test now" the above, the debug window will show what number the variable "bonus" equals. Before I changed my timing, it was 0. Of course, you don't need to remove the rounding and other math from the equation as I did, but I do that to make sure I'm getting the right value before I start messing around with any math. That way I'll know for sure whether its a timing issue or a math issue.
Sendric is offline   #12 Reply With Quote
DarokinB
Member
 
Join Date: Dec 2009
Posts: 33

Old January 9th, 2013, 08:31 AM
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).
DarokinB is offline   #13 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old January 9th, 2013, 09:04 AM
Quote:
Originally Posted by DarokinB View Post
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).
Hmm....it worked ok for me at Bard levels 8 and 9. Is your character a straight Bard or does he have something else going on? Is he also wearing the Vest of Legends? I wonder if that could be changing it.

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)
Incidentally, if you take a look at the Bardic Music: Inspire Courage +1 (the base one) you'll notice it bootstraps the special xBrdMInsC and modifies the value field for that special in an eval script based on the character's bard level. I assume anything that improves the bard's ability or otherwise increases their effective level for the purposes of Inspire Courage would also increase that number. That way, in theory at least, it should stack with the vest so that a level 3 bard with both the vest and this feat should have Inspire Courage +3 (the same as a level 8 bard with just the feat).

Last edited by Sendric; January 9th, 2013 at 09:12 AM.
Sendric is offline   #14 Reply With Quote
DarokinB
Member
 
Join Date: Dec 2009
Posts: 33

Old January 9th, 2013, 12:08 PM
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.
DarokinB is offline   #15 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old January 10th, 2013, 04:49 AM
Quote:
Originally Posted by DarokinB View Post
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.
Not exactly, but now that I actually think about it, the math is flawed. I only looked at levels 1, 8, 14, and 20. Obviously that's the wrong approach. I'll take a second look at that.

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
Not as elegant as I'd like, but it should work pretty well assuming the level field is an accurate indicator of your bard ability level. If not, you can replace that with Bard levels as I did a few posts up.

Quote:
Originally Posted by DarokinB View Post
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.
I don't know much about the Half Fey template, but I wouldn't expect it to add to the character's Bard abilities.

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.
Sendric is offline   #16 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:32 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.