Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 21st, 2012, 01:45 AM
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?
Fuzzy is offline   #1 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 21st, 2012, 09:06 PM
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
I then have 3 bootstraps from the special, one for each of the possible feats. Each uses a Condition check that checks the abValue to determine whether to bootstrap in the feat.
Code:
fieldval:abValue=1
or
Code:
fieldval:abValue=2
or
Code:
fieldval:abValue=3
It's not elegant, but it does work for my usage. Setup time is going to take forever, as it's just a lot of duplicated effort (each of 22 regions has three feats. The feat thingid has to be entered 3 places (the choose list, the Eval Script, and the Boostraps). Plugging right along then...
Fuzzy is offline   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old July 22nd, 2012, 10:03 AM
Quote:
Originally Posted by Fuzzy View Post
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.
Using bootstraps and conditional bootstraps is one way of doing this.

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
Give a bonus feat so the person can choose a faction feat.

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)
The above is all done in one thing the Faction instead of multiple Things and you don't have to deal with bootstraps or conditional bootstraps. That would be my idea.


Quote:
Originally Posted by Fuzzy View Post
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
The above code is a little out of date and a will use up allot of CPU power. Here your code redone using a little more up to date methods. The important part is test Tags not strings and to do nothing if nothing was chosen.

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.
ShadowChemosh is offline   #3 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 22nd, 2012, 10:32 AM
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.
Fuzzy is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 22nd, 2012, 10:40 AM
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.
Mathias is offline   #5 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 22nd, 2012, 11:11 AM
Quote:
Originally Posted by Mathias View Post
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.
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.
Fuzzy is offline   #6 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 22nd, 2012, 11:19 AM
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
There is no UI it seems for this configurable to latch on to to provide the bonus feat. And I am not sure how to create said panel.
Fuzzy is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 22nd, 2012, 12:16 PM
Quote:
Originally Posted by Fuzzy View Post
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.
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.
Mathias is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 22nd, 2012, 12:18 PM
Quote:
Originally Posted by Fuzzy View Post
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
There is no UI it seems for this configurable to latch on to to provide the bonus feat. And I am not sure how to create said panel.
I apologize, the feats part of the configurable appears to be bugged right now.
Mathias is offline   #9 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old July 22nd, 2012, 07:10 PM
No worries, like said, i like the result of how i did this, just not the time it took to implement.
Fuzzy is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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 05:25 AM.


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