|
Tobyus Flanagan
Registered User
Join date: 1 Jul 2007
Posts: 6
|
05-08-2008 08:09
Okay, here is my idea...I want to make a journal that another person can add notecards to as their entries. They would be the only one able to add the notecards but anyone else should be able to get them. I want it to be menu driven on the retrievel though so people can pick which entry they wish to read. That would mean that when a notecard is added it would have to update the dialog buttons to show the new entry.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-08-2008 09:43
Yep. That sounds right. One approach might be to turn on llAllowInventoryDrop() and then delete anything that is not a notecard or doesn't have the target resident as its creator. If the target has ever given out a notecard with modify permissions though, that isn't a very sure security check. So you might also only turn on llAllowInventoryDrop() for a short window after a command or touch by the target resident, and an option to delete notecards that might have been added by accident (or "by accident"  .
|
|
Tobyus Flanagan
Registered User
Join date: 1 Jul 2007
Posts: 6
|
Updating the List
05-09-2008 08:34
Okay, I am stumped. I never understood lists very well, not to mention when they are dynamic...how in the world do get the list to update when a new notecard is dropped in. I have read over the forums and am only getting more confused.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-09-2008 10:23
Something like this. It doesn't do everything you want, but it should give you an idea of how to do the inventory bits. (Hasn't yet been compiled; may need some syntax fixes.) key AUTHOR = "12341234-1234-1234-1234-123412341234";
float DROP_WINDOW = 20.0; // seconds
list notecards = [];
default { touch_start(integer nDetected) { integer i; for (i = 0; i < nDetected; ++i) { if (llDetectedKey(i) == AUTHOR) { llAllowInventoryDrop(TRUE); llSetTimerEvent(DROP_WINDOW); } } }
timer() { llSetTimerEvent(0.0); llAllowInventoryDrop(FALSE); }
changed(integer changes) { if (changes & (CHANGED_INVENTORY | CHANGED_ALLOWED_DROP)) { notecards = [];
integer i; for (i = llGetInventoryNumber(INVENTORY_ALL); i > 0; --i) { string name = llGetInventoryName(INVENTORY_ALL, i-1); integer type = llGetInventoryType(name); if (type == INVENTORY_NOTECARD) { if (llGetInventoryCreator(name) == AUTHOR) { notecards = (notecards=[])+notecards+[ name ]; } else { llRemoveInventory(name); } } else if (type != INVENTORY_SCRIPT) { llRemoveInventory(name); } } } } }
|