Jump to content
Wandering Soulstar

Notecard 'Problem' - Not Initialised

Recommended Posts

Hi all,

After all these years of using notecards in scripts I have just come across a small issue and was wondering if someone had an answer.

What is happening is, after checking that the notecard actually exists, and I call llGetNotecardLine (or llGetNumberOfNotecardLines same result). I was then getting a debug error that the Notecard did not exist, whilst it actually did exist in the inven. After a bit I was able to isolate the problem: the notecard had not been initialised. What I mean by this is that I had created a new notecard in inven, and as there is a scenario where the notecard could exist, but be empty, I left it as that without opening. Apparently the system does not like this. If you open the note card make changes, but leave it with no lines and save .. you are fine. My question is, does anyone know of a way to protect against this, i.e. avoid code breaking?

Thanks ... Wanda

Share this post


Link to post
Share on other sites
1 minute ago, Wandering Soulstar said:

 

I did have some issues long ago. I had to set the notecard to full perms and the script test it. IDK but could be that.

  • Thanks 1

Share this post


Link to post
Share on other sites

Notecards that have never been saved are plsceholders, not backed by an asset on the asset server. This is expected behavior. (And I think it's in the caveats on the wiki for reading a line.)

I don't know off the top of my head if there is a way to check whether a notecard has been saved or not.  What is the key of the notecard before it's saved? I have a vague memory that it's NULL_KEY.

Edited by Wulfie Reanimator
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
Just now, Wulfie Reanimator said:

Notecards that have never been saved are plsceholders, not backed by an asset on the asset server. This is expected behavior. (And I think it's in the caveats on the wiki for reading a line.)

I don't know off the top of my head if there is a way to check whether a notecard has been saved or not. 

Not true. A notecard is an object. The asset server gives that object  a key regardless of what data is in them. Simply calling for a notecard it is assigned a key.

Share this post


Link to post
Share on other sites

Thanks @Wulfie Reanimator ... had missed that line in the Wiki .. and  @steph Arnottyou were correct as well .. see the solution they provide in the wiki ..

Quote

If name is a new empty notecard (never saved) then an error "Couldn't find notecard ~NAME~" (~NAME~ being the value of name) will be shouted on the DEBUG_CHANNEL. This is because until a notecard is saved for the first time, it does not exist as an asset only as an inventory placeholder.

If the notecard is full-perms you can check for this with llGetInventoryKey which will return NULL_KEY in this case. However if notecard is not full-perms, there is no way to avoid the error message.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
3 minutes ago, Wandering Soulstar said:

 

Notecards are objects with embedded data. They are limited but they are still assigned an asset key. Every time you edit and save a new object is created with a new key.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...