Member
Join Date: Aug 2009
Posts: 55
|
This is likely easy. So I'm fully prepared to feel silly. And I have looked at the documentation but can't find clarity on this topic (I even braved the wiki...and quickly was befuddled.) So...
I'm trying to add a Combat Reactions tracker to my PF game. Every creature get's this tracker (I use it to manage AoO, Aid Another and other stuff). I believe I've got the eval script written correctly, but here it is for reference: Quote:
I have two problems. First, I can't make it show up. - I have checked the "Show in Tracked Resources List" in the charge information. - In the containerreq expression I have entered "source.CombReac", which is a source listed in the Sources tag as well. It compiles fine, but I can't make is show up. In case it matters, it's Unique ID is "trkCmbReac" and it is listed as Unique. Second, I'd like it to 'recharge' at the end of beginning of every round for every creature when using the Tactical Console if that is possible. Any help would be appreciated! I'd also like to know where to look to find these answers...teach a man to fish, ya know. Last edited by Micco; November 25th, 2009 at 09:52 AM. |
|
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
You created this as a tracker in the editor?
There's normally not a way to add a tracker directly to a character. They are intended as add-ons to other things in the program. That said, there's a way to do it if you're willing to edit the XML. Open the file where you've defined your tracker in an XML editor or notepad (not Word or other word processors - they'll add junk to the file that will make it unusable in HL) (There's a list of some XML editors near the beginning of the wiki). The tracker will start with: Code:
<thing Code:
</thing> <thing id="hCloudkill" name="Cloudkill" compset="Tracker" description="Kills 3 HD or less; 4–6 HD save or die, 6+ HD take Con damage."> <tag group="Helper" tag="SourceEqp"/> </thing> What you want to do is to add a new tag to it. Code:
<tag group="Helper" tag="Bootstrap"/> <thing id="hCloudkill" name="Cloudkill" compset="Tracker" description="Kills 3 HD or less; 4–6 HD save or die, 6+ HD take Con damage."> <tag group="Helper" tag="Bootstrap"/> <tag group="Helper" tag="SourceEqp"/> </thing> Hero Lab knows to add a single copy of everything with Helper.Bootstrap to every character. This is not something that users need for 99% of the things they'll want to add. It's only needed for universal house rules like this one. That's why it hasn't made it into the documentation. I know how I'll go about adding better support for house rules like this in the future, but I haven't been able to implement it yet. There's an easier way to get access to the value of the combat reflexes feat. The number of bonus AoOs is stored as field[abValue].value, so there's a macro to quickly access that: #value[fComRef] As an added benefit, if combat reflexes isn't present, that'll equal 0, so you don't even need to test for the feat first. Final 11000 Code:
var cr as number cr = (herofield[tAtkBase].value) / 5 field[trkMax].value += round(cr,0,1) + #value[fComRef] Since I see you're referencing combat reflexes with a different unique ID, you may have changed things. I'm afraid there's no way for things in the program to detect if the round has changed in the tactical console. |
#2 |
Member
Join Date: Aug 2009
Posts: 55
|
Quote:
Quote:
Quote:
Quote:
|
||||
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The Action Points tracker is unfortunately added to all characters by some of the legacy code left over from the d20 files, so that mechanism wouldn't also add a copy of it. Good idea to think of starting there, though, and if it did use the Helper.Bootstrap mechanism, it would have worked.
|
#4 |
Member
Join Date: Aug 2009
Posts: 55
|
Worked like a charm! Thanks again
For anyone interested, here is the corrected code I used. Not as elegant as Mathias's, and with way too many assignments in it, but I can debug it Code:
~ If Combat Reflexes feat then assign 1 to crfeat, otherwise 0. var crfeat as number crfeat = 0 crfeat += #hasfeat[fGRComRef] ~ Combat Reactions are (BAB+DEXMOD)/5 rounded up plus 1 if we have Combat Reflexes. var dxmod as number var cr as number ~ If Combat Reflexes, then get the ModBonus for DEX dxmod = hero.child[aDEX].field[aModBonus].value * crfeat ~ Add the ModBonus for DEX to the BaseAttackBonus and divid by 5 cr = ((hero.child[Attack].field[tAtkBase].value + dxmod) / 5) ~ Round up and add 1 to the total if the creature has Combat Reflexes cr = round(cr, 0, 1) + crfeat ~ Add to our total charges. field[trkMax].value = cr |
#5 |
|
|