Jump to content

Notecard 'Problem' - Not Initialised


Wandering Soulstar
 Share

You are about to reply to a thread that has been inactive for 1840 days.

Please take a moment to consider if this thread is worth bumping.

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

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1840 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...