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
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 1st, 2011, 10:24 AM
I'll admit I'm not the best with coding ahead of time, even if I can work with some referencing. Trick is that so far I haven't seen anyone who's coded in the Tome [Combat] feats, so I don't really have a means to compare.

Anyone unfamiliar with Tome [Combat] feats, basically it adds an extra effect as your Base Attack Bonus goes up; +0, +1, +6, +11, and +16 resulting in a proportionately useful bonus. What I'm trying to do is find out how to actually code them to function correctly when your BaB actually gets to these points. Anyone know how this might work? Using the 'Special' tab in the editor didn't seem to get the desired result.
LaughingProphet is offline   #1 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old December 2nd, 2011, 08:01 AM
I don't have the Tome so I'm unaware of what the feats do. However, you would want to create them in the Feats tab, with a script testing the BAB of a hero (hero.child[Attack].field[tAtkBase].value is the field right off the top of my head). Without more information, that's about all I can really help with.
Kendall-DM is offline   #2 Reply With Quote
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 3rd, 2011, 02:48 AM
The core effects on the feats are easy enough to handle, since several of the Community Database feats have coding that provide the desired effects. Some of the feats have effects that wouldn't need coding, as well [and some don't need coding at all, which speeds things up].

I just have no idea how to get it to properly check that the BaB is correct for the result before applying them due to having almost no experience whatsoever with custom coding. I'll use Great Fortitude [Combat] as an example on how the feats are generally laid out.

Great Fortitude [Combat]
Benefits of this feat are based on Base Attack Bonus.
+0: You gain a +3 bonus to your Fortitude Saves.
+1: You die at -20 instead of -10.
+6: You gain 1 hit point per level.
+11: You gain DR of 5/-.
+16: You are immune to the fatigued and exhausted conditions. If you are already immune to these conditions, you gain 1 hit point per level.

As further [Combat]-variant examples, Lightning Reflexes adds a +3 to Initiative at +11 BaB, Two-Weapon Fighting gives a +2 Shield Bonus to AC when dual-wielding at +6 BaB, Iron Will gives a Rogue's Slippery Mind ability at +1 BaB, ; The problem is a little less finding the proper coding for the effects [except maybe a few I could worry about later on], and more getting them to activate only under proper conditions.

Thankfully most of the feat effects otherwise wouldn't need coding, but the ones that DO have a result, like Blitz changing the BaB range from -5 every next attack [i.e. +15/+10/+5] to -2 [i.e. +15/+13/+11] at +6 BaB, would be quite difficult to keep track of if you had to apply each effect manually through the in-game Adjustments tab.
LaughingProphet is offline   #3 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old December 3rd, 2011, 01:56 PM
What you will have to do is make your own versions of each feat, and if you want them to replace the standard ones, you will have to use the Replace Thing ID field with the id of the feat you are replacing. That said, the rest is just a bit of coding. The relevant field to test against is the hero.child[Attack].field[tAtkBase].value that stores the base attack value.

Using the Great Fortitude above as an example, this just off the top of my head and mostly note coded:
Code:
~ Add bonuses for dependent on BAB, automatically gaining base effect.
if (hero.child[Attack].field[tAtkBase].value >= 1) then
   ~ Die at -20 instead of -10.
elseif (hero.child[Attack].field[tAtkBase].value >= 6) then
  ~ Give 1 hp/level.
elseif (hero.child[Attack].field[tAtkBase].value >= 11) then
  ~ Set damage reduction.
elseif (hero.child[Attack].field[tAtkBase].value >= 16) then
  ~ Immune to fatigue and exhausted.
endif
Something along those lines. Each of these particular effects gained that are a special, such as damage reduction, have to be bootstrapped to the feat to get them to work. This is a tricky thing to do, since each bootstrap has to know when its available, which usually requires conditions. Fortunately here, not much requires conditions, as long as you set the damage reduction in the script and not the bootstrap. However, the immunity to fatigue and exhaustion, if made a special, will need to have a way to know it is active. Because there are many kinds of effects gained on the many feats, it's far to difficult to give any good advice regarding how to do that for each case. I would look at the various methods Mathias has provided that simply applies the Helper.SpcDisable tag to the effect until it becomes available at the appropriate BAB. You picked a pretty tricky bit of coding to get to work over a wide variety of feats, it can be done, but it is going to take some work.
Kendall-DM is offline   #4 Reply With Quote
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 3rd, 2011, 05:39 PM
Thankfully since the Tome isn't a standard book that's already in, I'd need to make them all custom anyways, so I've got no worries on the need to set them up. No need on replacing them due to different tags keeping track of them.

Also thanks to the provided, very easily edited layout, I can cut it down for the ones that don't need coded tracking. I'll come back with my results if I can't get it working.
LaughingProphet is offline   #5 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old December 4th, 2011, 08:37 PM
Sorry, when I did that code off the top of my head, I put else statements in. If the effects are cumulative based on BAB, there would be no else statements, just a set of if-then statements. Sorry about that.
Kendall-DM is offline   #6 Reply With Quote
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 6th, 2011, 11:11 PM
Many thanks! Making the quick code provided me the line I needed to confirm BaB state, and mentioning Mathias got me the result I was looking for. [Might have had issues the first attempts because I was putting the requirement into the Bootstrap itself as opposed to the special's core coding. Whoops.]

Now all I have to do is find other feats with the desired effects and link them in. I might pop back in to check on a thing or two if I can't find coding that produces the desired effect [though with the mass of the Community Database that'll probably be a fairly limited list]. Thanks again.
LaughingProphet is offline   #7 Reply With Quote
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 12th, 2011, 02:45 PM
I always hate to double-post, but it's a bit necessary as I don't feel like it would be appropriate to start a new topic for essentially the same situation, and just editing my previous post would/could be too easily overlooked. Also not sure if I should really worry about this, but that's mostly irrelevant.

So I have the by-BaB-coding working just as I needed it to, so no issues there. However, there's two specific effects I'm trying to get that, for some reason, either don't work or I have no idea how to get them to work.

The one that inexplicably isn't functioning correctly is Great Fortitude's Damage Reduction; For some reason it will not stack with what's gained from levels like it's supposed to, though this may just be me not knowing how to edit it properly. It works BEFORE you gain DR from classes just fine, but won't stack, despite separate classes with DR x/- working fine otherwise.

Great Fortitude DR 5/-: Set at Post-Levels 10000, like the DR specials I used as a base.

Code:
~ If your BaB is 11 or higher, adjust total DR bonus.
if (hero.child[Attack].field[tAtkBase].value < 11) then
  perform assign[Helper.SpcDisable]
  done
endif

      ~ Adjust our total bonus
      var bonus as number
      bonus = 5
      bonus = round(bonus, 0, -1)
      field[CustDesc].text = "Damage Reduction (" & bonus & ") against weapons and natural attacks."
      hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value, bonus)

On the other hand, we have Blitz; I have no idea how to code its +6 BaB effect, and wanted to know if it was possible at all.

+6: Bonus attacks made in a Full Attack for having a high BAB are made with a -2 penalty instead of a -5 penalty.

Basically it just means it'd go from +15/+10/+5 to +15/+13/+11, as an example. Is that possible to display in Hero Lab?
LaughingProphet is offline   #8 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old December 12th, 2011, 04:17 PM
This line is why:

Code:
hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value, bonus)
When you get DR from a class, it is a pre-level timing, then you run this bit at post-level. So, it's taking the greater of the two values, the one already given by the class in the xDamRd value, or the bonus in the code. Furthermore, there is no reason to round the bonus down, as 5 rounded down still equals 5. It's not affecting anything, just saying.

One other note, Damage Reduction x/- can't be applied to a hero twice, because it is unique, and is, in general, not stackable. If you want it to actually stack, you want this line instead.

Code:
hero.child[xDamRd].field[Value].value += bonus
After looking at the feat above, the damage reduction from Great Fortitude is actually not stackable. If you intend to use it as stackable still, use the code above, otherwise use the following code for non-stacking in place of it. It is just a macro that does the same as taking the maximum.

Code:
#applydr[xDamRd, 5]
As for the Blitz ability, well, the coding for that kind of thing is handled internally by HeroLab. I don't know of any way off the top of my head that will do it. I would just make it a special that describes what it does. Then in the xSumm place the actual attack bonuses for a full attack ("<BAB>/<BAB - 2>/ ... ") up to the number of attacks based on that BAB. That's about all you can do with that one.
Kendall-DM is offline   #9 Reply With Quote
LaughingProphet
Junior Member
 
Join Date: Nov 2011
Posts: 7

Old December 12th, 2011, 04:41 PM
That'd explain that. Had a feeling it was just the wrong code but I wasn't too sure. Same with BaB being handled through core coding instead of filing. Makes Epic Feats VERY difficult to code when you're trying to add in Epic Weapon Focus and Specialization and the like when they do that.

Thanks for clearing those up. Also, quick sidenote, I was just checking through for another specific feat, namely Elusive Target. Gives a constant +2 Dodge Bonus to AC as its standard effect, and I've only been able to find dodge-bonus additives that take declaration. I can jury-rig some coding for that easily, I just can't find the tag for Dodge AC.
LaughingProphet is offline   #10 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:56 PM.


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