Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 10:10 AM
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.
Adam.Ormond is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 10th, 2011, 11:59 AM
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.
ShadowChemosh is offline   #2 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 12:25 PM
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.
Adam.Ormond is offline   #3 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 03:49 PM
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.
Adam.Ormond is offline   #4 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 05:39 PM
I think I figured out how to get an Eval Script hook into all characters.
Adam.Ormond is offline   #5 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 07:46 PM
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>
2) Created an Adjustment thing named 'pFixWpnPrp' and set the Eval Script (Post-Levels/10000).
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.
Adam.Ormond is offline   #6 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 10th, 2011, 08:42 PM
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.
ShadowChemosh is offline   #7 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 10th, 2011, 09:20 PM
Thanks for taking a look at what I came up with, SC! Just a couple questions, before I go ahead with fixes:
Quote:
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.
Can you give a example of how I would test this to see that it currently fails? Are you referring to feats (Imp Trip), or something else?
Quote:
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.
Good Catch! What do you think about using this to address this problem:
Code:
if (pos("Masterwork", eachpick.field[iCustSumm].value) <> -1) then
  wpnEnhBon += 1
endif
Quote:
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
Another Good catch! Shouldn't be too hard to fix. Pretty sure there's a Broadcast tag or something I can look for related to Weapon Proficiency.
Quote:
FYI using the For loop is very CPU intensive
I tried to be as specific as I could with the tag I wanted to find -- is there a way to & tags together? Or does it really not matter much -- using a foreach is going to be intensive no matter how limited my resultset?
Quote:
don't have to set focus on eachpick as it already is the focus
Ah yeah -- that's an artifact from my custom-weapon implementation, when I had to step up to the iMagWeapon parent sometimes. That's an easy fix too.
Quote:
If using HL during the game then this is really nice.
Yeah, that's how I use it. It wouldn't be hard for me to modify the livename to include the info as well, so it'd show up on a printed character sheet.

Thanks again for all your help!
Adam.Ormond is offline   #8 Reply With Quote
Adam.Ormond
Senior Member
 
Join Date: May 2010
Location: Maryland
Posts: 167

Old May 11th, 2011, 07:30 AM
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.
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
Adam.Ormond is offline   #9 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 07:39 PM.


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