Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Error in script (http://forums.wolflair.com/showthread.php?t=6765)

Culhwch March 9th, 2007 09:52 PM

Error in script
 
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.

Mathias March 10th, 2007 11:19 AM

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?

Colen March 14th, 2007 01:00 PM

Error in script
 
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/


All times are GMT -8. The time now is 01:55 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.