Nova Enchantment Posted November 6, 2020 Share Posted November 6, 2020 So I have googled this for hours and I just can't seem to find it. I know it can be done but I'm not sure where to start on it. I have my full script all ready set up just need a way to do this. So What I want to happen is for the script to reset only if the Notecard changes. So if I drop an item into the object I don't want it to reset ever time its changes Only when the notecard is updated. How would I go about that? Link to comment Share on other sites More sharing options...
KT Kingsley Posted November 6, 2020 Share Posted November 6, 2020 (edited) It goes something like this: key notecard_key; default { state_entry () { notecard_key = llGetInventoryKey ("My notecard"); // read notecard data } changed (integer changes) { if (changes & CHANGED_INVENTORY) { key new_notecard_key = llGetInventoryKey ("My notecard"); if (new_notecard_key != notecard_key) { notecard_key = new_notecard_key; // read new notecard data } } } } Edited November 6, 2020 by KT Kingsley Oops, forgot to save the new key Link to comment Share on other sites More sharing options...
Sabrina Tamerlane Posted November 6, 2020 Share Posted November 6, 2020 Be careful that if you don't edit the notecard but drop a new one in the inventory you will have this event triggered multiple times... So... you need some kind of mechanism to make sure that you are using the right one... Link to comment Share on other sites More sharing options...
Xiija Posted November 6, 2020 Share Posted November 6, 2020 You can't really check a certain notecard unless you check its number of lines, and each lines values, but this might be kinda close.... integer invCount; default { state_entry () { invCount = llGetInventoryNumber( INVENTORY_ALL ); // get new count on reset } changed (integer changes) { if (changes & CHANGED_INVENTORY) { if( llGetInventoryNumber( INVENTORY_ALL ) == invCount ) // if inv hasn't changed, its an update { llOwnerSay("NC update"); llResetScript(); } } } } 1 Link to comment Share on other sites More sharing options...
Sabrina Tamerlane Posted November 6, 2020 Share Posted November 6, 2020 You can replace INVENTORY_ALL with INVENTORY_NOTECARD... otherwise this should work, another way is to make your script delete the old notecards... 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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