• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Undocumented Context Transition: "Findchild"

sincla

Well-known member
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?
 
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:
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
 
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.
 
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....
 
Then you have to be certain that you know there is a unique tag combination for the pick you want.
 
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?
 
Back
Top