Jump to content

Reading avatar keys from notecard.


MadsCook
 Share

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

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

Recommended Posts

Hello, I am new here so please delete the question if this is the wrong place to ask: My question is. I use a invisible phantom prim on the side of a shipping container and whenever someone enter this prim the floating text changes to "this cargo is adressed to: madscook" for example.
I also want my avatar to be notified whenever this happen and i made this script:

key OtherPersonKey = "avatar key";

default
{
    state_entry()
        {
        llVolumeDetect(TRUE); // Starts llVolumeDetect
        }
    collision_start(integer total_number)
        {
        llSetText(" \n Roleplay: Owner of this cargo container \n \n This cargo is addressed to: " + llKey2Name(llDetectedKey(0)), <1 ,1, 0>, 1 );
        llInstantMessage(OtherPersonKey,   "The cargo container adress now changed to " + llKey2Name(llDetectedKey(0)));
        }
}

 

 

Now i got some staff at my sim and i want to add multiple avatars keys. I know i can just create a "OtherpersonKey1" but i want to read the keys from a notecard. is there anyone here that can guide me in the right direction. I am a new beginner (as you probably understand) and have never read anything out of a notecard before. I tried to follow this guide: https://www.youtube.com/watch?v=q1J8g9duRbg but the web page it refers to is updated and therefore for a beginner it is hard to know what must be changed. Thanks for any help

Link to comment
Share on other sites

LL tries very hard to make sure new changes don't break old things, so whatever was done in the tutorial should still be valid.

Everything you really need to know about notecard reading should be available on the wiki: https://wiki.secondlife.com/wiki/LlGetNotecardLine

There's a new function for reading from a notecard called llGetNotecardLineSync, but I wouldn't recommend it to a beginner.

  • Thanks 1
Link to comment
Share on other sites

Hi MadsCook!

The LL Wiki has a categorized library where you can find notecard readers, including configuration notecard readers which is what you are looking for.

https://wiki.secondlife.com/wiki/CatNotecards

Like Quistess said, I would not yet begin with llGetNotecardLineSync, since it has some caveats. Also, it is a new function and has not yet been rolled out to all sims at this time.

Basically, you use the reader to store the keys in a list and use llListFindList to check against that. However, be sure to store them as keys using typecasting (i.e. prepend with "(key)"), since LSL is sometimes weird in comparing strings to keys when finding them in a list.

Typecasting example:

list lPersonnelKeys += (key)notecardLineData;



 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 91 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...