Junior Member
Join Date: Nov 2011
Posts: 7
|
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. |
#1 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
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.
|
#2 |
Junior Member
Join Date: Nov 2011
Posts: 7
|
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. |
#3 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
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 |
#4 |
Junior Member
Join Date: Nov 2011
Posts: 7
|
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. |
#5 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
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.
|
#6 |
Junior Member
Join Date: Nov 2011
Posts: 7
|
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. |
#7 |
Junior Member
Join Date: Nov 2011
Posts: 7
|
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? |
#8 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
This line is why:
Code:
hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value, bonus) 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 Code:
#applydr[xDamRd, 5] |
#9 |
Junior Member
Join Date: Nov 2011
Posts: 7
|
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. |
#10 |
|
|