Jump to content

Seren Tiratzo

Resident
  • Posts

    8
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So the last two states would basically doing the same except calling on the other one when finished?
  2. Thankyou for your quick reply but I think you misunderstood my question. I want both states to run on the same timer but one keeps looping and the other just runs. Now take note that I didn't write these scripts from scratch, I'm trying to combine them. I have one sphere that changes textures and another sphere thats around the first one that opens and closes. Sphere 1. (change textures) list textures = [ "d7db2561-a605-021b-cdc3-ddc45f880960", "8f0ef10d-c48c-d92c-98bb-8dd8bc7349f4", "1f2878f2-abff-67ea-5d9b-0c97e227cbe9"]; list sides = [ "0,1,2,5", "1,3,4,1"];float frequency = 2.0; integer random = TRUE;integer duplicatecheck = TRUE; changetexture()//user fucntion to change texture{ integer counter; key texture = llList2String(textures,currenttexture);//gets texture key from list do { //also with another script list primdata = llCSV2List(llList2String(sides,counter)); integer prim = llList2Integer(primdata,0); integer primlistlength = llGetListLength(primdata); integer primlistcounter = 1;//start at 1 since the prim datalist's 1st entry is the prim do { llSetLinkTexture(prim,texture,llList2Integer(sides,primlistcounter)); }while(++primlistcounter < primlistlength); }while(++counter <numberofsidestochange);} default{ on_rez(integer start_param)//on rez reset...probably not needed. { llResetScript(); } state_entry() { llOwnerSay("Simple Texture Changer (input list)(multiple prims & multiple sides)"); numberoftextures = llGetListLength(textures); numberofsidestochange = llGetListLength(sides); //assume correct llOwnerSay("There are " + (string)numberoftextures + " pictures which I will change every " + (string)frequency + " seconds."); llOwnerSay("My current free memory is : " + (string)llGetFreeMemory() + " bytes. If it is below 2500 bytes, I may not work properly."); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.150,0.900,0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetTimerEvent(frequency); } timer() { state blink; if(random)//show pics randomly { integer randomtexture; if(duplicatecheck)//whether to make sure random doesn't repeat itself { do { randomtexture= llRound(llFrand(numberoftextures - 1));//generate random number }while(randomtexture == currenttexture);//make sure the random one isn't the same as the current one } else//no duplicate check randomtexture = llRound(llFrand(numberoftextures - 1));//generate random texture number currenttexture = randomtexture;//set the current one to the random one selected changetexture();//change the texture } else//not random, go in order { ++currenttexture; if(currenttexture == numberoftextures)//if current texture = number of textures, reset counter currenttexture = 0; changetexture();//change the texture } } } Sphere 2. (close/open-loop) state blink{ state_entry() { llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.100,0.950,0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.0 ,1.00, 0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.100,0.950,0.00>, 0.0, <0,0,0>, <0,1,0>]); //how do I reset the current state without affecting anything else in the script }} But I can't figure out for the life of me how to loop the state that affects the childprim without affecting the texture change
  3. So I have this script where I want one part to change textures on the root prim and change the shape of the child prim. I can't figure out how to reset the child prim's state without restarting the root prim's state as well. list textures = [ "d7db2561-a605-021b-cdc3-ddc45f880960", "8f0ef10d-c48c-d92c-98bb-8dd8bc7349f4", "1f2878f2-abff-67ea-5d9b-0c97e227cbe9"]; list sides = [ "0,1,2,5", "1,3,4,1"]; float frequency = 2.0; integer random = TRUE; integer duplicatecheck = TRUE; changetexture()//user fucntion to change texture { integer counter; key texture = llList2String(textures,currenttexture);//gets texture key from list do { //also with another script list primdata = llCSV2List(llList2String(sides,counter)); integer prim = llList2Integer(primdata,0); integer primlistlength = llGetListLength(primdata); integer primlistcounter = 1;//start at 1 since the prim datalist's 1st entry is the prim do { llSetLinkTexture(prim,texture,llList2Integer(sides,primlistcounter)); }while(++primlistcounter < primlistlength); }while(++counter <numberofsidestochange); } default { on_rez(integer start_param)//on rez reset...probably not needed. { llResetScript(); } state_entry() { llOwnerSay("Simple Texture Changer (input list)(multiple prims & multiple sides)"); numberoftextures = llGetListLength(textures); numberofsidestochange = llGetListLength(sides); //assume correct llOwnerSay("There are " + (string)numberoftextures + " pictures which I will change every " + (string)frequency + " seconds."); llOwnerSay("My current free memory is : " + (string)llGetFreeMemory() + " bytes. If it is below 2500 bytes, I may not work properly."); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.150,0.900,0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetTimerEvent(frequency); } timer() { state blink; if(random)//show pics randomly { integer randomtexture; if(duplicatecheck)//whether to make sure random doesn't repeat itself { do { randomtexture= llRound(llFrand(numberoftextures - 1));//generate random number }while(randomtexture == currenttexture);//make sure the random one isn't the same as the current one } else//no duplicate check randomtexture = llRound(llFrand(numberoftextures - 1));//generate random texture number currenttexture = randomtexture;//set the current one to the random one selected changetexture();//change the texture } else//not random, go in order { ++currenttexture; if(currenttexture == numberoftextures)//if current texture = number of textures, reset counter currenttexture = 0; changetexture();//change the texture } } } state blink { state_entry() { llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.100,0.950,0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.0 ,1.00, 0.00>, 0.0, <0,0,0>, <0,1,0>]); llSetLinkPrimitiveParams(2,[PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.100,0.950,0.00>, 0.0, <0,0,0>, <0,1,0>]); //how do I reset the current state without affecting anything else in the script } }
  4. I'm a beginning scripter and I've gotten as far as getting an opacity switching dialog menu for multiple objects (most of it has been taken from existing scripts tough). I'm not shure if this is script is for the use by the owner only (I'd like that to be the case). I also want to add an adittional function to the menu to control the glow state of a child prim but I'm lost on how to do that. this is my script so far: // Select A Prim // // ============= // // Menu-based script to display one of a list of prims // Prims to displayed can be named anything that will fit in a menu integer Listener; list Names = ["-Hide-", "1", "2", "3", "4", "5"]; // <==== Change this, must be short enough to show in menu with 'none' first list Prims; integer Shown; CloseListen(){ // Stop timer, stop listening, discard listen-handle llSetTimerEvent(0.0); if(Listener){ llListenRemove(Listener); Listener = 0; } } default{ listen(integer ChannelIn, string FromName, key FromID, string Message){ // Make any shown prim transparent CloseListen(); if(0 < Shown){ llSetLinkAlpha(llList2Integer(Prims, Shown), 0.0, ALL_SIDES); } // Find the chosen prim and display it if not '<None>' Shown = llListFindList(Names, [Message]); if(0 < Shown){ llSetLinkAlpha(llList2Integer(Prims, Shown), 1.0, ALL_SIDES); } } state_entry(){ // Find the prims with the names in the menu-list llOwnerSay("Initialising, please wait ..."); integer Counter; Prims = Names; for(Counter = 1; Counter <= llGetNumberOfPrims(); Counter++){ Shown = llListFindList(Names, [llGetLinkName(Counter)]); if(-1 < Shown){ Prims = llListReplaceList(Prims, [Counter], Shown, Shown); llSetLinkAlpha(Counter, 0.0, ALL_SIDES); } } Shown = 0; // Not-found warnings for(Counter = 1; Counter < llGetListLength(Names); Counter++){ if(1 > llList2Integer(Prims, Counter)){ llOwnerSay("Prim name '" + llList2String(Names, Counter) + "' not found, please check spelling and capitalisation"); } } llOwnerSay("Ready"); } timer(){ // Automatically close the listener if there is no menu response within the time limit CloseListen(); llOwnerSay("Menu timed-out, click again to reactivate it"); } touch_end(integer HowMany){ // Display menu if touched by owner if(llDetectedKey(0) == llGetOwner()){ CloseListen(); integer ChannelMenu = -(integer) (llFrand(999999999.99) + 1); Listener = llListen(ChannelMenu, "", llGetOwner(), ""); llDialog(llGetOwner(), "Please select a prim to display", Names, ChannelMenu); llSetTimerEvent(30.0); } } } Now what do I need to add to get 1. Make it so that only the object owner can use it 2. Add the option to set the glow/fullbright state of a child prim 3. What type of listen code do I need to add to the child prim? Mucho gracias in advance!
×
×
  • Create New...