Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Mathias,
Can the hero.findchild[] part of the script be used to home in on a thing with a specific tag? RavenX Pronouns: She/Her 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. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
hero.findchild[component,tag expression] Code:
foreach pick in hero from component where "tag expression" |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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 Pronouns: She/Her 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. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#3 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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] Code:
perform hero.findchild[component].setfocus Are there any potential issues with using findchild instead of the foreach? Any Benefits? Working on - |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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 Pronouns: She/Her 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. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#6 |
|
|