Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,538

Old March 19th, 2018, 01:40 PM
Mathias,

Can the hero.findchild[] part of the script be used to home in on a thing with a specific tag?

RavenX

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.
RavenX is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,255

Old March 19th, 2018, 01:56 PM
Code:
hero.findchild[component,tag expression]
uses the same tag expression that

Code:
foreach pick in hero from component where "tag expression"
would - so if you can find it with foreach, you can find it with findchild[].
Mathias is offline   #2 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,538

Old March 19th, 2018, 02:01 PM
I thought that was the case. That should make it easier to output the Nature and Demeanor for a character sheet for me. Thank you.

RavenX

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.
RavenX is offline   #3 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 949

Old March 20th, 2018, 05:55 AM
Quote:
Originally Posted by Mathias View Post
Code:
hero.findchild[component,tag expression]
It seems too that if you know there is always one of a particular component on a hero, then you can do:
Code:
hero.findchild[component]
I did find out that you can use:
Code:
perform hero.findchild[component].setfocus
Then you step through using focus.field[fieldname].text or any way you would use eachpick.X

Are there any potential issues with using findchild instead of the foreach?
Any Benefits?

Working on -
TCArknight is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,255

Old March 20th, 2018, 07:27 AM
You'd use findchild instead of foreach if you're certain you'll only find one item that fulfills the requirements. Then, you set the focus to the item you've found, and go on with your script.

For example, let's say you have a long script that needs to look up and change several things on the race - in order to use that with a foreach, basically your script will need to start with the foreach, and end with the next each, but with findchild, your script starts with the findchild, sets a focus to the race, and then the rest of the script looks like normal code, instead of referring to eachpick throughout.
Mathias is offline   #5 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,538

Old March 20th, 2018, 01:29 PM
Yeah, I needed it for the Nature and Demeanor archetypes, which get assigned a unique tag from their chooser portals. The user has to pick one archetype for each of them, but they come from the same pool of available things. I rigged the portal to assign a tag and then had the find child look for that tag for character sheet output.

RavenX

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.
RavenX is offline   #6 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 02:47 AM.


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