Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
I just noticed Pathfinder has finally provided official clarification on the Trip weapon property, and I wanted to implement it.
My initial thought is to create clones of Trip weapons and add an Eval Script to add Weapon Focus and Enhancement Bonuses to the Trip value in my custom "Fixes.user" file. Another idea that seems more elegant would be to create an Eval Script that runs independent of a pick/thing. Is this possible, and if so, where do I define it? Last edited by Adam.Ormond; May 10th, 2011 at 11:33 AM. |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Yea I did that for when making the AA (ie Adventurer's Armory). So you could grab the script from community version at d20pfsrd if you wish. Personally I found in the end that it was not worth the effort actually.
I finally created a set of Adjustments instead and they are part of my Community add-on. You can see everything it does HERE. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#2 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
Ah -- I see... I did figure out how to get it to work in my custom weapon (code below), but it would be time consuming to implement this on every weapon -- I think my code is universal though.
Code:
var tripBonus as number var isHero as string isHero = this.container.ishero if (isHero = 1) then perform this.setfocus else perform parent.setfocus endif if (focus.field[gIsEquip].value = 1) then tripBonus = focus.field[BonEnhance].value if (focus.tagis[Broadcast.WepFocus] <> 0) then tripBonus += 1 if (focus.tagis[Broadcast.WepGrFoc] <> 0) then tripBonus += 1 endif endif endif hero.child[manTrip].field[manCMB].value += tripBonus Last edited by Adam.Ormond; May 10th, 2011 at 06:34 PM. |
#3 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
Thanks Shadow, that helped me iron out the last of my issues!
Is there a place to hook into HeroLab to create a hero/actor-level Eval Script? I'd really love to have it automatic for all maneuvers and weapons. |
#4 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
I think I figured out how to get an Eval Script hook into all characters.
|
#5 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
So I did two things:
1) Placed a bootstrap.aug file in my pathfinder directory with the following contents: Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <document signature="Hero Lab Structure"> <bootstrap index="276" thing="pFixWpnPrp"/> </document> Code:
var wpnFocus as number var wpnEnhBon as number var tripBon as number var tripTemp as number var disarmBon as number var disarmTemp as number foreach pick in hero where "IsWeapon.?" wpnFocus = 0 wpnEnhBon = 0 tripTemp = 0 disarmTemp = 0 perform eachpick.setfocus if (focus.field[gIsEquip].value = 1) then wpnEnhBon = focus.field[BonEnhance].value if (focus.tagis[Broadcast.WepFocus] <> 0) then wpnFocus = 1 if (focus.tagis[Broadcast.WepGrFoc] <> 0) then wpnFocus += 1 endif endif ~ Find Weapon Properties if (focus.tagis[wSpecial.Trip] <> 0) then tripTemp = wpnEnhBon + wpnFocus if (tripTemp > tripBon) then tripBon = tripTemp endif endif if (focus.tagis[wSpecial.Disarm] <> 0) then disarmTemp = wpnEnhBon + wpnFocus + 2 if (disarmTemp > disarmBon) then disarmBon = disarmTemp endif endif endif nexteach hero.child[manTrip].field[manCMB].value += tripBon hero.child[manDisarm].field[manCMB].value += disarmBon Last edited by Adam.Ormond; May 10th, 2011 at 08:21 PM. |
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
First want to say very nice and seems like you are catching on to HL very quickly.
Couple of small things. The first is you need to also take into account any Maneuver bonuses on top of the specific Maneuver value. You can do this using hero.child[Maneuver].field[tCMD].value though you will need to move back to Final Phase/20,500 to correctly use that. The script does not work with MW weapons which maybe an issue as nothing yet in HL tells us a item is MW or not. The only difference is how wAttBonus VS wBonus get set. If a character is not proficient you are not applying the -4 penalty. So a +5 Flail would still give +7 instead of +3 on Disarm rolls. Using your boostrap.aug method means you can't ever turn this feature off which is both good and bad. FYI using the For loop is very CPU intensive. You don't have to set focus on eachpick as it already is the focus. Just say eachpick.field[BonEnhance].value for example. The only thing why I wouldn't use your method is many of my players still use paper character sheets. Including myself when I game. So I like stuff that sets the value on the sheet for each weapon as I usually have more than one weapon on a character. If using HL during the game then this is really nice. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#7 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
Thanks for taking a look at what I came up with, SC! Just a couple questions, before I go ahead with fixes:
Quote:
Quote:
Code:
if (pos("Masterwork", eachpick.field[iCustSumm].value) <> -1) then wpnEnhBon += 1 endif Quote:
Quote:
Quote:
Quote:
Thanks again for all your help! |
||||||
#8 |
Senior Member
Join Date: May 2010
Location: Maryland
Posts: 167
|
Updated script to handle Masterwork weapons and Weapon Proficiency (this was harder than I expected!!). I'm not sure what you were referring to with your first comment, so I'll have to wait.
In my testing I did notice that spells such as Prayer and Bless do not grant bonuses to CMB, but they should. Subsequently, my script does not reflect those boni. Quote:
Code:
var proficient as number var wpnFocus as number var wpnEnhBon as number var tripBon as number var tripTemp as number var disarmBon as number var disarmTemp as number foreach pick in hero where "IsWeapon.?" proficient = 0 wpnFocus = 0 wpnEnhBon = 0 tripTemp = 0 disarmTemp = 0 ~ No need to do anything if this weapon isn't equipped if (eachpick.field[gIsEquip].value = 1) then wpnEnhBon = eachpick.field[BonEnhance].value ~ Could this be a masterwork weapon? if (wpnEnhBon = 0) then ~ Must have thingid.iMagWeapon tag to be masterwork if (eachpick.tagis[thingid.iMagWeapon] <> 0) then ~ Check the actName field for "Masterwork" substring if (pos("Masterwork",eachpick.field[actName].text) <> -1) then wpnEnhBon = 1 ~ Check the iCustSumm field for "Masterwork" substring elseif (pos("Masterwork",eachpick.field[iCustSumm].text) <> -1) then wpnEnhBon = 1 endif endif endif ~ What proficiency is required? if (eachpick.tagcount[wProfReq.?] = 0) then ~ This weapon requires no particular proficiency proficient = 1 ~ Is hero proficient with just this weapon? elseif (eachpick.heromatch[WepProf,WepProf,current] <> 0) then proficient = 1 ~ Is this weapon Exotic? elseif (eachpick.tagis[wProfReq.Exotic] <> 0) then ~ If we got here, Hero is not proficient with ~ this Exotic weapon - nothing to do. ~ Is this weapon Martial? elseif (eachpick.tagis[wProfReq.Martial] <> 0) then ~ Is Hero proficient with Martial weapons? if (hero.tagis[Hero.ProfMart] <> 0) then proficient = 1 endif ~ Is this weapon Simple? elseif (eachpick.tagis[wProfReq.Simple] <> 0) then ~ Is Hero proficient with Simple weapons? if (hero.tagis[Hero.ProfSimple] <> 0) then proficient = 1 endif ~ Unexpected wProfReq tag else debug "Unexpected proficiency requirement (" & eachpick.tagids[wProfReq.?,";"] & ") for " & eachpick.livename endif ~ Check for Weapon Proficiency if (proficient = 1) then ~ Check for Weapon Focus if (eachpick.tagis[Broadcast.WepFocus] <> 0) then wpnFocus = 1 ~Check for Greater Weapon Focus if (eachpick.tagis[Broadcast.WepGrFoc] <> 0) then wpnFocus += 1 endif endif else ~ Not proficient, lets levy a penalty wpnFocus -= 4 endif ~ Check for Trip Property if (eachpick.tagis[wSpecial.Trip] <> 0) then tripTemp = wpnEnhBon + wpnFocus if (tripTemp > tripBon) then tripBon = tripTemp endif endif ~ Check for Disarm Property if (eachpick.tagis[wSpecial.Disarm] <> 0) then disarmTemp = wpnEnhBon + wpnFocus + 2 if (disarmTemp > disarmBon) then disarmBon = disarmTemp endif endif endif nexteach hero.child[manTrip].field[manCMB].value += tripBon hero.child[manDisarm].field[manCMB].value += disarmBon |
|
#9 |
|
|