Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 26th, 2014, 12:13 PM
The "findchild" context transition is not documented on the wiki yet it appears right away in the leadsummary element in the skeleton files. What is it? Is it any different from just the "child" transition and if so, how? Devs?
sincla is offline   #1 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old August 26th, 2014, 12:29 PM
Find child is allows you to find one occurrence of a specific occurrence of a child with a custom tag on it.

Lets say you want to find the specific "Speak With Animals" SLA from a Gnome.

You could just look for speak with animals by going

Code:
hero.child[spSpeawit1].etc
But that would find the first occurrence of it whether its from a class a, a race, etc, so you might get the Gnome ability, but you might not.

so you use find child instead.

Find child works like this
Code:
hero.findchild[component, "tag expression"].etc
So using my Speak with Animals example, to find the Gnome one you would use
Code:
hero.findchild[BaseSpell,"Helper.SpellLike & Target.spSpeawit1 & Custom.GnomeSpell"].etc
Now you've specified exactly which copy of Speak With Animals you want to affect with your script.

EDIT: I just realized I replied on the authoring kit forum and not in pathfinder where I thought I was, but the idea should still be the same

Last edited by AndrewD2; August 26th, 2014 at 12:40 PM.
AndrewD2 is offline   #2 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 26th, 2014, 12:54 PM
So this is essentially the same as the firstchild[expr, sort] transition?
sincla is offline   #3 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old August 26th, 2014, 12:59 PM
Pretty sure firstchild finds only the first child, this could find the 15th copy of a thing, but it finds its specifics from a tag expression
AndrewD2 is offline   #4 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 26th, 2014, 01:04 PM
Seems the same to me, because even with findchild you might get more than one match and the default is likely to return the first match found. Thank you for the explanation.
sincla is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 26th, 2014, 01:25 PM
Quote:
Originally Posted by sincla View Post
Seems the same to me, because even with findchild you might get more than one match and the default is likely to return the first match found. Thank you for the explanation.
Correct. But you are usually using it when you want a specific Pick that has Tags that may identify it.

So in example for my Beast Shape adjustment that adds a Bite attack I have a tag on it that is PolyAdjust.Attack. This way I can find the exact bite attack that was added via the adjustment:
Code:
hero.findchild[BaseWep,"thingid.wBite & PolyAdjust.Attack".field[].value
Now a character could have two bite attacks (one from Beast Shape and one from a feat) but the above logic only gets me the one added by Beast Shape.

That is one example.

P.S. - If you are use to data bases then the above is like using a SQL/Chain with a Unique Composite Key. child[] is like using a SQL where statement with only part of the Composite key. <- Not sure that is helpful....

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   #6 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 26th, 2014, 01:41 PM
Then you have to be certain that you know there is a unique tag combination for the pick you want.
sincla is offline   #7 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 26th, 2014, 01:50 PM
Quote:
Originally Posted by AndrewD2 View Post
Find child is allows you to find one occurrence of a specific occurrence of a child with a custom tag on it.

Lets say you want to find the specific "Speak With Animals" SLA from a Gnome.

You could just look for speak with animals by going

Code:
hero.child[spSpeawit1].etc
But that would find the first occurrence of it whether its from a class a, a race, etc, so you might get the Gnome ability, but you might not.

so you use find child instead.

Find child works like this
Code:
hero.findchild[component, "tag expression"].etc
So using my Speak with Animals example, to find the Gnome one you would use
Code:
hero.findchild[BaseSpell,"Helper.SpellLike & Target.spSpeawit1 & Custom.GnomeSpell"].etc
Now you've specified exactly which copy of Speak With Animals you want to affect with your script.

EDIT: I just realized I replied on the authoring kit forum and not in pathfinder where I thought I was, but the idea should still be the same
Just to be clear on the typical uses, using findchild like you do below is useful for when you have different things that all bootstrap the same thing but you want to find the pick that's been bootstrapped by a particular pick/thing, and that has been tagged appropriately when it was bootstrapped?
sincla is offline   #8 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 07:59 AM.


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