Senior Member
Join Date: Jul 2012
Posts: 416
|
I am trying to create a racial special that gives the option to add one of three bonus feats. I've got the racial special set up, and it displays the list of possible feats in the dropdown (usrCandID1 = thingid.fEndure | thingid.fGreatFort | thingid.fIronWill). I can select the item, but I'm not sure how to add the feats from the eval block via a script, or via 3 separate bootstraps, limited by conditions. Any ideas?
|
#1 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
Okay, so i found a way to work around this. Would have been a LOT easier if there was a way to create a bootstrap, or add a pick, whatever, from code, but here's how I did it.
My faction bootstraps a Racial Special (this is so i can have a chooser to pick which of the three bonus feats to acquire). The eval script in the Racial Special checks the chosen thing and stores a number for which one of the three it was in it's abValue field. Code:
var result as string result = this.field[usrChosen1].chosen.idstring if (compare(result,"fEndure")=0) then this.field[abValue].value=1 elseif (compare(result,"fGreatFort")=0) then this.field[abValue].value=2 elseif (compare(result,"fIronWill")=0) then this.field[abValue].value=3 else this.field[abValue].value=0 endif Code:
fieldval:abValue=1 Code:
fieldval:abValue=2 Code:
fieldval:abValue=3 |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
You maybe better off having the Faction add a extra feat and then causing an error if the correct feat for this faction is NOT taken. I am thinking this way would be allot easier to code. Pre-Levels/10000 Code:
~ Add to feats allowed #resmax[resFeat] += 1 This code goes into a "Pre-reqs" section. Code:
~ If we didn't get picked then we are valid for this test if (@ispick <> 1) Then @valid = 1 endif ~ Just get out if we didn't get picked doneif (@ispick <> 1) ~ Test for the existence of each feat below and if we found any of them ~ then we are valid. These ValidIf tests will ONLY run after we have ~ been picked and added to Hero. validif (#hasfeat[fEndure] <> 0) validif (#hasfeat[fGreatFort] <> 0) validif (#hasfeat[fIronWill] <> 0) Quote:
Code:
~ Don't do anything if nothing was chosen doneif (field[usrChosen1].ischosen <> 0) ~ So here we test for the Tag instead of doing a string ~ compare which is allot of over head If (field[usrChosen1].chosen.tagis[thingid.fEndure] = 1) Then ~ Notice that "This" is no longer required as its Assumed you ~ meant your dealing with the Pick we are running on. field[abValue].value = 1 elseIf (field[usrChosen1].chosen.tagis[thingid.fGreatFor] = 1) Then field[abValue].value = 2 elseIf (field[usrChosen1].chosen.tagis[thingid.fIronWill] = 1) Then field[abValue].vaue = 3 Endif ~ Notice nothing sets the value to 0 as 0 was set by HL initially so if nothing else ~ changes it then it will still be 0. 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. |
||
#3 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
Thanks for the input.. but I've already finished setting it up as I had - took some time, but it's done, no need to go in an change it now. I actually still like my method better from the player's standpoint, as it is more obvious where the extra feat is coming from, and what the choices are, much like the way a fighter's bonus combat feats are chosen on the Fighter tab, and not the Feat tab.
As for the coding method, I think i did have it using tags at some point - i think i moved towards using the idstring in some of my many fights with figuring out how to get the conditional to work. (I really wish the Bootstrap conditionals were scripted with @valid properties like Pre-req's are). Besides, I'd hate to be stuck with a computer slow enough to even notice the 'delay' to do the string compare. It bootstraps in the feat right now virtually instantly after selecting it from the background tab. I had tried so many ways, that once I got a method that worked, I just stuck with it and started spamming Duplicate... Last edited by Fuzzy; July 22nd, 2012 at 10:36 AM. |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Sorry I didn't get this in earlier, but have you tried the Configure tab in the editor - those can offer bonus feat selection tables. Just bootstrap the configurable from the ability, and then have the ability set the lists of potential feats to choose from.
|
#5 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
I think I looked there, because I did see the Bonus Feat section, but it also said Bonus Feats Per Level, so I'm not sure how to make it just once on character generation.
|
#6 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
Also, i did just try out bootstrapping a configurable from the Faction, and it spews up an error:
Code:
Live panel not found for thing 'cfgBonusF' Location: 'evalrule' script for Component 'Configure' (Eval Rule '#1') near line 12 |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Ignore the part that says "per level" - that was a mistake when cutting and pasting from some other tab.
Last edited by Mathias; July 22nd, 2012 at 12:19 PM. |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Quote:
|
|
#9 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
No worries, like said, i like the result of how i did this, just not the time it took to implement.
|
#10 |
|
|