Member
Join Date: Jan 2007
Posts: 48
|
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. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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? |
#2 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
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/ |
#3 |
|
|