Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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. |
#11 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
Very cool!, Thank you!!
|
#12 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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.
|
#13 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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. |
#14 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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" |
#15 |
Senior Member
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328
|
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 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. |
#16 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
What's your tertiary ability progression look like ("Modified Tertiary Ability")?
|
#17 |
Senior Member
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328
|
|
#18 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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 |
#19 |
Senior Member
Join Date: Oct 2010
Location: Cincinnati, OH
Posts: 328
|
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. |
#20 |
|
|