Jump to content

ChaosRaine

Resident
  • Content Count

    69
  • Joined

  • Last visited

Everything posted by ChaosRaine

  1. I have a script then animates a nearby avatar on touch and one the animates on attach. I want to run these in the same script, but I'm having trouble with the combo of permissions. Any ideas? Here's what I'm using Animate on Touch //Touch and get near avatars in a dialog menu. //menu listener integer listener; integer sensorChannel; // range and arc for the sensor float range = 15.0; float arc = PI; list avatarsKeys; list avatarsNames; integer permissions; menu(key user,integer channel,string title,list buttons) { listener = llListen(channel,"","",""); llDialog(user,title,buttons,channel); //remove listener if there's no activity in menu llSetTimerEvent(20.0); } integer randomNumber() { return (integer)(llFrand(99999.0) * -1); } default { touch_start(integer total_number) { //only owner can access the menu if (llDetectedKey(0) == llGetOwner()) { llSensor("","",AGENT,range,arc); } } sensor(integer total_number) { integer i; key tempId; avatarsKeys = []; avatarsNames = []; i = 0; while ((i < total_number) && (i < 12)) { tempId = llDetectedKey(i); avatarsKeys = avatarsKeys + tempId; avatarsNames = avatarsNames + llKey2Name(tempId); i = i+1; } sensorChannel = randomNumber(); menu(llGetOwner(),sensorChannel,"Select an avatar...",avatarsNames); } listen(integer channel,string name,key id,string message) { if (channel == sensorChannel) { integer pos = llListFindList(avatarsNames,[message]); if (pos > -1) { // llSay(0,message + "'s key is " + llList2String(avatarsKeys,pos)); llRequestPermissions(llList2String(avatarsKeys,pos), PERMISSION_TRIGGER_ANIMATION ); } } } run_time_permissions(integer permissions) { if (permissions & PERMISSION_TRIGGER_ANIMATION) { llStartAnimation( llGetInventoryName(INVENTORY_ANIMATION, 0) ); } } } Animate on Attach default { state_entry() { } attach(key attached) { if (attached != NULL_KEY) { llRequestPermissions( llGetOwner(), PERMISSION_TRIGGER_ANIMATION ); } } run_time_permissions(integer permissions) { if (permissions & PERMISSION_TRIGGER_ANIMATION) { llStartAnimation( llGetInventoryName( INVENTORY_ANIMATION, 0) ); } else { llResetScript(); } } }
  2. look up some simple swing scripts. You will need a minimum of three prims. One for the part of the suitcase that will remain stationary, one for the hinge that is where the rotation is based off of, and one for the lid that will be opening and closing. If you look me up inworld, I will help you work on it.
  3. Ok I was playing with this one a little and I notice that I can add more lines with \n it just puts it in the text. I have to imagine I am missing something stupid at this point or is it not going to work the same with the notecard format?
  4. Thank you so much! I'm gonna be playing with some practical applications of this one for a while.
  5. Ok so far I have something working to get the text to read key notecardQueryId;string notecardName = "Text"; // script-wise, the first notecard line is line 0, the second line is line 1, etc.integer notecardLine; say(string inputString){ llOwnerSay(inputString);} default{ state_entry() { // Check the notecard exists, and has been saved if (llGetInventoryKey(notecardName) == NULL_KEY) { llOwnerSay( "Notecard '" + notecardName + "' missing or unwritten"); return; } // say("reading notecard named '" + notecardName + "'."); notecardQueryId = llGetNotecardLine(notecardName, notecardLine); } dataserver(key query_id, string data) { if (query_id == notecardQueryId) { // ++notecardLine; llSetText(data,<1.0, 0.0, 0.0>, 1.0); } }} Now I'm trying to figure out how to get it to add more cards or lines. I would prefure to use the same card with more lines to get the color and transparency, but I'm not stuck on it.
  6. Yeah so for a simple example I have a hover text script default{ state_entry() { llSetText("Hello there",<1.0, 1.0, 1.0>,1.0); }} and lets say I want somebody to be able to change the text, color, and transparency from a notecard I'm coming up with something like this key notecardQueryId;string notecardName = "Text";integer notecardLine;default{ state_entry() { // Check the notecard exists, and has been saved if (llGetInventoryKey(notecardName) == NULL_KEY) { llOwnerSay( "Notecard '" + notecardName + "' missing or unwritten"); return; } // say("reading notecard named '" + notecardName + "'."); notecardQueryId = llGetNotecardLine(notecardName, notecardLine); } dataserver(key query_id, string data) { if (query_id == notecardQueryId) { if (data == EOF) llSetText((notecardLine, 0), <1.0, 1.0, 1.0>, 1.0); }}} I'm still have trouble working this out based on the examples on wiki
  7. Sorry the question was poorly written. I selling an object that rezzes other objects. When it rezzes on I use llSay to send a message on a predettermend channel and when the rezzed object hears the message it deletes. This works great the only problem would be if a customer has two of the same item next to each other. Rezzing an object from one would cause both rezzed objects to delete sence they would both be listening to the same channel. I'm trying to figure out a way around this so they can work independantly.
  8. I have the idea down on how to let somebody change a nonmodify script using the object discription, but I can seem to master using note cards. I did something like this gUUID = llList2String(llGetObjectDetails(llGetKey(), ([OBJECT_DESC])), 0); to get a uuid number from the objects discription for example. How would I alter that to get a uuid from a notecard. I will admit I am a very uneducated about this so if somebody could just send me to some good reading material on the subject that would be greatly appreciated. Thank you in advance.
  9. I was just looking through the forums and came upon this one http://community.secondlife.com/t5/LSL-Scripting/llGetOwner-breaks-my-tiny-script/td-p/2720976 (I've never posted a link in here sorry if it doesn't work) it was titled "llGetOwner breaks my tiny script". It made me start thinking about a possible revision to an older script I did. If I use a script like theirs key owner;//placeholder for the owner's uuid default { state_entry() { owner = llGetOwner();//get the owner's uuid llListen(1234, "", NULL_KEY, ""); //listen to messages from anyone on 1234 } changed(integer change) { if (change & CHANGED_OWNER){//if the owner changes owner = llGetOwner();//get the new owner's uuid } } listen(integer channel, string name, key id, string message) { if (llGetOwnerKey(id) == owner){ // if the message is from an object belonging to my owner, or from my owner, if (message == "tex3") llSetTexture("xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", ALL_SIDES); } } } only instead of the owner talking I want it to listen for a message from another object can I replace the llGetOwner with the an object's or script's uuid or someway to get it to identify a spacific object giving the command rather then just the owner? Kinda like having a remote control nearby that is not attached to the prim that is changing textures.
  10. If the item itself is modifiable, I would think it wouldn't be hard to add a script to rez a simalar item in its place. You could just put a script with a timer in it to rez an unscripted version of itself just before the original derezes.
  11. Can I change the word the script is looking for to a veriable? Like by adding list greeting = hello,hi,hey,morning; then changing the listen line like this (~llSubStringIndex(llToLower(msg),greeting))
  12. Ok I finnaly have something that is working. It still gives the items one at a time, however the user only has to click the item once to get the whole inventory. I'm still haveing trouble getting to activate on attach rather then touch though. Here is what I have now. list give_in_folder;list give_individually;integer item_no;string name;string gUUID;integer folder_give = FALSE;integer item_give = FALSE;get_inv_details(){ name = llGetInventoryName( INVENTORY_ALL, item_no ); if ( name != llGetScriptName() ) { integer mask = llGetInventoryPermMask(name, MASK_OWNER); if ( (mask & PERM_COPY) ) { give_in_folder = give_in_folder + [ name ]; folder_give = TRUE; } else { give_individually = give_individually + [ name ]; item_give = TRUE; } }}init(){// Hovertext, edit accordingly - commented out right now,using separate script// llSetText( "abc\ndef",<1,1,1>,1); }default{state_entry(){ gUUID = llList2String(llGetObjectDetails(llGetKey(), ([OBJECT_DESC])), 0); init();}on_rez( integer param){ llSay(0, "Open Chat History (Ctrl+H) and click this link to join our group: secondlife:///app/group/"+gUUID+"/about"); init();} touch_start( integer num ){ item_no = 0; for ( item_no= 0 ; item_no < llGetInventoryNumber( INVENTORY_ALL ) ;item_no++ ) { get_inv_details(); } if ( folder_give ) { llGiveInventoryList ( llDetectedKey(0), llGetObjectName(), give_in_folder ); } if ( item_give ) { integer i; for ( i=0 ; i<llGetListLength( give_individually ) ; i++ ) { llGiveInventory( llDetectedKey(0),llList2String( give_individually, i )); } }}} I thought what I had to do is replace touch_start( integer num ) with attach(key id) , but that doesn't seem to be working.
  13. So something like this then? default{ state_entry() {float row_num = 1.5;float column_num = - 1.5; llSetTexture("eba57635-249b-4495-6d1e-4ee33e49e5fc",ALL_SIDES); llScaleTexture(cell_width, cell_height, 0); llSetTextureAnim( ANIM_ON|LOOP, ALL_SIDES, 5, 2, 0.0, 10.0, 1); }} I got that to work on a prim box the way I want it to, but it doesn't seem to be positioning right on the sculpty and it looks like its playing the animation on the sculpty. I can't seem to get the positioning done though. Is it mostly just about playing with it and finagling something to get it to work or is there an easier way to position it?
  14. Yeah I'm ok with it changing the texture on the entire book at once. The only change in each rotatation is the cover. It might be easier to just make the ten diffrent textures and make the script switch to an entirly new texture rather then rotate it. The only problem with that is I would hate to spend 100L on a book that is going to be worth maybe 15L.
  15. I assume I'm missing something stupid. I'm trying to make a sculpty book with a rotating texture so that it looks like a simple animation is playing on the cover. The script works fine in a prim but not in the book. Any ideas? Here's what I'm using integer randomletter; string winnerletter; float cell_width = 0.2; float cell_height = 0.5; float cell_widthnum = .5; float cell_heightnum = .5; integer timernum; integer changenumber = 1; integer counter; integer max = 10; getnewletter() { randomletter = (integer)llFrand(11); // Some integer 0 - 25 float row_number = 1.5 - (integer)(randomletter / 5); float column_number = (randomletter % 5) - 3.5; llOffsetTexture(column_number * cell_width, row_number * cell_height, 2); ///////////******** // SET A NEW PRIZE } default { state_entry() { llSitTarget(<-1.2,0.0,.1>,llEuler2Rot(<0.0,0.0,-90.0>*DEG_TO_RAD)/llGetRot()); float row_num = 1.5; float column_num = - 1.5; llSetTexture("eba57635-249b-4495-6d1e-4ee33e49e5fc",0); llScaleTexture(cell_width, cell_height, 0); getnewletter(); timernum = (changenumber*1); llSetTimerEvent(timernum); } timer() { getnewletter(); }} The texture is five wide and two high. I'm retro fitting an old script so my variable names don't make sence don't let them confuse you.
  16. It keeps freezing when it gets to initallizing texture cache and I can't open any part of the firestorm viewer. Can I clear the cache without going to the log in screen?
  17. Don't they still need to have copy rights for that to work? It looks like its going to do the same thing that way. Just copy all the contents to the person's inventory then delete it. So, won't it still not work if the person I'm giving it to doesn't have copy rights?
  18. Yeah that's not quite what I need, I want it to give the entire inventory at once. I've bought stuff that will do similar things to this and I will get the warning sometimes "Can't copy inventory. Inventory moved" or something like that I forget the warning, but its basically telling you that the object's inventory is now in your inventory with no copys left in the object. I think that is more along the lines of what I want. Do you have any ideas?
  19. Ok I think I can rig that in to work. A little late for me now I'll try it in the morning. Thanks again for your help
  20. Thank you for helping. So a line like llGiveInventoryList(inputKey, nameOfFolderToBeCreated, listOfItemsToSend); Would change to llGiveInventory(inputKey, nameOfFolderToBeCreated, listOfItemsToSend);? I can post my full script if that is easier
  21. I made a script that will open a box automatically when rezzed. It is only works if the person I give the box to has copy rights to the boxes inventory. I want to make thing mod and trans for the buyer, but they get the "No objects passed filter" error when they don't have copy rights. Any ideas as to why that would happen?
  22. I don't know if this is the right place to put this question sence its not really a script issue, but if I can solve it by writting my own script I wouldn't mind if somebody could point me in the right direction. I'm using AVsitter and want to sit multiple avatars on a single prim, but keep getting "No room to sit" error. I would prefur to not have one prim per sitter.
  23. The problem is that the script I'm working with the only way I know of to make a new menu button is by adding a new inventory item. I just want to be able to click on the button and have nothing in the basket. Just the basket by itself as though I just rezzed it fresh from my inventory.
  24. I got the rezz issue fixed. I"m not really sure what was going on. I think it was an issue with the sim. The problem I am having now is when it is empty. Sence my current set up is based of my menu, is it possable to add an invisable prim that deletes as soon as my basket rezzes it? As soon as the script is activated I want it to run the llDie and just delete itself.
  25. Also I need some way for it to delete the items when another is selected. Right now I have it so I have a script in the item rezzing that just deletes it when its clicked. I'd rather it be part of the menu though. Here's what I have if it helps. integer MAX_REZZED_OBJECTS = 1;vector REZ_POSITION = <0.02, 0.02, 0.025>;vector REZ_ROTATION = <0.0, 0.0, 0.0>;integer i = 0;integer currentPos = 0;integer listener;integer MENU_CHANNEL ; // opens menu channel and displays dialogDialog(key id){ list MENU1 = []; // count the textures in the prim to see if we need pages integer c = llGetInventoryNumber(INVENTORY_OBJECT); if (c <= 12) { for (i = 0; i < c; i++ ) { MENU1 += llGetInventoryName(INVENTORY_OBJECT, i); } } else { for (i = 10 * currentPos; i < (10 + (10 * currentPos)) ; i++) { // check to make sure name <= 24, or else the menu will not work. string aname = llGetInventoryName(INVENTORY_OBJECT, i); if ( llStringLength(aname) >24) { llOwnerSay("The texture named " + aname + " has too long of a name to be used, please give it a shorter name <= 24 characters "); } else { if (i < c ) { MENU1 += aname; } } } MENU1 += ">>"; if (currentPos != 0) MENU1 += "<<"; else MENU1 += "-"; } MENU_CHANNEL = (integer) (llFrand(10000) + 10000); listener = llListen(MENU_CHANNEL, "", NULL_KEY, ""); llDialog(id, "Select one object below: ", MENU1, MENU_CHANNEL);} default{ on_rez(integer num) { // reset scripts on rez llResetScript(); } touch_start(integer total_number) { // display the dialog Dialog(llDetectedKey(0)); } listen(integer channel, string name, key id, string message) { if (channel == MENU_CHANNEL) { llListenRemove(listener); if (message == ">>") { currentPos ++; Dialog(id); } else if (message == "<<") { currentPos--; if (currentPos < 0) currentPos = 0; Dialog(id); } else { // display the texture from menu selection llRezObject (message, llGetPos() + REZ_POSITION, ZERO_VECTOR, llEuler2Rot (REZ_ROTATION * DEG_TO_RAD), 0); } } } }
×
×
  • Create New...