• 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

Error in script

Culhwch

Well-known member
I'm trying to create a feat that adds to a bard's total bardic music charges per day.

It works fine if I have bard levels, but when I don't have bard levels, anytime I pick a feat, I get this error: Attempt to access non-existent child pick "hBrdMusic' from script. What would be causing the error?

Thanks.
 
hBrdMusic is added by the bard class, so if the script is running, and bard isn't there - it'll look for its target.

You put a pre-requisite on the feat, requiring the bard class, right?
 
At 10:52 PM 3/9/2007, you wrote:

>I'm trying to create a feat that adds to a bard's total bardic music
>charges per day.
>
>It works fine if I have bard levels, but when I don't have bard
>levels, anytime I pick a feat, I get this error: Attempt to access
>non-existent child pick "hBrdMusic' from script. What would be
>causing the error?



I think you're doing this:


hero.child[cHelpBrd].field[cTotalLev].value =
hero.child[cHelpBrd].field[cTotalLev].value + 1


The "child" transition always assumes that the specified pick
(cHelpBrd) exists. If you the pick may not exist, use "childfound" instead:


hero.childfound[cHelpBrd].field[cTotalLev].value =
hero.childfound[cHelpBrd].field[cTotalLev].value + 1


"childfound" is the same as "child", except if the specified pick
doesn't exist, it does nothing. In cases where the child pick might
not exist, you should use "childfound"; if the pick should always
exist, you should use "child", since that will give you an error if
you do something wrong and the pick doesn't exist.


You should also add a pre-requisite for the Bard class as mgehl suggested.


Hope this helps,



--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/
 
Back
Top