Jump to content

Tenaar Feiri

Resident
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Tenaar Feiri

  1. steph Arnott wrote: What part off you are perfect do you not understand, in the SL world your script is not. I try to be polite and you just want to keep pushing.llGetMemory is a gestimate that is all. OK, and I conceded to your point about llGetUsedMemory() and used llScriptProfiler() instead. The difference in results were marginal at best. See, I'm not looking for "you are perfect" or "you are right". I'm looking for evidence that you have to back up your claim that moving code out of defined functions doesn't affect the memory usage either way. You've come off as terribly sarcastic and impolite through more than half of this debate, and now you're defaulting "you are right about everything" just because you think that's what I wanted to read, which is quite frankly offensive. If you cannot argue or debate without defaulting to such responses the moment you get sick of it, then you shouldn't engage in them in the first place. And if you are unwilling to stand for your own claims then I have no more time left for you.
  2. I just did the script profiler then, if it'll please you. Here's the results: With function: [08:00:26] clock face: This script used at most 7860 bytes of memory during function. Without function: [08:01:13] clock face: This script used at most 7228 bytes of memory during function. Script with function: integer talkToClockChan;integer Key2AppChan(key ID, integer App) { // Generates a unique channel per key, with additional app modifier. return 0x80000000 | ((integer)("0x"+(string)ID) ^ App);}list time;integer setup;integer minutehandLink;integer hourhandLink;funcRotateDials(){ rotation rot; if(!setup) // If we haven't set it up yet, it's time! { integer i = llGetNumberOfPrims(); integer x; for(;x<=i;x++) { if(llGetLinkName(x) == "minutehand") { minutehandLink = x; } else if(llGetLinkName(x) == "hourhand") { hourhandLink = x; } } rot = (rotation)llList2String(llGetLinkPrimitiveParams(minutehandLink, [PRIM_ROT_LOCAL]), 0); vector rot2 = llRot2Euler(rot); rot2 = <rot2.x,rot2.y,(rot2.z-0.105)>; rot = llEuler2Rot(rot2); llSetLinkPrimitiveParamsFast(minutehandLink, [PRIM_ROT_LOCAL, rot]); }} default{ state_entry() { talkToClockChan = Key2AppChan("3fb9a3b2-dcbf-4dfb-8740-4630ec499ff3", 143); llListen(talkToClockChan, "", NULL_KEY, ""); } touch_start(integer num) { llScriptProfiler(PROFILE_SCRIPT_MEMORY); funcRotateDials(); llScriptProfiler(PROFILE_NONE);llOwnerSay("This script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during function."); } listen(integer c, string n, key id, string m) { time = llParseString2List(m, [":"], []); } } And script without function: integer talkToClockChan;integer Key2AppChan(key ID, integer App) { // Generates a unique channel per key, with additional app modifier. return 0x80000000 | ((integer)("0x"+(string)ID) ^ App);}list time;integer setup;integer minutehandLink;integer hourhandLink;default{ state_entry() { talkToClockChan = Key2AppChan("3fb9a3b2-dcbf-4dfb-8740-4630ec499ff3", 143); llListen(talkToClockChan, "", NULL_KEY, ""); } touch_start(integer num) { llScriptProfiler(PROFILE_SCRIPT_MEMORY); //funcRotateDials(); rotation rot; integer i = llGetNumberOfPrims(); integer x; for(;x<=i;x++) { if(llGetLinkName(x) == "minutehand") { minutehandLink = x; } else if(llGetLinkName(x) == "hourhand") { hourhandLink = x; } } rot = (rotation)llList2String(llGetLinkPrimitiveParams(minutehandLink, [PRIM_ROT_LOCAL]), 0); vector rot2 = llRot2Euler(rot); rot2 = <rot2.x,rot2.y,(rot2.z-0.105)>; rot = llEuler2Rot(rot2); llSetLinkPrimitiveParamsFast(minutehandLink, [PRIM_ROT_LOCAL, rot]); llScriptProfiler(PROFILE_NONE);llOwnerSay("This script used at most " + (string)llGetSPMaxMemory() + " bytes of memory during function."); } listen(integer c, string n, key id, string m) { time = llParseString2List(m, [":"], []); } } That should make you happy. Are you going to tell me that llScriptProfiler() is unreliable too, now? I really don't understand why you're being so unpleasant about this. You're not being constructive at all.
  3. steph Arnott wrote: Any way, do as you feel suits you. Used memory is not very reliable. This isn't about what suits me, it's about whether I am right or wrong in my advice to try and move code out of functions & into the executing code itself to conserve memory. I'm using GetUsedMemory() because I don't want to mess with my script using the memory profiler, but it already looks promising. If I'm wrong, I'm perfectly willing to accept that--as I have done earlier in this topic, but I'm not just going to take your word for it if what I'm observing is what seems correct. Just telling me that I am wrong when giving advice, and then not providing any examples as to why I'm wrong, does in no way contribute to the topic, and it does not help the OP. And that's all I care about, helping the OP. If I'm wrong, I'm wrong & that's fine. Correct me then with a practical example. Educate me, so other people who come find this topic can be educated too.
  4. By running this at the end of the function before it clears, without doing any manual clearing of the temporary variables defined during runtime: llOwnerSay((string)llGetUsedMemory()+"b"); This returns the amount of memory--in bytes, that the script is currently using.
  5. right, I went ahead & tested this to be sure now. I gained nearly 500 bytes of memory just by removing a function & moving its code into the executing code, so I don't know why you say it makes no difference. Here's the code I tested it with: integer talkToClockChan;integer Key2AppChan(key ID, integer App) { // Generates a unique channel per key, with additional app modifier. return 0x80000000 | ((integer)("0x"+(string)ID) ^ App);}list time;integer setup;integer minutehandLink;integer hourhandLink;/*funcRotateDials(){ rotation rot; if(!setup) // If we haven't set it up yet, it's time! { integer i = llGetNumberOfPrims(); integer x; for(;x<=i;x++) { if(llGetLinkName(x) == "minutehand") { minutehandLink = x; } else if(llGetLinkName(x) == "hourhand") { hourhandLink = x; } } rot = (rotation)llList2String(llGetLinkPrimitiveParams(minutehandLink, [PRIM_ROT_LOCAL]), 0); vector rot2 = llRot2Euler(rot); rot2 = <rot2.x,rot2.y,(rot2.z-1)>; rot = llEuler2Rot(rot2); llSetLinkPrimitiveParamsFast(minutehandLink, [PRIM_ROT_LOCAL, rot]); }}default{ state_entry() { talkToClockChan = Key2AppChan("a key", xxx); llListen(talkToClockChan, "", NULL_KEY, ""); } touch_start(integer num) { funcRotateDials(); llOwnerSay((string)llGetUsedMemory()+"b"); } listen(integer c, string n, key id, string m) { time = llParseString2List(m, [":"], []); } } The first two runs of it yielded these results: [07:31:08] clock face: 7800b [07:31:10] clock face: 7740b And then it was stuck on 7740b memory usage with subsequent runs. Moved the code, so now it looked like this: integer talkToClockChan;integer Key2AppChan(key ID, integer App) { // Generates a unique channel per key, with additional app modifier. return 0x80000000 | ((integer)("0x"+(string)ID) ^ App);}list time;integer setup;integer minutehandLink;integer hourhandLink;default{ state_entry() { talkToClockChan = Key2AppChan("a key", xxx); llListen(talkToClockChan, "", NULL_KEY, ""); } touch_start(integer num) { rotation rot; integer i = llGetNumberOfPrims(); integer x; for(;x<=i;x++) { if(llGetLinkName(x) == "minutehand") { minutehandLink = x; } else if(llGetLinkName(x) == "hourhand") { hourhandLink = x; } } rot = (rotation)llList2String(llGetLinkPrimitiveParams(minutehandLink, [PRIM_ROT_LOCAL]), 0); vector rot2 = llRot2Euler(rot); rot2 = <rot2.x,rot2.y,(rot2.z-1)>; rot = llEuler2Rot(rot2); llSetLinkPrimitiveParamsFast(minutehandLink, [PRIM_ROT_LOCAL, rot]); llOwnerSay((string)llGetUsedMemory()+"b"); } listen(integer c, string n, key id, string m) { time = llParseString2List(m, [":"], []); } } The results: [07:31:59] clock face: 7172b [07:32:02] clock face: 7200b It might look small, but roughly 500 bytes is a pretty big improvement imo. This was done in Mono. I'm observing that moving code out of a function & into the events themselves can in fact, noticeably reduce the amount of memory a program uses.
  6. steph Arnott wrote: Functions are alocated what they need, since mono the size located is the same as inline. If the function is called more than once then there is no saving. TYPO Thank you for clarifying that, that's exactly what I meant but apparently was unable to convey. I'm talking about one-off functions.
  7. steph Arnott wrote: Tenaar Feiri wrote: Having a lot of functions can take up memory. As I recall, just defining a function takes up a sizable amount of memory without putting anything in it, so if you can put more code in the executing script, that will help. Lost me on that one. Defined functions take up e very little memory. "Sizable amount of memory" was actually supposed to be in the first sentence. It should read: "Having a lot of functions can take up a sizable amount of memory. As I recall, just defining a function takes up a bit even without putting anything in it, so if you can put more code in the executing script, that will help." I'm running on fumes atm, so I should probably stop posting until I've had some food & some coffee. I'll go make the correction.
  8. Qie Niangao wrote: Tenaar Feiri wrote: You can also use lists to store global variables in than defining each individual one as a global, but I'd be careful with that too. It can help you save space, but depending on what you put in it, it can also increase memory usage! Do we know an example of list storage saving space? It seems quite counter to (my) expectations. Ah, sorry. I just tested it, & I was quite mistaken. Whoops! Scratch that bit then! But either way, the rest of my advice should hold. Concatenate & optimize what one can to save memory.
  9. *edit #2* I should stop posting when I'm unable to concentrate. Fixed another couple of errors in my post. Having a lot of functions can take up a sizable amount of memory. As I recall, just defining a function takes up a bit even without putting anything in it, so if you can put more code in the executing script, that will help. You can also use lists to store global variables in than defining each individual one as a global, but I'd be careful with that too. It can help you save space, but depending on what you put in it, it can also increase memory usage! And using llList2x functions to pull data from the list, and llListReplaceList() to update the values again both use up a bit of CPU power. *edit* Nevermind the strikethrough, I had a brain fart. Most of the time, putting variables in lists do not seem to help memory usage at all. Also try seeing what calls your script is making; perhaps you can concatenate them! If you've got a function that deals with a lot of temporary variables, try putting them all in a single temporary list instead, as that can reduce memory usage. If you're dealing with menus, using a function like list menu(integer int) { if(menu==1){return ["An entry"];} } will use more memory and unnecessary CPU power than just defining that list as a global. My advice would be to concatenate what you can concatenate, trim down any fat & optimize everything that can be optimized. Generally, the less script calls you have to do to do a thing, the better.
  10. This should do what you want: function: integer whichButton (float x, float y){ integer xminx = 1; integer xmaxx = 2; integer yminy = 3; integer ymaxy = 4; integer i = 0; integer b = (llGetListLength(buttons) / 5); for(; i < b; i++) { float xmin = llList2Float(buttons, xminx); float xmax = llList2Float(buttons, xmaxx); float ymin = llList2Float(buttons, yminy); float ymax = llList2Float(buttons, ymaxy); if(x >= xmin && x <= xmax && y >= ymin && y <= ymax) { return (xminx - 1); } xminx += 5; xmaxx += 5; yminy += 5; ymaxy += 5; } return -1;} list: list areas = [ /* area Name x min x max y min y max */ /*0*/ "ar1", 0.232907, 0.770735, 0.049140, 0.211435, //1,2,3,4 /*5*/ "ar2", 0.232983, 0.791216, 0.238534, 0.406825, //6,7,8,9 /*10*/ "ar3", 0.212880, 0.791064, 0.497025, 0.593129, //11,12,13,14 /*15*/ "ar4", 0.232983, 0.791216, 0.614254, 0.779570, //16,17,18,19 /*20*/ "ar5", 0.232983, 0.791216, 0.803625, 0.965874 //21,22,23,24 ]; touch_start(): vector point = llDetectedTouchST(0); integer which = whichButton(point.x, point.y); if(which == -1) { return; } if(which == 0) // ar1 {// Your code here.} All you need to do is find the face coordinates of where you're touching, then insert the values into the appropriate list entry to create a "grid" that, when that area is touched, returns a number. whichButton() will always return numbers in increments of 5. So the grid set up with the coordinates of list entries 0 through 4, they will create an invisible "button" that when clicked, returns 0. Then the subsequent five entries, 5 through 9, will create another "button" that when clicked, returns 5. And so on. Here's the list again so it's easier to see what I mean. list areas = [ /* area Name x min x max y min y max */ /*0*/ "ar1", 0.232907, 0.770735, 0.049140, 0.211435, //1,2,3,4 /*5*/ "ar2", 0.232983, 0.791216, 0.238534, 0.406825, //6,7,8,9 /*10*/ "ar3", 0.212880, 0.791064, 0.497025, 0.593129, //11,12,13,14 /*15*/ "ar4", 0.232983, 0.791216, 0.614254, 0.779570, //16,17,18,19 /*20*/ "ar5", 0.232983, 0.791216, 0.803625, 0.965874 //21,22,23,24 ];
  11. That makes sense. The data's not important enough to justify sending it to my ext. server, but at least I know it's not possible to anticipate the restarts! It's a shame we can't trust the object attributes, really. Or the script memory for that matter; I've had scripts randomly reset themselves whenever someone logs in wearing it, without there being a single reset call in the code to begin with, so I learned not to trust that the hard way. In any case, thanks for answering! Appreciate it!
  12. Hey! The title pretty much asks my question for me, but I'll just go ahead & repeat it here. Can I detect when a sim is *about* to be restarted using LSL? I'm working on a script that deals with some data & saves it to the object description and an invisible llSetText() to make it easier to have it persist through restarts & such. The script saves the data periodically, but I don't want to accidentally lose any of the information it's currently processing if a restart unexpectedly happens in the middle of its workflow. I know scripts generally just 'pause' when the server's down & resume again afterwards but I don't trust LL's servers to reliably retain my script data. Is there a way my script can notice when the server's going to be restarted or brought down, so it can stop its work & save the data so it can safely resume its operation afterwards?
  13. Yeah, I'm sure. For some reason it was still giving me a syntax error, but I copied the same line which was giving the error, then deleted that one & pasted it in again, and that solved it. This language is weird as heck >.> Or it might just be an undocumented bug in the compiler.
  14. Ron Khondji wrote: Like this for instance: Edit: Scratch the below post. Turns out I just had to copy-paste it, delete it from the script & re-add it again. Thank you for that, it looks much cleaner now! There's just one issue with it right now & that shows what I mean with how LSL is difficult & cumbersome to learn x3 There's a syntax error on line 105, but I can't see where it is because that line looks proper. It involves this: if (!safe) llSensorRepeat("","",AGENT_BY_LEGACY_NAME,5.0,PI,2.0);
  15. dd Temin wrote: Hi, I have 2 suggestions... 1. Why not just do a random number "coin flip" any time an avatar is detected within 5 meters.......to decide if you need particles or not. (safe or unsafe) 2. You will be able to write much simpler more efficient scripts..if you learn how to script without using state changes. You will be suprised at how much easier your scripts can be.. Hi! I need the particle spitter to consistently spit particles at everyone who comes within range for the 4 hours it's in "unsafe mode", so having it do a random coin flip ever time it detects an agent within range would defeat its purpose, really. I do agree I should learn how to script without using state changes as well. LSL is just a very difficult and cumbersome language to learn :<
  16. Hey y'all! I'm currently trying to write a script that shoots a burst of particles toward any agent who comes within 5m of an object, but I'm really having trouble with the sensor event. The code I'm writing is designed to randomly pick a number between 0 & 1000 every 4 hours, and then alter the states depending on the result between "safe", in which no particles will be spewed at an unsuspecting passersby, and "unsafe" where it will fire at will. I've almost gotten it to work the way I want to, but I'm having one big issue: The particles are only going off once, and then the sensor event appears to die (along with the timer), and it completely halts the script & requires a manual reset. What I need the script to do is to continuously launch bursts of particles at nearby avatars, and stop launching those bursts when it gets out of range. Could I have a little help with it please? :3 (For the curious, this script is meant for roleplaying purposes with scripted NPCs. I also should be able to do the targeting on my own; I'm currently most concerned with getting the base script to work right. I'm also incredibly sorry about how messy it is; I apparently can't control states as global events. >.>) Script enclosed: ////////////////////////////////////////////// // Particle spitter script. // By Tenaar Feiri. ////////////////////////////////////////////// ////////////////////////////Particle scripts!///////////////////// // SECTION ONE: APPEARANCE -- These settings affect how each particle LOOKS. integer glow = TRUE; // TRUE or FALSE(*) vector startColor = <1,0,0>; // RGB color, black<0,0,0> to white<1,1,1>(*) vector endColor = <1,0,0>; // float startAlpha = 1.0; // 0.0 to 1.0(*), lower = more transparent float endAlpha = 1.0; // vector startSize = <0.1,0.1,0>; // <0.04,0.04,0>(min) to <10,10,0>(max>, <1,1,0>(*) vector endSize = <0.1,0.1,0>; // (Z part of vector is discarded) key texture = "419c3949-3f56-6115-5f1c-1f3aa85a4606"; // Texture used for particles. Texture must be in prim's inventory. // SECTION TWO: FLOW -- These settings affect how Many, how Quickly, and for how Long particles are created. // Note, integer count = 5; // Number of particles created per burst, 1(*) to 4096 float rate = 0.1; // Delay between bursts of new particles, 0.0 to 60, 0.1(*) float age = 3.0; // How long each particle lives, 0.1 to 60, 10.0(*) float life = 2.0; // When to stop creating new particles. never stops if 0.0(*) // SECTION THREE: PLACEMENT -- Where are new particles created, and what direction are they facing? float radius = .30; // 0.0(default) to 64? Distance from Emitter where new particles are created. float innerAngle = 0.75; // "spread", for all ANGLE patterns, 0(default) to PI float outerAngle = 0.0; // "tilt", for ANGLE patterns, 0(default) to TWO_PI, can use PI_BY_TWO or PI as well. integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE; // Choose one of the following: // PSYS_SRC_PATTERN_EXPLODE (sends particles in all directions) // PSYS_SRC_PATTERN_DROP (ignores minSpeed and maxSpeed. Don't bother with count>1 ) // PSYS_SRC_PATTERN_ANGLE_CONE (set innerangle/outerange to make rings/cones of particles) // PSYS_SRC_PATTERN_ANGLE (set innerangle/outerangle to make flat fanshapes of particles) vector omega = <0,0,0>; // How much to rotate the emitter around the <X,Y,Z> axises. <0,0,0>(*) // Warning, there's no way to RESET the emitter direction once you use Omega!! // You must attach the script to a new prim to clear the effect of omega. // SECTION FOUR: MOVEMENT -- How do the particles move once they're created? integer followSource = FALSE; // TRUE or FALSE(*), Particles move as the emitter moves, (TRUE disables radius!) integer followVel = FALSE; // TRUE or FALSE(*), Particles rotate towards their direction integer wind = FALSE; // TRUE or FALSE(*), Particles get blown away by wind in the sim integer bounce = FALSE; // TRUE or FALSE(*), Make particles bounce on Z altitude of emitter float minSpeed = 1.3; // 0.01 to ? Min speed each particle is spit out at, 1.0(*) float maxSpeed = 1.5; // 0.01 to ? Max speed each particle is spit out at, 1.0(*) vector push = <0,0,-0.6>; // Continuous force pushed on particles, use small settings for long lived particles key target = ""; // Select a target for particles to arrive at when they die // can be "self" (emitter), "owner" (you), "" or any prim/persons KEY. // Script variables integer flags; list sys; updateParticles() { flags = 0; if (target == "owner") target = llGetOwner(); if (target == "self") target = llGetKey(); if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK; if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK; if (startColor != endColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK; if (startSize != endSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK; if (wind) flags = flags | PSYS_PART_WIND_MASK; if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK; if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK; if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK; sys = [ PSYS_PART_MAX_AGE,age, PSYS_PART_FLAGS,flags, PSYS_PART_START_COLOR, startColor, PSYS_PART_END_COLOR, endColor, PSYS_PART_START_SCALE,startSize, PSYS_PART_END_SCALE,endSize, PSYS_SRC_PATTERN, pattern, PSYS_SRC_BURST_RATE,rate, PSYS_SRC_ACCEL, push, PSYS_SRC_BURST_PART_COUNT,count, PSYS_SRC_BURST_RADIUS,radius, PSYS_SRC_BURST_SPEED_MIN,minSpeed, PSYS_SRC_BURST_SPEED_MAX,maxSpeed, PSYS_SRC_TARGET_KEY,target, PSYS_SRC_INNERANGLE,innerAngle, PSYS_SRC_OUTERANGLE,outerAngle, PSYS_SRC_OMEGA, omega, PSYS_SRC_MAX_AGE, life, PSYS_SRC_TEXTURE, texture, PSYS_PART_START_ALPHA, startAlpha, PSYS_PART_END_ALPHA, endAlpha ]; float newrate = rate; if (newrate == 0.0) newrate=.01; if ( (age/rate)*count < 4096) llParticleSystem(sys); else { llInstantMessage(llGetOwner(),"Your particle system creates too many concurrent particles."); llInstantMessage(llGetOwner(),"Reduce count or age, or increase rate."); llParticleSystem( [ ] ); } } integer switch=0; key name; ////////////////////////Timer scripts!//////////////////////////// // Define the numerous variables. key gUUID = ""; // Admin to IM if someone crosses the boundaries. float timeLimit = 15; // Timer reset limit (in seconds). Default: 14400 (4 hours). float Number; // Float. float safeguard; // To help tell the reset script what to do. integer rand(integer max) { float f_max = (float)max;//we do this typecast explicitly (otherwise the compiler just fills it in for us. if(max != f_max)//max was an integer that couldn't be made into a float nicely. return (integer)(max * llFrand(1.0));//multiply max by a rand float with a 0->1 range. return (integer)llFrand(f_max);//the convert was clean so make LSL do the work. } // Typecast a float to a string. string float2string(float Number) { string result=(string)Number; integer i=llStringLength(result); while(llGetSubString(result,--i,i)=="0"); result = llDeleteSubString(result,i+1,llStringLength(result)); integer dot = llStringLength(result)-1; if(llGetSubString(result,dot,dot) == ".") result = llDeleteSubString(result,dot,dot); return result; } /////////Execute!////////// // Start by generating a random number. default { // When the default state is entered, begin randomization. state_entry() { switch==0; if(switch==0) { llSensorRemove(); llSay(0,"Hearts off"); llParticleSystem( [ ] ); } float Number = rand(1000); // Random number between 0 & 1000. // If the result is less than 300, make the object safe. if(Number <= 300) { float safeguard = 0; // For debugging purposes, tell the owner the result. llOwnerSay((string)Number); state wSafe; } // If the result is more than 600, make the object unsafe. else if(Number >= 600) { float safeguard = 1; // Snitch about the number. Debugging. llOwnerSay((string)Number); state unsafe; } else { state restart; } } } // Safe mode! state wSafe { state_entry() { llParticleSystem( [ ] ); switch==0; if(switch==0) { llSensorRemove(); llSay(0,"Hearts off"); llParticleSystem( [ ] ); } // For testing. llOwnerSay("We're in safe mode!"); // Set the string so we know where we are. string nState = "safe"; // Set the timer event. llSetTimerEvent(timeLimit); } no_sensor() { llParticleSystem( [ ] ); } // Check the timer! timer() { // Stop the timer event to prevent lag. llSetTimerEvent(0.0); // For debugging. llOwnerSay("Generating..."); float Number = rand(1000); // Random number between 0 & 1000. // If the result is less than 300, make the object safe. if(Number <= 300) { // Set the string so we know where we are. //string nState = "safe"; float safeguard = 0; // For debugging purposes, tell the owner the result. llOwnerSay((string)Number); state restart; } // If the result is more than 600, make the object unsafe. else if(Number >= 600) { // Set the string so we know where we are. //string nState = "unsafe"; float safeguard = 1; // Snitch about the number. Debugging. llOwnerSay((string)Number); state unsafe; } else { state restart; } } } // Unsafe mode! state unsafe { state_entry() { llParticleSystem( [ ] ); // For testing. llOwnerSay("We're in unsafe mode!"); // For testing. name = llGetOwner(); // Set the timer event. llSetTimerEvent(timeLimit); //llSensor("", NULL_KEY, AGENT_BY_LEGACY_NAME, 30.0, PI); // Begin particles! if(switch==0) { switch=1; llSensorRepeat("","",AGENT_BY_LEGACY_NAME,5.0,PI,2.0); llSay(0,"Hearts on"); } } sensor(integer num_detected) { if(num_detected && switch==1) { updateParticles(); float safeguard = 1; llSleep(timeLimit); state restart; } } no_sensor() { llParticleSystem( [ ] ); } // Check the timer! timer() { // Stop the timer event to prevent lag. llSetTimerEvent(0.0); // For debugging. llOwnerSay("Generating..."); float Number = rand(1000); // Random number between 0 & 1000. // If the result is less than 300, make the object safe. if(Number <= 300) { // Set the string so we know where we are. //string nState = "safe"; float safeguard = 0; // For debugging purposes, tell the owner the result. llOwnerSay((string)Number); state wSafe; } // If the result is more than 600, make the object unsafe. else if(Number >= 600) { // Set the string so we know where we are. //string nState = "unsafe"; float safeguard = 1; // Snitch about the number. Debugging. llOwnerSay((string)Number); state restart; } else { state restart; } } } // Restart a state. state restart { state_entry() { if(safeguard == 0) { llOwnerSay("Safe reset!"); state wSafe; } else if(safeguard == 1) { llOwnerSay("Unsafe reset!"); state unsafe; } } }
  17. Hey y'all! I'm currently trying to make a couple of character mods based on a few Kinzart Kreetures AVs, namely: KZK Shadow Leopard KZK Snow Leopard KZK Gold Serval My problem is that I'm lacking textures that match the colours of the skins for my prim parts, and the colouring system in SL is inconsistent and therefore sucks majorly, so I'm hoping there are any good texture makers out there who'd be willing to let me commission a bunch of textures that would match well with these three AVs? What I need is a general-purpose spotty texture, a handpaw texture, prim leg texture, a footpaw texture and a somewhat feathery texture. I need one for each of the three AVs, and I'd prefer if the commission didn't get too expensive (I'm thinking maybe... 13-15k L$ total?). Anyone? edit: I would prefer fullperm textures so I could distribute them among the accounts that /I/ use and I am perfectly willing to bind myself to a contract stating that I may only have them for personal use. If something like that could be worked out, I'd love ya forever!
  18. I've an update on this issue now. Since disabling Adobe Flash Player's hardware acceleration, I've had ZERO crashes and memory leaks from SL V1, 2 AND 3 in 3 days. I've tested it for 12hrs straight, every day, for 3 days and have had no issues. I'd suggest everyone gives it a try. To disable hardware acceleration, simply right-click on any Adobe-based flash application or video player, go to "Settings" and you should see it ticked on by default the moment the settings window opens. Untick it & close. Please let me know if this works for you guys.
  19. Problem still occurs on both the Dev. viewer AND the V2 Beta. I don't suppose anyone's found a solution, or a workaround for the excessive RAM usage yet? I've come up blank on my end =|
  20. RAM is still increasing for me with the development viewer, BUT it's not increasing as rapidly as it does with the current release of V2. Which is quite an improvement; I'm actually able to play with a V2 viewer on Windows for the first time since late January. EDIT: I could play for 2.5 hours without crashing due to memory overload now, as opposed to my previous 45 minutes. Improvement, but not quite there yet.
  21. That is seriously great news! I'll be sure to check it out myself soon-ish! EDIT: After 30-45 minutes of testing, I've found myself at a stable 1.5gb RAM usage, nothing more. Let's see what happens when the peak hours of my favourite Sim kick in, but so far it seems good. Also, the development viewer appears to be dropping data from the RAM when it's no longer needed which is excellent! My jaw literally dropped seeing a decrease in RAM as I played as opposed to a steady increase.
  22. I think this is a memory leak that needs to be taken a serious look at, a few people I know & play with also experience the same issue. One of them's got a beast of a computer that's ready for DX11 and runs extremely computer-intensive games like Crysis 2 & Homefront pretty damn well, but when it comes to Second Life V2, the RAM just fills up until the software or the computer dies on itself. The viewer shouldn't pass 2gb in memory usage, not as a 32-bit application. It NEEDS to clear the RAM of data that is no longer in use.
  23. I've also had the same problem in Windows Vista 32-bit, ATI Mobility Radeon 2000-series (I think that's the one, I can't remember off the top of my head), 2gb RAM & a 2.2Ghz dual-core Intel Pentium CPU, laptop.
  24. No, I've never had this problem with any other application, not even with web browsing. Only V2 viewers seem to have this issue for me, V1 runs fine. Can run V1 for 24 hours straight without as much as a hiccup (tested). That's what I find to be the weirdest part, really. Everything else works fine, OpenGL applications, DX applications, & other applications unrelated to gaming, music sequencing software-- none of that crashes, shuts down my PC or closes itself. Only V2 viewers seem to do that. I'm running Win7 x64 with 6gb RAM, and an ATI Radeon HD 4600-series GFX card, if it'll help. Also, I used to run Linux Kubuntu on this very same computer some months back with V2, and I had no problems then. No crashes at all, it worked perfectly fine, but then I was forced to swap to Windows for my music software and since then I had to downgrade to V1 in order to safely play SL.
  25. Yes I have, but I had no noticeable improvements to the memory usage. Currently running on a Cache of 128mb. (down from 512)
×
×
  • Create New...