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
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old March 2nd, 2011, 12:17 PM
I did get this script to work for Mowgli as it appears that it was made for a class not a Archtype. So a few changes to get it to work correctly. Plus the first Weapon Training does work which makes later logic strange as you need to apply adjustments to everything but the first one.

Also note this was specifically changed to have a Fighter/Inquisitor work together. So the CustTaken.cHelpInq would need to be changed to what ever is the non-fighter base class.

Another note cUsedSp2nd is being set also to this archetypes specific use of having the fighter weapon training be the secondary ability.
Code:
      ~build up a tag expression to identify all weapon training abilities for
      ~this class
      var expr as string
      ~Change cHelpInq to be the class
      expr = "wFtrGroup.? & CustTaken.cHelpInq"
      ~first, make sure we have any weapon training abilities for this class.
      ~If we don't, there's nothing to do here.
      doneif (hero.haschild[BaseCustSp,expr] = 0)
      ~the best bonus available to all weapon training abilities is 1 at 5th level,
      ~+1 per 4 levels after that. If we don't have a bonus, we're done.
      var bonus as number
      ~ Set to the number of secondary Abilities actually taken
      bonus = hero.child[cHelpInq].field[cUsedSp2nd].value
      debug bonus
      var tagbonus as number
      ~We need to decrease the bonus to the 1st thing only as the first one
      ~is always calculating at least a value of 1.
      var nX as number
      nX = 1
      doneif (bonus = 0)
      ~go through all of our weapon training abilities in ascending order,
      ~giving a decreasing bonus to each.
      ~This removed as _CompSeq_ causes errors
      ~foreach pick in hero from BaseCustSp where expr sortas _CompSeq_
      foreach pick in hero from BaseCustSp where expr
        ~if our net bonus is 0 because we're run out of weapon types, we're
        ~done
        doneif (bonus <= 0)
        ~Decrease the first one bonus
        bonus -= nX
        ~set the bonus for this ability
        eachpick.field[abValue].value = bonus
        tagbonus = eachpick.field[abValue].value
        ~forward the weapon group tag we're assigned to the class a number of
        ~times equal to the bonus we're receiving
        if (eachpick.field[abValue].value >= 1) then
          var i as number
          var wepexpr as string
          var bonustag as string
          wepexpr = eachpick.tagids[wFtrGroup.?," | "]
          bonustag = eachpick.tagids[TrainBonus.?, ""]
          foreach pick in hero from BaseWep where wepexpr
            for i = 1 to tagbonus
              perform eachpick.assignstr[bonustag]
              next
            nexteach
          endif
        ~Add one back to bonus so other Things are correct
        bonus += nX
        ~Set to 0 so that we no longer remove one from the bonus value
        nX = 0
        ~our next ability has a bonus of 1 lower
        bonus -= 1
        nexteach

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   #11 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old March 2nd, 2011, 01:37 PM
Very cool!, Thank you!!
Frodie is offline   #12 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old March 2nd, 2011, 01:53 PM
Well the script works, but at 20th level there is a +10 to the first one, then a +9 and keeps going down with each one added.
Frodie is offline   #13 Reply With Quote
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old March 2nd, 2011, 04:28 PM
Well now the numbers go up, cool, but I get a bonus every other level. lol IDK, it seems like it just will not work with any other class. Well here is the script, maybe I am missing something.

~build up a tag expression to identify all weapon training abilities for
~this class
var expr as string
~Change cHelpInq to be the class
expr = "wFtrGroup.? & CustTaken.cHelpMdH"
~first, make sure we have any weapon training abilities for this class.
~If we don't, there's nothing to do here.
doneif (hero.haschild[BaseCustSp,expr] = 0)
~the best bonus available to all weapon training abilities is 1 at 5th level,
~+1 per 4 levels after that. If we don't have a bonus, we're done.
var bonus as number
~ Set to the number of secondary Abilities actually taken
bonus = hero.child[cHelpMdH].field[cUsedSp4th].value
debug bonus
var tagbonus as number
~We need to decrease the bonus to the 1st thing only as the first one
~is always calculating at least a value of 1.
var nX as number
nX = 1
doneif (bonus = 0)
~go through all of our weapon training abilities in ascending order,
~giving a decreasing bonus to each.
~This removed as _CompSeq_ causes errors
~foreach pick in hero from BaseCustSp where expr sortas _CompSeq_
foreach pick in hero from BaseCustSp where expr
~if our net bonus is 0 because we're run out of weapon types, we're
~done
doneif (bonus <= 0)
~Decrease the first one bonus
bonus -= nX
~set the bonus for this ability
eachpick.field[abValue].value = bonus
tagbonus = eachpick.field[abValue].value
~forward the weapon group tag we're assigned to the class a number of
~times equal to the bonus we're receiving
if (eachpick.field[abValue].value >= 1) then
var i as number
var wepexpr as string
var bonustag as string
wepexpr = eachpick.tagids[wFtrGroup.?," | "]
bonustag = eachpick.tagids[TrainBonus.?, ""]
foreach pick in hero from BaseWep where wepexpr
for i = 1 to tagbonus
perform eachpick.assignstr[bonustag]
next
nexteach
endif
~Add one back to bonus so other Things are correct
bonus += nX
~Set to 0 so that we no longer remove one from the bonus value
nX = 0
~our next ability has a bonus of 1 lower
bonus -= 1
nexteach

Last edited by Frodie; March 2nd, 2011 at 04:41 PM.
Frodie is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 2nd, 2011, 04:51 PM
Early on, when you set the expr variable, I think (in both your script and ShadowChemosh's), you want to set that to look for Helper.Quaternary (Helper.Secondary for ShadowChemosh) - without that, it's searching through all the custom abilities on the class, not just the Quaternaries.

Remember that primary abilities are defined as the absence of Helper.Secondary, Helper.Tertiary, and Helper.Quaternary tags (yes, I would change that if I had it to do over - a tag for everything).

expr = "wFtrGroup.? & CustTaken.cHelpMdH & Helper.Quaternary"
Mathias is offline   #15 Reply With Quote
Pezmerga
Senior Member
 
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328

Old December 20th, 2011, 01:37 AM
Trying to add weapon training to a bard with an archetype. For some reason it wants to increase the bonus too soon. At level 5 it is +1, at levels 6-8 it is +2. At level 9 when you select another category of weapons it stays at +2 and the new on is +1. It increases by 1 at level 10 and repeats this pattern.
Code:
Post Levels    10500
~build up a tag expression to identify all weapon training abilities for
      ~this class
      var expr as string
      expr = "wFtrGroup.? & CustTaken.cHelpBrd & Helper.Tertiary"  & linkage[varies].idstring

      ~first, make sure we have any weapon training abilities for this class.
      ~If we don't, there's nothing to do here.
      doneif (hero.haschild[BaseCustSp,expr] = 0)
~debug "Weapon training is being calculated for " & field[name].text

      ~the best bonus available to all weapon training abilities is 1 at 5th level,
      ~+1 per 4 levels after that. If we don't have a bonus, we're done.
      var bonus as number
      bonus = linkage[varies].field[cGiveSp3rd].value
      var tagbonus as number
      doneif (bonus = 0)

      ~go through all of our weapon training abilities in ascending order,
      ~giving a decreasing bonus to each.
      foreach pick in hero from BaseCustSp where expr

        ~set the bonus for this ability
        eachpick.field[abValue].value += bonus + 1 - eachpick.field[xIndex].value

        tagbonus = eachpick.field[abValue].value

        ~forward the weapon group tag we're assigned to the class a number of
        ~times equal to the bonus we're receiving
        if (eachpick.field[abValue].value >= 1) then
          var i as number
          var wepexpr as string
          var bonustag as string
          wepexpr = eachpick.tagids[wFtrGroup.?," | "]
          bonustag = eachpick.tagids[TrainBonus.?, ""]
          foreach pick in hero from BaseWep where wepexpr
            for i = 1 to tagbonus
              perform eachpick.assignstr[bonustag]
              next
            nexteach
          endif

        nexteach
I tried looking at sohei and here but nothing I do seems to matter. I changed it from secondary to tertiary to see if that was why but nothing... Wasn't sure if something about the bard's class makeup was causing this or if I was missing something.

This is the code I have to allow the groups to be chosen
Code:
Final Phase 999999
~our tertiary abilities table uses the fighter's primary abilities

linkage[varies].field[cCstS3Expr].text = "(SpecSource.cHelpFtr & !Helper.Secondary & !Helper.Tertiary & !Helper.Quaternary) & (thingid.cFtrWAxes | thingid.cFtrWLgtBl | thingid.cFtrWHvyBl | thingid.cFtrWBows | thingid.cFtrWClose | thingid.cFtrWCrsb | thingid.cFtrWDbl | thingid.cFtrWFirea | thingid.cFtrWFlail | thingid.cFtrWHamm |thingid.cFtrWMonk | thingid.cFtrWNatur | thingid.cFtrWPoleA | thingid.cFtrWSiege | thingid.cFtrWSpear | thingid.cFtrWThrow)"

Last edited by Pezmerga; December 20th, 2011 at 01:41 AM.
Pezmerga is offline   #16 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 20th, 2011, 09:06 AM
What's your tertiary ability progression look like ("Modified Tertiary Ability")?
Mathias is offline   #17 Reply With Quote
Pezmerga
Senior Member
 
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328

Old December 20th, 2011, 10:13 AM
Quote:
Originally Posted by Mathias View Post
What's your tertiary ability progression look like ("Modified Tertiary Ability")?
Same as a fighters.

Row 4: 1
Row 8: 2
Row 12: 3
Row 16: 4
Pezmerga is offline   #18 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 20th, 2011, 12:11 PM
I just noticed a problem - in your expression, you're tacking on the linkage[varies].idstring directly to the rest of the string. That should be creating this string:

"wFtrGroup.? & CustTaken.cHelpBrd & Helper.TertiarycHelpBrd"

But I don't understand why that isn't returning an error message - there are now more than 10 characters used in the Helper tag.

I'd recommend using

Code:
debug expr
to take a look at the expr variable, and make sure it's being set to what you want it to be. You can look at the debug information by going to the Develop menu...floating info windows...Show Debug Output.
Mathias is offline   #19 Reply With Quote
Pezmerga
Senior Member
 
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328

Old December 20th, 2011, 06:07 PM
I found the Show Debug output, but where do I execute the 'debug expr' code? I tried the eval script, but no dice.

Edit: I've been playing with the bonus variable...
Does bonus = linkage[varies].field[cGiveSp3rd].value look right to you? Something is giving the first weapon group selection a higher bonus than it should have.

Last edited by Pezmerga; December 20th, 2011 at 07:18 PM.
Pezmerga is offline   #20 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 12:34 PM.


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