Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetNotecardLine in HUD attachment fails

Daryl Frost
Registered User
Join date: 5 Mar 2005
Posts: 7
11-16-2006 05:35
Hi all,

I am trying to use llGetNotecardLine in a (HUD) attachment.
Both the calling script and the notecard are present in the same (child) prim.
This works fine if the HUD is not attached, but I get EOF from the first line when it is attached!

Before I drive myself mad trying more use cases, does anyone know of an obvious mistake I am making?

cheers
Daryl
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
11-16-2006 11:54
Hi Dayrl,

First off I think you'd be better off posting this in the Scripting Tips forum where people specifically interested in scripting tend to hang out. :)

However, what you describe feels like a problem with resetting the line number...

llGetNotecardLine(string name, integer line)

...are you definitely setting the 'line' to zero before starting to read the notecard?

Bear in mind that the 'line' variable will automatically set itself to zero if the script is reset. On subsequent use it is up to your script to either do an llResetScript of set the 'line' to zero - you don't say how you're initiate the notecard read.

Finally, if the notecard is static, it only needs to be read the one time (normally triggered in the default state_entry() event) and never read again. Any variables set from the notecard will persist across attaching, detaching, and being placed in the inventory.

Hope something here helps. :)
Daryl Frost
Registered User
Join date: 5 Mar 2005
Posts: 7
11-19-2006 15:07
Thanks Pale. Yup - it was a bad initialisation. How embarrasing - in public too :o