Jump to content

Queenship3001

Resident
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Queenship3001

  1. This is exactly what I was looking for! I didn't know toggle was a thing or I probably would have looked that up I'll fiddle with this script for a bit, because I would like to try and do what you said and have a slow transition (if not then oh well). Thank you so much EDIT: I have failed miserably in trying to add more value changes, but I have been able to change this from using Hollow to Dimple, which looks better for the design I am going for.
  2. In regards to Xiija's reply, that is almost what I'm looking for, very very close. I don't actually need it to function for both on_rez and on_attach, I just use on_rez because it's easier to test the functionality of the script on a arge object rather than a small attachment. I change it later on. By the looks of it, it cycled through changing the hole size from 0.5, to 0.25 and then back to 0.5, but only the one time. What I'm looking for needs to have this happen non-stop, switching between the two sizes every 5 seconds or so. In reply to Innula, I did finally get it down after a little T&E, to at least figure out what I needed to set the hollow size lol. vector cut = <0.5, 1.0, 0.0>;float hollow = 0.5;vector twist = <0.0, 0.0, 0.0>;vector dimple = <0.0, 1.0, 0.0>;default{ state_entry() { llSetPrimitiveParamsFast([PRIM_TYPE, PRIM_TYPE_SPHERE, PRIM_HOLE_DEFAULT, cut, hollow, twist, dimple]); }} I just need to get it to alternate 0.5 to 0.25 constantly every few seconds.
  3. That's where I've been browsing for a while actually. I guess I've been out of this specific part of the game for a little too long.
  4. So t has been a LONG time since I've done any form of scripting and I find myself kind of relearning what I'm doing. I wouldn't say I'm starting off with something basic either. I have a sphere that's been cut in half and hollowed out a bit. I'm trying to create a script that will change the value for hollow after a set ammount of time, but the LSL wiki isn't being especially helpful today.. The script should do the following: 1: upon rez/attach (The sphere will be an attachment in time), the hollow value should be reset to a base value (e.g. 0.5) 2:Using a timer or something, the hollow value needs to change so it shrinks after a set amount of time. 3: After another set amount of time, the hollow value needs to go up again (We'll say it's going back up to 0.5). If any of this sounds too vague just tell me and I'll try to specifiy my meaning. I'm trying to put in what I remember into a script now, but any help would be appreciated.
  5. I litterally had no idea where to post this, be it forums or answered or where to post in either areas. Okay, so Tuesday night things are fine. I have a good day spending time with friends, log off and hit the sack. Wedensayd rolls around and I log in. Mesh isn't loading and my avatar is grey. I figured this was a siple gry skin issue, so I used all the normal methods of fixing that. Then it hit me (after none of those solutions worked). I use a full body mesh avatar. Greyskin shouldn't even bothered being fixed since It SHOULD be covered anyway! Looking around I saw, not only was the mesh on my avi not loading, but neither was the mesh in my environment around me loading! I tried to get a hold of one of my friends to help, only come to find out my friends list was full of contacts reading "(Loading....)" The could contact me however, and when they did, the name space was blank. When they typed, it came up as "[NAME] is typing...". By now I'm more than a little annoyed. Suddenly I notice a THIRD issue! My name tag is messed up! Normall I have Usernames off, Display names on, and group tags on. Group tags were on, with user names turned off, they came on, and display names off removed my name tag all together! Worried my account was under seige, I changed my password and went from there (little help that did, but I was just taking a safety measure.) Fed up, I got on my laptop and logged in to sl there. Everything was normal. Mesh worked, avis loaded, name tags working, contacts with actual names. So I wondered if, on my main pc, if it was my viewer. So, I did a clean re-install of my viewer (I use Firestorm) thinking it would be fixed, saving ONLY my chat logs and deleting everything else from my Application Data and the installation directory left after uninstalling. I then install to the latest version and, to my shock, everything was still broken. Furious I installed Singulartiy viewer. Same result. Exodus, nothing. Main Second Life Viewer, nada. One thing I noticed was every time I logged in to any viewer it always had to make three region capability requests. I guess by this point it's an issue with my pc and I'm just praying SOMEONE has had issues like the above and can help! If this is in the forums or on another answer, please direct me. I'm out of ideas.
  6. Hello again SL scripting community ^.^ I once again need a bit of help. I have a script for payments that I will be using for commercial purposes, donations and such, but I'm giving little thank you's and stuff to the people that donate over a certain ammount. default { touch_start(integer num_detected) { llRegionSayTo(llDetectedKey(0), 0, "Please right-click me and select 'Pay...' to donate."); } money(key id, integer amount) { string name = llKey2Name(id); key owner = llGetOwner(); llInstantMessage(id, "Thank you for your donation, " + name + "!"); llInstantMessage(owner, name + " has donated " + (string)amount + " L$."); } } This is a script I found in the library, simple and easy, but is there a way to have the script record who has payed the object and how much? Any help is appreciated.
  7. Controller: list colors = ["Delete Script", "Red"];string msg = "What do you want your new color to be?";key owner;integer channel;integer listener;integer fullbright;default{ state_entry() { owner = llGetOwner(); //set value of owner here, rather than keep looking it up channel = 677 - (integer)("0x" + llGetSubString( (string)owner, -7, -1) ); } changed(integer change) { if (change & CHANGED_OWNER) {//if the owner of the object changes llResetScript();//reset script to reset value of owner } } touch_start(integer num_detected) { if (llDetectedKey(0)==owner) { llListenRemove(listener); listener = llListen(channel, "", owner, ""); llDialog(owner, msg, colors, channel); llSetTimerEvent(60.0); } } listen(integer channel, string name, key id, string message) { if(message=="Red") { llRegionSayTo(owner,channel,"Red"); } //if(message=="Delete Script") //{ // llRegionSay(676, "Delete"); //} } timer() { llSetTimerEvent(0); llListenRemove(listener); }} Prim scripts: key owner;integer CommsChannel;default{ state_entry() { owner = llGetOwner(); //set value of owner here, rather than keep looking it up CommsChannel = 677 - (integer)("0x" + llGetSubString( (string)owner, -7, -1) );//NB change here //don't use "channel" as a variable name -- risks confusion with the variable in the listen event llListen(CommsChannel,"","",""); } listen(integer channel, string name, key id, string message) { llRegionSayTo(owner,CommsChannel,message);//put this in the listen event of the menu script, to tell the other attachments //what to do if("Red"==message){ //put this in all scripts llSetLinkColor(LINK_ALL_CHILDREN, <1.000, 0.255, 0.212>, ALL_SIDES); } else if ("Yellow"==message){ //and so on } }} Houston! We have turned Red! Took me a minute to figure out what broke initially (Script error?) but I got it Thank you so much ^.^ You've made my life a WHOLE lot easier
  8. I can't say I know where exactly to make changes.... When I made changes it still didn't do anything, and changing lGetOwner to llGetKey rendered my controller prim unclickable, unless that was meant to stay as-is.
  9. So like I said, the script above works. However, I didn't plan on being so..... excentric... with my avatar mod. Meaning I have 9 attachments that, using the above script, would need to be indavidually clicked. This does not bode for good reviews on my product, So I've tried looking in to having a controller script to change the color of all the attachments at once. Now in THEORY, it looks right to me. The reality is I'm wrong and nothing happens. Controller script: list colors = ["Delete Script", "Red"];string msg = "What do you want your new color to be?";key owner;integer channel;integer listener;integer fullbright;default{ state_entry() { owner = llGetOwner(); //set value of owner here, rather than keep looking it up channel = 677 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } changed(integer change) { if (change & CHANGED_OWNER) {//if the owner of the object changes llResetScript();//reset script to reset value of owner } } touch_start(integer num_detected) { if (llDetectedKey(0)==owner) { llListenRemove(listener); listener = llListen(channel, "", owner, ""); llDialog(owner, msg, colors, channel); llSetTimerEvent(60.0); } } listen(integer channel, string name, key id, string message) { if(message=="Red") { llRegionSay(676, "Red"); } if(message=="Delete Script") { llRegionSay(676, "Delete"); } } timer() { llSetTimerEvent(0); llListenRemove(listener); }} Listener/Color change script(s): integer channel = 676; integer listening; integer fullbright; default { state_entry() { channel - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } listen(integer channel, string name, key id, string message) { llListen(channel, "", NULL_KEY, ""); if(message=="Red") { llSetLinkColor(LINK_ALL_CHILDREN, <1.000, 0.255, 0.212>, ALL_SIDES); } else if(message=="Delete") { llRemoveInventory(llGetScriptName()); } } timer() { llSetTimerEvent(0); llListenRemove(listening); } } Now.... Something tells me I'm doing this TOTALLY wrong and need to be barred from ever scripting again.... But for efficiency I'll be making apeals to the court in that event. Can someone tell me what I'm doing wrong and what needs to be changed?
  10. Thank you soooo much! I actually tried each of those changes, but not in the format or placement you provided. The script is doing exactly what I want it to now! Thanks a ton
  11. So, I have a script that will change colors on a linked set of prims via llDialog. However, and I realize it's probably staring me in the face and I'm blind, I can't figure out how to make it so it's owner accessed only. The closest I got was making it so when other people click the prim, they don't get a mnu, however I do... That's VERY annoying... I did look for other threads about thios, but it always seems to be about the llDialog function itself, not who specifically can use it. If there IS a thread about it, link it, I'll try it, if it works, I'll delete this thread (I can delete my own threads, right?). Until then, this is my current script.: list colors = ["Red", "Yellow", "Blue", "Pink", "Green", "White", "Purple", "Orange"]; string msg = "What do you want your new color to be?"; key owner; integer channel; integer listener; default { state_entry() { channel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } touch_start(integer num_detected) { owner = llGetOwner(); llListenRemove(listener); listener = llListen(channel, "", owner, ""); llDialog(owner, msg, colors, channel); llSetTimerEvent(60.0); } listen(integer channel, string name, key id, string message) { if(message=="Red") { llSetLinkColor(LINK_ALL_CHILDREN, <1.000, 0.255, 0.212>, ALL_SIDES); } if(message=="Yellow") { llSetLinkColor(LINK_ALL_CHILDREN, <1.000, 0.863, 0.000>, ALL_SIDES); } if(message=="Blue") { llSetLinkColor(LINK_ALL_CHILDREN, <0.000, 0.455, 0.851>, ALL_SIDES); } if(message=="Pink") { llSetLinkColor(LINK_ALL_CHILDREN, <0.941, 0.071, 0.745>, ALL_SIDES); } if(message=="Green") { llSetLinkColor(LINK_ALL_CHILDREN, <0.180, 0.800, 0.251>, ALL_SIDES); } if(message=="White") { llSetLinkColor(LINK_ALL_CHILDREN, <1.0, 1.0, 1.0>, ALL_SIDES); } if(message=="Purple") { llSetLinkColor(LINK_ALL_CHILDREN, <0.694, 0.051, 0.788>, ALL_SIDES); } if(message=="Orange") { llSetLinkColor(LINK_ALL_CHILDREN, <1.000, 0.522, 0.106>, ALL_SIDES); } } timer() { llSetTimerEvent(0); llListenRemove(listener); } } All I need is to know how to make it so anyone who ISN'T the owner unable to use the dialog and prims.
  12. As thanks, I'll give out both scripts I'm using for others who want to do the same thing! Invisible phantom floor script: integer i;vector splash_pos;vector my_size;vector my_pos;integer splash_rez_listen;default{ state_entry() { //llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1,1,0.025); llSetTextureAnim(ANIM_ON | SMOOTH |SCALE | PING_PONG | LOOP, 0,1,1,1,1.0,0.03); llVolumeDetect(TRUE); } collision_start(integer num_detected) { my_pos = llGetPos(); my_size = llGetScale(); for(i=0;i<num_detected;i++) { splash_pos = llDetectedPos(i); llRezObject( "sparkle", // object name in inventory <splash_pos.x, splash_pos.y, (my_pos.z + (my_size.z/2.0))>, // rez at positioon ZERO_VECTOR, // rez velocity <0.00000, -0.70711, 0.00000, 0.70711>, // rez rotation (splash_rez_listen = (integer)llFrand(999999) * -1) // rez parameter ); llSleep(0.1); llShout(splash_rez_listen, // listen key (string)llDetectedKey(i) + "##" + (string)(my_pos - (my_size / 2.0)) + "##" + (string)(my_pos + (my_size / 2.0)) // parameters ); } } collision(integer nd) { llOwnerSay("moving"); }} Particle and sound prim follow script: integer gSound;list particle_parameters=[];list parse_parameters = [];vector pos;key avatar_key;vector water_min;vector water_max;integer lh;ripple(){ particle_parameters = [ // start of particle settings // Texture Parameters: PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0), PSYS_PART_START_SCALE, <0.1, .1, FALSE>, PSYS_PART_END_SCALE, <.2,.2, FALSE>, PSYS_PART_START_COLOR, <1,0,1>, PSYS_PART_END_COLOR, <0,1,1>, PSYS_PART_START_ALPHA, (float)1, PSYS_PART_END_ALPHA, (float)1, PSYS_SRC_BURST_PART_COUNT, (integer)50, PSYS_SRC_BURST_RATE, (float) 0.01, PSYS_PART_MAX_AGE, (float)4.0, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE, PSYS_SRC_BURST_SPEED_MIN, (float)0, PSYS_SRC_BURST_SPEED_MAX, (float)0, PSYS_SRC_BURST_RADIUS, 0.2, PSYS_SRC_ANGLE_BEGIN, (float) PI, PSYS_SRC_ANGLE_END, (float)0, PSYS_SRC_OMEGA, <5,5,5>, PSYS_SRC_ACCEL, <0.0,0.0, 0.0 >, // PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1), PSYS_PART_FLAGS, (integer)( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK // | PSYS_PART_WIND_MASK // | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK // | PSYS_PART_TARGET_POS_MASK // | PSYS_PART_TARGET_LINEAR_MASK ) ]; }wave(){ particle_parameters = [ PSYS_SRC_TEXTURE, "your-UUID-goes-right-here", PSYS_PART_START_SCALE, <0.3,0.3,0.3>, PSYS_PART_END_SCALE, <0.1,0.1,0.1>, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>, PSYS_PART_START_ALPHA, (float)1, PSYS_PART_END_ALPHA, (float)0.1, PSYS_SRC_BURST_PART_COUNT, (integer)8, PSYS_SRC_BURST_RATE, (float) 0.1, PSYS_PART_MAX_AGE, (float)5, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE, PSYS_SRC_BURST_SPEED_MIN, (float)0.05, PSYS_SRC_BURST_SPEED_MAX, (float)0.1, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_ANGLE_BEGIN, (float) 0, PSYS_SRC_ANGLE_END, (float)0, PSYS_SRC_OMEGA, <0,0,1>, PSYS_SRC_ACCEL, <0,0,0>, // PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1), PSYS_PART_FLAGS, (integer)( 0 // Texture Options: | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK // | PSYS_PART_WIND_MASK // | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK // | PSYS_PART_TARGET_POS_MASK // | PSYS_PART_TARGET_LINEAR_MASK ) ]; }default { state_entry() { ripple(); llSetScale(<0.010, 0.010, 0.010>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(0, ALL_SIDES); llParticleSystem([]); } on_rez(integer rez_param) { if (rez_param != 0) { lh = llListen(rez_param, "", NULL_KEY, ""); llParticleSystem( particle_parameters ); llSetTimerEvent(1.8); } else { llSetScale(<1.0, 1.0, 1.0>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(1, ALL_SIDES); } } listen (integer ch, string name, key id, string msg) { llListenRemove(lh); parse_parameters = llParseString2List(msg, ["##"], [""]); avatar_key = (key)llList2String(parse_parameters, 0); water_min = (vector)llList2String(parse_parameters, 1); water_max = (vector)llList2String(parse_parameters, 2); llSensorRepeat("", avatar_key, AGENT, 10.0, PI, 0.1); wave(); } sensor(integer num_detected) { if (!gSound) { gSound = TRUE; llPlaySound("YOUR_SOUND_HERE", 1.0); } pos = llDetectedPos(0); if (llVecDist(<pos.x, pos.y, water_max.z>, llGetPos()) > 0.1) { if (pos.x > water_min.x && pos.y > water_min.y && pos.x < water_max.x && pos.y < water_max.y && pos.z > (water_min.z - 0.5) && pos.z < (water_max.z + 0.5)) { llSetLinkPrimitiveParamsFast(0, [PRIM_POSITION, <pos.x, pos.y, water_max.z>]); llParticleSystem( particle_parameters ); llSetTimerEvent(0.8); } else llDie(); } else { gSound = FALSE; llSetTimerEvent(0.0); llParticleSystem([]); } } no_sensor() { llDie(); } timer() { llSetTimerEvent(0.0); llParticleSystem([]); gSound = FALSE; } } The above script goes into a prim, then the pri goes into the alpha floor with the first script. ^.^
  13. I agree ^.^ and I have you to thank for this too! I wouldn't have the right functions to put in without you, was just a matter of placement Thank's sooo much!
  14. Well, other than that part about removing llDie in that one spot
  15. Are you going to hate me if I tell you right now I just figured exactly what you just showed me right before I refreshed the page...? sensor(integer num_detected) { if (!gSound) { gSound = TRUE; llPlaySound("sparkles4, 1.0); } pos = llDetectedPos(0); if (llVecDist(<pos.x, pos.y, water_max.z>, llGetPos()) > 0.1) { if (pos.x > water_min.x && pos.y > water_min.y && pos.x < water_max.x && pos.y < water_max.y && pos.z > (water_min.z - 0.5) && pos.z < (water_max.z + 0.5)) { llSetLinkPrimitiveParamsFast(0, [PRIM_POSITION, <pos.x, pos.y, water_max.z>]); llParticleSystem( particle_parameters ); llSetTimerEvent(0.8); } else llDie(); } else { gSound = FALSE; llSetTimerEvent(0.0); llParticleSystem([]); } } no_sensor() { llDie(); } timer() { llSetTimerEvent(0.0); llParticleSystem([]); gSound = FALSE; } }
  16. Well it's looking good so far then, but the thing it I need it to pause now. The prim won't use any of the llDie functions until the avatar leaves the phantom prim floor (via walking off, teleporting out or crashing) The prim will simply follow the avatar around, making particles as it moves, but as soon as the avatar stands still, so will the prim, and the particles stop. When the avatar starts to move again, so will the prim and that means more particles. The sound however, doesn't do this. It's just looping constantly (although the demo script you set up there is still a major help!).
  17. Well, that gave me two outcomes. Saving the script with "gSoundON" switched to FALSE cause the sound to play nonestop, looped, regardless if the prim was movig or not. Saving the script with "gSoundON" switched to TRUE made the sound play just a single time when the prim initially rezzes and then it never plays again until I walk away and come back, making the system rez a new prim.... I was supposed to use "Integer gSoundON;" when adding it to the top of the script though, right?
  18. I was trying to use intervals (however tight) so that the sound wouldn't get spammed lol.
  19. Because initially a single sound was just spammed hundreds of times when the prim moved and was very annoying. I was using llTriggerSound for that. Would llPlaySound work?
  20. Yes, the sounds have to be in the sensor event because the sensor event takes place when the prim moves. If I place the sounds in the Timer event, then the sounds only play when the prim has stopped moving. Is there a way to change it up and have it play a sound during the sensor event without having it repeat 57832784657 times in less than a second (compliemtns of llTriggerSound), and then have the sound stop midway when the prim stops moving?
  21. Well the reason the intervals are set so tight is because the newer audio clips are actually only 0.2 seconds long
  22. One thing to also pay attention to is if the mesh will only fit specific avatars. The mesh clothing from Blue Galaxy, for example, will ONLY fit the Blue Galixian Feline avatars, which are 100% mesh. If you try to wear the clothing on a normal avatar, it will fit wrong and there is no way to fix the appearance other than buying the avatar required. So again, look carefully at what you're buying or you'll regret it. And always get the demo~!
  23. Okay, so in my store I have a phantom prim along the length/width of the floor, and when people walk on it, a small invisible prim follows them leaving a trail of sparkley particles. It's just a little effect for my store and the prim deletes as soon as they step off them phantom prim. Now, I thought it would be cool to add some little sound effects to make it cute to go with the particles when people move. However, this has not been easy.... The prim that gets rezzed controls the particle engine, and I also want it to trigger the sound, but it also has to move. A and C work but B (sound) doesn't. Here is the script I'm using: integer gCount; list particle_parameters=[]; list parse_parameters = []; vector pos; key avatar_key; vector water_min; vector water_max; integer lh; ripple() { particle_parameters = [ PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0), PSYS_PART_START_SCALE, <0.1, .1, FALSE>, PSYS_PART_END_SCALE, <.2,.2, FALSE>, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <.5,.6,1>, PSYS_PART_START_ALPHA, (float)0.5, PSYS_PART_END_ALPHA, (float)0.1, PSYS_SRC_BURST_PART_COUNT, (integer)30, PSYS_SRC_BURST_RATE, (float) 0.6, PSYS_PART_MAX_AGE, (float)3.0, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)4, PSYS_SRC_BURST_SPEED_MIN, (float).5, PSYS_SRC_BURST_SPEED_MAX, (float).5, PSYS_SRC_ANGLE_BEGIN, (float) 0.9*PI, PSYS_SRC_ANGLE_END, (float)0*PI, PSYS_SRC_ACCEL, <0.0,0.0, 0.0 >, PSYS_PART_FLAGS, (integer)( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK ) ]; } wave() { particle_parameters = [ PSYS_SRC_TEXTURE, "*****************" PSYS_PART_START_SCALE, <0.3,0.3,0.3>, PSYS_PART_END_SCALE, <0.1,0.1,0.1>, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>, PSYS_PART_START_ALPHA, (float)1, PSYS_PART_END_ALPHA, (float)0.1, PSYS_SRC_BURST_PART_COUNT, (integer)8, PSYS_SRC_BURST_RATE, (float) 0.1, PSYS_PART_MAX_AGE, (float)5, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)4, PSYS_SRC_BURST_SPEED_MIN, (float)0.05, PSYS_SRC_BURST_SPEED_MAX, (float)0.1, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_ANGLE_BEGIN, (float) 0, PSYS_SRC_ANGLE_END, (float)0, PSYS_SRC_OMEGA, <0,0,1>, PSYS_SRC_ACCEL, <0,0,0>, PSYS_PART_FLAGS, (integer)( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK ) ]; } default { state_entry() { ripple(); llSetScale(<0.010, 0.010, 0.010>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(0, ALL_SIDES); llParticleSystem([]); } on_rez(integer rez_param) { if (rez_param != 0) { lh = llListen(rez_param, "", NULL_KEY, ""); llParticleSystem( particle_parameters ); llSetTimerEvent(1.8); } else { llSetScale(<1.0, 1.0, 1.0>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(1, ALL_SIDES); } } listen (integer ch, string name, key id, string msg) { llListenRemove(lh); parse_parameters = llParseString2List(msg, ["##"], [""]); avatar_key = (key)llList2String(parse_parameters, 0); water_min = (vector)llList2String(parse_parameters, 1); water_max = (vector)llList2String(parse_parameters, 2); llSensorRepeat("", avatar_key, AGENT, 10.0, PI, 0.1); wave(); } sensor(integer num_detected) { pos = llDetectedPos(0); if (llVecDist(<pos.x, pos.y, water_max.z>, llGetPos()) > 0.1) { if (pos.x > water_min.x && pos.y > water_min.y && pos.x < water_max.x && pos.y < water_max.y && pos.z > (water_min.z - 0.5) && pos.z < (water_max.z + 0.5)) { llSetLinkPrimitiveParamsFast(0, [PRIM_POSITION, <pos.x, pos.y, water_max.z>]); llParticleSystem( particle_parameters ); llSetTimerEvent(0.8); } else llDie(); } } no_sensor() { llDie(); } timer() { llSetTimerEvent(0.0); llParticleSystem([]); if (gCount%3 == 0) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1.0); } else if (gCount%3 == 1) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,1), 1.0); } else if (gCount%3 == 2) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,2), 1.0); } } } Now I've tried a few things. Initially I was using llTriggerSound under the "sensor" section, so it would play the sound when the prim and avatar moved. The initial sound was too long and was spammed pretty bad, so I figured I'd need a timer and shorter sounds to play at intervals, so I found: http://community.secondlife.com/t5/Scripting/One-after-the-play-from-several-sound/td-p/499736 But, I needed it to be under the sensor area still, and so far as I know, I can't make a timer event in nother event (despite how much I want it to >.>). So I made the counter and put all the stuff I needed to in a new argument within the argument containing "llSetLinkPrimitiveParamsFast". That ALMOST worked, but the counter wasn't so once again, the 3 short audio files I had were being smashed together and played as one. (several retries by editing the counter and even adding "float gap = 0.2" also failed) So as a final effort that I knew would fail but decided to do anyway, was to put everything under that last part in the timer event (it was already there to end the script). And, like I thought it would, the sound only played when the prim stopped moving. SO! How do I get my sound(s) to play properly under the "Sensor" event where I need them to? Any ideas?
  24. Okay, so in my store I have a phantom prim along the length/width of the floor, and when people walk on it, a small invisible prim follows them leaving a trail of sparkley particles. It's just a little effect for my store and the prim deletes as soon as they step off them phantom prim. Now, I thought it would be cool to add some little sound effects to make it cute to go with the particles when people move. However, this has not been easy.... The prim that gets rezzed controls the particle engine, and I also want it to trigger the sound, but it also has to move. A and C work but B (sound) doesn't. Here is the script I'm using: integer gCount; list particle_parameters=[]; list parse_parameters = []; vector pos; key avatar_key; vector water_min; vector water_max; integer lh; ripple() { particle_parameters = [ PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0), PSYS_PART_START_SCALE, <0.1, .1, FALSE>, PSYS_PART_END_SCALE, <.2,.2, FALSE>, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <.5,.6,1>, PSYS_PART_START_ALPHA, (float)0.5, PSYS_PART_END_ALPHA, (float)0.1, PSYS_SRC_BURST_PART_COUNT, (integer)30, PSYS_SRC_BURST_RATE, (float) 0.6, PSYS_PART_MAX_AGE, (float)3.0, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)4, PSYS_SRC_BURST_SPEED_MIN, (float).5, PSYS_SRC_BURST_SPEED_MAX, (float).5, PSYS_SRC_ANGLE_BEGIN, (float) 0.9*PI, PSYS_SRC_ANGLE_END, (float)0*PI, PSYS_SRC_ACCEL, <0.0,0.0, 0.0 >, PSYS_PART_FLAGS, (integer)( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK ) ]; } wave() { particle_parameters = [ PSYS_SRC_TEXTURE, "*****************" PSYS_PART_START_SCALE, <0.3,0.3,0.3>, PSYS_PART_END_SCALE, <0.1,0.1,0.1>, PSYS_PART_START_COLOR, <1,1,1>, PSYS_PART_END_COLOR, <1,1,1>, PSYS_PART_START_ALPHA, (float)1, PSYS_PART_END_ALPHA, (float)0.1, PSYS_SRC_BURST_PART_COUNT, (integer)8, PSYS_SRC_BURST_RATE, (float) 0.1, PSYS_PART_MAX_AGE, (float)5, PSYS_SRC_MAX_AGE,(float) 0.0, PSYS_SRC_PATTERN, (integer)4, PSYS_SRC_BURST_SPEED_MIN, (float)0.05, PSYS_SRC_BURST_SPEED_MAX, (float)0.1, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_ANGLE_BEGIN, (float) 0, PSYS_SRC_ANGLE_END, (float)0, PSYS_SRC_OMEGA, <0,0,1>, PSYS_SRC_ACCEL, <0,0,0>, PSYS_PART_FLAGS, (integer)( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK ) ]; } default { state_entry() { ripple(); llSetScale(<0.010, 0.010, 0.010>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(0, ALL_SIDES); llParticleSystem([]); } on_rez(integer rez_param) { if (rez_param != 0) { lh = llListen(rez_param, "", NULL_KEY, ""); llParticleSystem( particle_parameters ); llSetTimerEvent(1.8); } else { llSetScale(<1.0, 1.0, 1.0>); llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); llSetAlpha(1, ALL_SIDES); } } listen (integer ch, string name, key id, string msg) { llListenRemove(lh); parse_parameters = llParseString2List(msg, ["##"], [""]); avatar_key = (key)llList2String(parse_parameters, 0); water_min = (vector)llList2String(parse_parameters, 1); water_max = (vector)llList2String(parse_parameters, 2); llSensorRepeat("", avatar_key, AGENT, 10.0, PI, 0.1); wave(); } sensor(integer num_detected) { pos = llDetectedPos(0); if (llVecDist(<pos.x, pos.y, water_max.z>, llGetPos()) > 0.1) { if (pos.x > water_min.x && pos.y > water_min.y && pos.x < water_max.x && pos.y < water_max.y && pos.z > (water_min.z - 0.5) && pos.z < (water_max.z + 0.5)) { llSetLinkPrimitiveParamsFast(0, [PRIM_POSITION, <pos.x, pos.y, water_max.z>]); llParticleSystem( particle_parameters ); llSetTimerEvent(0.8); } else llDie(); } } no_sensor() { llDie(); } timer() { llSetTimerEvent(0.0); llParticleSystem([]); if (gCount%3 == 0) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1.0); } else if (gCount%3 == 1) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,1), 1.0); } else if (gCount%3 == 2) { llPlaySound(llGetInventoryName(INVENTORY_SOUND,2), 1.0); } } } Now I've tried a few things. Initially I was using llTriggerSound under the "sensor" section, so it would play the sound when the prim and avatar moved. The initial sound was too long and was spammed pretty bad, so I figured I'd need a timer and shorter sounds to play at intervals, so I found: http://community.secondlife.com/t5/Scripting/One-after-the-play-from-several-sound/td-p/499736 But, I needed it to be under the sensor area still, and so far as I know, I can't make a timer event in nother event (despite how much I want it to >.>). So I made the counter and put all the stuff I needed to in a new argument within the argument containing "llSetLinkPrimitiveParamsFast". That ALMOST worked, but the counter wasn't so once again, the 3 short audio files I had were being smashed together and played as one. (several retries by editing the counter and even adding "float gap = 0.2" also failed) So as a final effort that I knew would fail but decided to do anyway, was to put everything under that last part in the timer event (it was already there to end the script). And, like I thought it would, the sound only played when the prim stopped moving. SO! How do I get my sound(s) to play properly under the "Sensor" event where I need them to? Any ideas?
×
×
  • Create New...