Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old January 3rd, 2018, 11:17 AM
I've successfully modified the Human/Half-Elf Shaman FC bonus to select 1 cleric spell and add it to the known spells to filter out Words of Power. However, it would be nice if it also filtered out previously selected spells. Here is what I have now. I'm running it in a mechanic script so I don't have to edit the 2 picks directly, which is the point of the loop:

Quote:
~ Check for all Human or Half-Elf Shaman favored class selections and update the dropdown
foreach pick in Hero from FavClass where "thingid.fcShaHuman | thingid.fcShaHElf"
~generate the expression saying what spells we're able to search for
~we're looking for spells that are cleric spells but not shman spells and are of a level we can cast
~ Valdacil: but we need to filter out Word of Power
eachpick.field[usrCandid1].text = "component.BaseSpell & !component.BaseWord & sClass.cHelpClr & !sClass.cHelpSha & (val:sLevel.? < " & hero.childfound[cHelpSha].field[cMaxSpLev].value & ")"
nexteach
I know that once a spell is added, the hero gets a tag KnowSpell.? where ? is the tag of the spell selected. My question is whether the usrCandid1 can be modified above to filter out spells the hero already knows.
Valdacil 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 January 3rd, 2018, 11:42 AM
Assuming that KnowSpell.? is present at the timing you need you can add the following logic:

Code:
& " & !(" & hero.tagids[KnowSpell.?,"|"] & ")"
that can be added to the end of your custom expression. hero.tagids[] builds a list of all the KnowSpell ids on the hero and if multiple tags found it separates each with a | symbol which is 'OR'.

To be clear it becomes this:
Code:
eachpick.field[usrCandid1].text = "component.BaseSpell & !component.BaseWord & sClass.cHelpClr & !sClass.cHelpSha & (val:sLevel.? < " & hero.childfound[cHelpSha].field[cMaxSpLev].value & ")" & " & !(" & hero.tagids[KnowSpell.?,"|"] & ")"

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
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old January 3rd, 2018, 12:32 PM
The code you posted seems to make sense, however, when i plug that in, I seem to get every spell in the game in the selection list including numerous entries for some spells that are on multiple spell lists.
Valdacil is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old January 3rd, 2018, 02:01 PM
Quote:
Originally Posted by Valdacil View Post
The code you posted seems to make sense, however, when i plug that in, I seem to get every spell in the game in the selection list including numerous entries for some spells that are on multiple spell lists.
Adjust as needed! I am not near HL and can not test anything I posted.

Most likely its creating a Invalid Expression then if its giving everything. May need to wrap a IF statement and not include the tagids[] unless a tagcount shows they are present.

Use debug and look at the final expression and make sure it looks valid....

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   #4 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 09:12 AM.


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