Findchild
Mathias,
Can the hero.findchild[] part of the script be used to home in on a thing with a specific tag? |
Code:
hero.findchild[component,tag expression] Code:
foreach pick in hero from component where "tag expression" |
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.
|
Quote:
Code:
hero.findchild[component] Code:
perform hero.findchild[component].setfocus Are there any potential issues with using findchild instead of the foreach? Any Benefits? |
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. |
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. :D
|
All times are GMT -8. The time now is 09:46 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.