Childfound...
1 Attachment(s)
I thought when using childfound instead of child that HL was not suppose to throw an error if the thing was not found? From the wiki "Transitions to the pick context corresponding to the first pick within the container that derives from the thing with the id specified. This transition is identical to "child[id]", except that the existence of the child pick is optional. If the child is found, the transition occurs normally. If the child does not exist, no run-time error is reported, although the transition still fails to resolve."
I have the following code on a new class I am creating: Code:
~First 498 I am mis-reading what childfound does or is their another way to test that a Thing is really their before trying to affect it? |
I'm afraid I don't understand the child/childfound part (I've noted this thread for Rob or Colen to explain that).
I do know how to keep the error from happening: Code:
hero.childfound[cAnimClass].field[CompClLev].value -= 3 |
Quote:
Thanks for the script I had tried using childlives but had issues. I see now that it was because I added .value after childlives[cAnimComp]. Guess it was just habit. :) :p |
As Mathias notes, childlives is the correct way to make sure the pick is live before accessing it. :)
"childfound" returns an error for non-live picks because it's a sign you may be doing something wrong; if a pick could be non-live, you should often be testing for that beforehand and perhaps doing something different. Hope this helps! |
All times are GMT -8. The time now is 06:35 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.