How do I create a touch to open note card script?
|
|
OneUp Thiebaud
Registered User
Join date: 2 Sep 2006
Posts: 5
|
09-13-2006 19:57
I have been trying to figure out how to create a script that allows me to touch an object and a note card pops up that the user can type on and which saves when closed. If anyone has the answer I would be very appreciative. I've been looking through the knowledge and scripting wiki without success. Ideas or possible locations where an answer might be found would be greatly appreciated. Thanks.
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
09-13-2006 20:14
If I understand what you want done, it's not really doable/feesable. An item can GIVE a notecard to someone on touch, which the user can edit and save, but it saves in the users inventory, not in the prim. You can allow Drop in, but this adds to other problems. If you really want you can have them drop in the edited notecard and delete the old one, but you then run into the risk of someone NOT dropping that notecard in. But editing a notecard on touch via a script is not possible, since a script can only give out the notecard.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-14-2006 00:46
Not currently possible I'm afraid. What is it you are trying to do? There are ways around this using 'storage' scripts or other processes.
|
|
OneUp Thiebaud
Registered User
Join date: 2 Sep 2006
Posts: 5
|
Possible uses for this kind of script
09-14-2006 19:09
Possible uses sign-in sheet for meetings guest log book attendance roster
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
09-14-2006 21:16
all of those could be accomplised with a list and a touch event ie list sign_in_sheet;
default { touch_start(integer num) { string name = llDetectedName(0); if (llListFindList(sign_in_sheet,[name]) == -1) // if they havent signed in... { sign_in_sheet += name; } else llWhisper(0,"you have already signed in " + name); // if they are on the list ... } }
a featureless sign in prim 
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
09-14-2006 21:18
please note that your list can only be as big as there is free memory in the script ... with this one you might be able to cram in 200 ppl ... which is well more than a sim can hold for a single event/meeting
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-15-2006 00:17
Of course getting the list backout of the script would appear to be a little bit difficult Osgeld 
|
|
Ishtara Rothschild
Do not expose to sunlight
Join date: 21 Apr 2006
Posts: 569
|
09-15-2006 00:51
From: Newgate Ludd Of course getting the list backout of the script would appear to be a little bit difficult Osgeld  Why? Just add something like state_entry() { llListen(0,"",llGetOwner(),"readlist"); } listen(integer chan, string name, key id, string mes) { if (mes == "readlist") { integer length = llGetListLength(sign_in_sheet); integer i; for (i = 0; i < length; ++i) { llOwnerSay(llList2String(sign_in_sheet, i)); } } }
And simply say "readlist" to get a chat output. Then copy the text from the chat history and paste it into a notecard. If you delete the name of the prim and change the llOwnerSay command to llSay(0, "/me " + llList2String(sign_in_sheet, i)); you even get the list without the "Object says:" in front of each line.
|
|
Ishtara Rothschild
Do not expose to sunlight
Join date: 21 Apr 2006
Posts: 569
|
09-15-2006 01:14
Combined with Osgeld's script and with an added listcount it could look like this (remember to delete the prim name, otherwise it will appear in front of each list name): list sign_in_sheet; default { state_entry() { llListen(0,"",llGetOwner(),"readlist"); llListen(0,"",llGetOwner(),"listcount"); } touch_start(integer num) { string name = llDetectedName(0); if (llListFindList(sign_in_sheet,[name]) == -1) // if they havent signed in... { sign_in_sheet += name; } else llWhisper(0,"you have already signed in " + name); // if they are on the list ... } listen(integer chan, string name, key id, string mes) { if (mes == "readlist") { integer length = llGetListLength(sign_in_sheet); integer i; for (i = 0; i < length; ++i) { llWhisper(0, "/me " + llList2String(sign_in_sheet, i)); } } else if (mes == "listcount") { integer count = llGetListLength(sign_in_sheet); llWhisper(0, "/me So far " + (string)count + " persons have signed up for ...."); } } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-15-2006 02:16
From: Ishtara Rothschild Why? Just add something like
I was joking it was obviously a code fragment not intended as a complete script...
|