Jump to content

Miranda Umino

Resident
  • Posts

    411
  • Joined

  • Last visited

Everything posted by Miranda Umino

  1. Other idea : string MSG_1 = "get lost";string QUESTION_1 = "You seriously want me to get lost?";string MSG_2 = "Ok then..";string MSG_3 = "Then why did you tell me t- >.< nvm...";string MSG_4 = "go away";string QUESTION_2 = "You really want me to go away?";string MSG_5 = "Ok";string MSG_6 = "Jeez, such a dolt, make up your mind already!";string YES ="yes";string NO ="no";default{ state_entry() { llOwnerSay( (string)llGetUsedMemory()); llListen(0,"", llGetOwner(), MSG_1); llListen(0,"", llGetOwner(), MSG_4); } listen(integer channel, string name, key id, string message) { if ( message == MSG_1) state getLost; else state goAway; }}state getLost{ state_entry() { llSay(0, QUESTION_1); llListen(0,"", llGetOwner(), YES); llListen(0,"", llGetOwner(), NO); } listen(integer channel, string name, key id, string message) { if (message == YES ) llSay(0, MSG_2); else llSay(0, MSG_3); state default; }}state goAway{ state_entry() { llSay(0, QUESTION_2); llListen(0,"", llGetOwner(), YES); llListen(0,"", llGetOwner(), NO); } listen(integer channel, string name, key id, string message) { if (message == YES ) llSay(0, MSG_5); else llSay(0, MSG_6); state default; } }
  2. I m not sure : some people may be offline when you give their acces code , and the IMs are sent to the box mail if people authorize them By default , it s authorized , and probably few people will tell you they didn t receive your access code , but it can happen . Be aware about this . There is too the email solution , but it s not in-world . And there is the new possibilty to send messages via https://my.secondlife.com ; but , people may accept the messages only from their friends .
  3. I m not sure : some people may be offline when you give their acces code , and the IMs are sent to the box mail if people authorize them By default , it s authorized , and probably few people will tell you they didn t receive your access code , but it can happen . Be aware about this . There is too the email solution , but it s not in-world . And there is the new possibilty to send messages via https://my.secondlife.com ; but , people may accept the messages only from their friends .
  4. Ctrl + Left Click are not detectable . Nevertheless , you can catch -> + left click <- + left click PgUp key + left click PgDown key + left click and some others In fact only a few keys are detected . And the right button mouse can t be detected neither . Check this wiki http://wiki.secondlife.com/wiki/Control If you do a Jira to do a request to add some keys or some mouse events , let me a message to vote it Other point : if you need to have an event because your prim has moved ( in a general way not only by cntrl + left click), you can detect it yet . For instance , by catching the events moving_start and moving_end http://wiki.secondlife.com/wiki/Moving_start
  5. Ctrl + Left Click are not detectable . Nevertheless , you can catch -> + left click <- + left click PgUp key + left click PgDown key + left click and some others In fact only a few keys are detected . And the right button mouse can t be detected neither . Check this wiki http://wiki.secondlife.com/wiki/Control If you do a Jira to do a request to add some keys or some mouse events , let me a message to vote it Other point : if you need to have an event because your prim has moved ( in a general way not only by cntrl + left click), you can detect it yet . For instance , by catching the events moving_start and moving_end http://wiki.secondlife.com/wiki/Moving_start
  6. Probably this function will require some permissions . Actually , if the user agrees, he can do : Controle + Shift + D to display menu advanced settings Choose debug settings Change SLURLTeleportDirectly at true
  7. llSetVelocity looks to be an useless function . It looks to do exactly the same thing that an alias for llApplyImpulse(llGetMass() * force, boolean ) Have i missed something about it ?
  8. It s ok , Thank you . The function works even if my tests have disapointed me . Every moves are only linear ? The object may spin around itself , but there are no splines paths , no rotation paths ?
  9. How is your object ? Linked ? Attached ? Many functions work differently if they are linked or not , are child or root prim , are attched or not For instance , for llTargetOmega : source http://wiki.secondlife.com/wiki/LlTargetOmega If the script is attached to the root prim, the entire object rotates around the region axisIf the object is attached then it rotates around the attachment axis If the script is attached to a child prim, the prim rotates around the local axisA Child prim can rotate around its own axis while the entire object rotates around another axis.
  10. For me this center is equal to the center of a bounding sphere . If you keep 4 points , the result is immediate . If you have more points , it can grow in complexity . The naive algorith is o(n5) . But some improvements in the theory have been done , and the current algorithms are linear-complexity Nevertheless the algorithm i know is not the same than yours . I m not sure if the piece of code below will help you , but i hope it will help someone : // to test , i ve build a linkset with 20 prims .// For the test, the prim root won t be used to compute the bounding sphere ( but it could with a different call )// The last prim ( nolink = 20) won t be used to compute the bounding sphere ; it s used to show visually the result of the bounding sphereinteger g_chrono;_trace(list l){ llOwnerSay(llList2CSV(l));}// INPUT string returned by llGetTimeStamps// OUTPUT returns the number of milliseconds of the monthinteger Millisec(string Stamp) { return (integer)llGetSubString(Stamp, 8, 9) * 86400000 + // Days (integer)llGetSubString(Stamp, 11, 12) * 3600000 + // Hours (integer)llGetSubString(Stamp, 14, 15) * 60000 + // Minutes llRound(((float)llGetSubString(Stamp, 17, -2) * 1000.0)) // Seconds.Milliseconds - 617316353; // Offset to fit between [-617316353,2147483547]}chronoStart(){ g_chrono = Millisec(llGetTimestamp()); }chronoStop(){ g_chrono = Millisec(llGetTimestamp()) - g_chrono; llOwnerSay("Chrono = "+ (string) g_chrono );}// INPUT 4 points in the surface of a sphere// OUTPUT list 1st position = center of the sphere 2nd position = radius of the spherelist SphereFrom4Points(vector p0, vector p1, vector p2, vector p3){ // mi points are the middle-point of each points // to simplify we ll divide by 2 later vector m0 = (p1 + p0) ; vector m1 = (p2 + p1) ; vector m2 = (p3 + p2) ; // ni points are the normal of the plan median between each points vector n0 = (p1 - p0) ; vector n1 = (p2 - p1) ; vector n2 = (p3 - p2) ; // intersection of 2 plans gives a line if they are not parallels // intersection of this line and the 3rd plan gives a point // If the 3 plans are the median plans , their intersection is the center of the sphere drawn by the 4 points given // analytic equation of a plan is n . u = n(a,b,c) . u(x,y,z) = ax +by+ cz = f with n the normal vector of the plan // f is the distance of the plan and is equal to the dot between the normal of the plan (n) and a point in this plan (m) float f0 = n0 * m0; float f1 = n1 * m1; float f2 = n2 * m2; // solve the equations by Gauss pivot // symplify the 2nd line with the 1st line f1 = f1 * n0.x - n1.x * f0; n1 = n1 * n0.x - n1.x * n0; // symplify the 3rd line with the 1st line f2 = f2 * n0.x - n2.x * f0; n2 = n2 * n0.x - n2.x * n0; // symplify the 3rd line with the 2nd line f2 = f2 * n1.y - n2.y * f1; n2 = n2 * n1.y - n2.y * n1; if ( (n2.z != 0 ) && (n1.y != 0 )&& (n0.x != 0 ) ) { // computes z and replace z in the firsts lines n2.z = f2 / n2.z ; n1.y = (f1 - n1.z * n2.z) / n1.y; n0.x = (f0 - n0.z * n2.z - n0.y * n1 .y ) / n0.x ; return [ 0.5 * < n0.x,n1.y,n2.z >, llVecMag( 0.5 * < n0.x,n1.y,n2.z > - p0 ) ]; } else return []; // case where the solutions are multiples ( intersection of the 3 plans don t give a point ) }// Returns the minimal and only the minimal sphere having the 3 points on its surface// based on http://en.wikipedia.org/wiki/Circumscribed_circle#Circumcircle_equations// INPUT 3 points in the surface of a sphere// OUTPUT list 1st position = center of the sphere 2nd position = radius of the sphere// normally there is an infinity of spheres solution . But the function returns where the diameter is the circle composed by the 3 points list SphereFrom3Points(vector p0, vector p1, vector p2){ vector n0 = (p0 - p2) ; vector n1 = (p1 - p2) ; vector center = ( ( llVecMag(n0)*llVecMag(n0)*n1 - llVecMag(n1)*llVecMag(n1)*n0 ) % ( n0 % n1) ) / ( 2 * llVecMag(n0%n1) * llVecMag(n0%n1) ) + p2; float radius = llVecDist(center, p2); return [center, radius]; }// INPUT points ; list of points 3D// sphere ; list 1st position center , 2nd position radius// precision ; precision , should be around the middle of the size of the prim // OUTPUT every points who are outside of the sphere are returned list leftPoints(list points, list sphere , float precision){ vector center = llList2Vector(sphere,0); float radius = llList2Float(sphere,1); integer z = llGetListLength(points); list result; while ( ~ z-- ) { if ( llVecDist(llList2Vector(points, z) , center ) > radius + precision ) result += [ llList2Vector(points, z) ]; } return result; }// Recursive function computing the "minimum" bouding sphere containing every points// the algorithm is a from [ Welzl ]// INPUT // points : list of points should be contained inside the sphere ( not empty at the 1st call)// p : size of the list used ( its not the size of the list in the recursive calls ) ( must be = size of the list in the 1st call)// b : number of points supporting the sphere ( must be 0 at the 1st call)// ap : index in the list of points ( must be 0 at the 1st call )// center : actual center of the bounding sphere candidate for the solution ( must be ZERO_VECTOR at the 1st call)// radius : actual radius of the bounding sphere candidate for the solution ( must be .0 at the firs call )// OUPUT// list : 1st element center of the bounding sphere c // 2nd element radius of the bounding sphere // the 1st call must be initialy boundingSphereFromPoints( points, llGetListLength(points) , 0, 0, ZERO_VECTOR, .0);list boundingSphereFromPoints(list points, integer p , integer b, integer ap , vector g_center, float g_radius){ vector tempA; vector tempB; vector tempC; vector tempD; integer i; integer j; list tempCircle; if ( b == 0) { g_radius = .0; g_center = ZERO_VECTOR; } else if ( b == 1) { g_radius = .01; g_center = llList2Vector(points, ap - 1); } else if ( b == 2) { tempA = llList2Vector(points, ap - 1); tempB = llList2Vector(points, ap - 2); g_center = (tempA + tempB) * 0.5; g_radius = llVecMag( 0.5 * ( tempA - tempB )); // _trace(["b=2", g_center, g_radius, tempA, tempB ]); } else if ( b == 3 ) { tempA = llList2Vector(points, ap - 1); tempB = llList2Vector(points, ap - 2); tempC = llList2Vector(points, ap - 3); tempCircle = SphereFrom3Points(tempA, tempB, tempC); if ( tempCircle != [] ) { g_center = llList2Vector(tempCircle,0) ; g_radius = llList2Float(tempCircle,1) ; } else { _trace(["Warning SphereFrom3Points , can t create sphere with 3 points ", tempA, tempB, tempC]); } // _trace(["b=3", g_center, g_radius, tempA, tempB, tempC ]); } else if ( b == 4 ) { tempA = llList2Vector(points, ap - 1); tempB = llList2Vector(points, ap - 2); tempC = llList2Vector(points, ap - 3); tempD = llList2Vector(points, ap - 4); tempCircle = SphereFrom4Points(tempA, tempB, tempC, tempD); if ( tempCircle != [] ) { g_center = llList2Vector(tempCircle,0) ; g_radius = llList2Float(tempCircle,1) ; } else { _trace(["Warning SphereFrom4Points , can t create sphere with 4 points ", tempA, tempB, tempC, tempD]); } //_trace(["b=4", g_center, g_radius, tempA, tempB, tempC, tempD] ); return [ g_center, g_radius ]; _trace(["ERROR b=4"]); } for ( i = 0; i < p ; i++) { tempA = llList2Vector(points, i + ap); if ( llVecDist(tempA, g_center) > g_radius ) { for ( j = i; j > 0; j-- ) { tempB = llList2Vector(points, j + ap); tempC = llList2Vector(points, j - 1 + ap); points = llListReplaceList( points, [ tempC ], j + ap, j + ap); points = llListReplaceList( points, [ tempB ], j -1 + ap, j -1 + ap); } tempCircle = boundingSphereFromPoints( points, i, b+1, ap + 1 , g_center, g_radius); g_center = llList2Vector(tempCircle,0); g_radius = llList2Float(tempCircle,1); } } return [ g_center, g_radius ];}default{ state_entry(){ llSetLinkPrimitiveParamsFast( LINK_ALL_CHILDREN, [PRIM_POSITION, ZERO_VECTOR, PRIM_SIZE, <0.1, 0.1, 0.1>] ); } touch_start(integer total_number) { integer iter; list points = []; for ( iter = 2 ; iter <= 19; iter++) { llSetLinkPrimitiveParamsFast( iter, [PRIM_POSITION, < (integer)llFrand(10.0)-10.0, (integer)llFrand(10.0)-10.0, (integer)llFrand(10.0)-10.0> ] ); points += llList2Vector(llGetLinkPrimitiveParams(iter, [PRIM_POS_LOCAL]) ,0 ) ; } chronoStart(); list result = boundingSphereFromPoints( points, llGetListLength(points) , 0, 0, ZERO_VECTOR, .0); chronoStop(); _trace(["Center / radius of bounding sphere = "] + result); // a call to verify if all the points are inside the sphere // verify manullay if you need inside these points _trace( [ "Points maybe outside = " ] + leftPoints(points, result, 0.1 ) ); vector g_center = llList2Vector(result,0); float g_radius = llList2Float(result,1); llSetLinkPrimitiveParamsFast( 20, [PRIM_POSITION, g_center, PRIM_SIZE, 2.0 * < g_radius, g_radius, g_radius>, PRIM_COLOR, -1, <0.5, 0.2, 0.8 >, 0.25 ]); }} .
  11. Normally you need 4 points on the surface of the sphere to find a sphere . (and not in the same plan ) 3 points are enough ( if not in the same line ) to find a circle , but there are several spheres who can draw this circle. Your code is using only 3 prims at the max ( p0,p1,p2) c0 can t be used because it s not on the surface Nevertheless , in some situations (depend of the set of points ), the smallest enclosing sphere would have maybe only 3 points on its surface , maybe 2 , or even maybe 1
  12. I can t find a way to test this function - when i go to BlueSteel , Magnum or LeTigre sims , i have an error "Name not defined" - when i go to Aditi grid, i have an error "Name not defined" - my viewer is Second Life 3.1.0 (243176) Oct 16 2011 - i have found a page telling the name is changing or will be changed but no more details -Oskar Linden has told one day that it was only on the "Sandbox - Bispinor" and "Sandbox - Weapons testing". in Aditi grid , but i can t find these sims with the search engine How to test this function ?
  13. I have tried with this piece of code to test the limit list listTimeStamp;integer numberIterations;integer Millisec(string Stamp) { return (integer)llGetSubString(Stamp, 8, 9) * 86400000 + // Days (integer)llGetSubString(Stamp, 11, 12) * 3600000 + // Hours (integer)llGetSubString(Stamp, 14, 15) * 60000 + // Minutes llRound(((float)llGetSubString(Stamp, 17, -2) * 1000.0)) // Seconds.Milliseconds - 617316353; // Offset to fit between [-617316353,2147483547]}default{ touch_start(integer total_number) { numberIterations = 50; listTimeStamp = []; llSetTimerEvent(0.001); } timer() { if ( --numberIterations > 0 ) { listTimeStamp += [ llGetTimestamp() ]; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION,llGetPos()+<0,0,0.01>]); } else { llSetTimerEvent(.0); integer i = llGetListLength(listTimeStamp) -1; integer pred = Millisec(llList2String(listTimeStamp, -1)); integer next; list result ; while ( i-- > 0) { next = pred; pred = Millisec(llList2String(listTimeStamp, i)); result += [next -pred]; } llOwnerSay(llList2CSV(result)); } }} The results are very different between the sims even if they have got many free spare time . In some sims , (not only the magnum and blusteel tests sims ) i have an average of 44 ms ( maybe 2 Frames ?? maybe one frame to enter in the timer event and one frame to call the library function llGetTimestamp ? ) [22:19] Object: 44, 45, 43, 44, 44, 45, 45, 45, 45, 44, 34, 92, 45, 46, 44, 44, 44, 45, 42, 123, 46, 43, 45, 43, 45, 44, 46, 45, 44, 45, 44, 43, 46, 44, 45, 44, 44, 45, 44, 45, 44, 43, 45, 45, 45, 43, 46, 45 On other sims ( with no lag and more of 15 ms spare time ) it s more between 60 and 120 ms [22:18] Object: 110, 68, 90, 111, 139, 408, 121, 87, 88, 70, 87, 98, 113, 113, 110, 91, 90, 178, 116, 110, 154, 114, 90, 108, 71, 86, 88, 70, 87, 69, 88, 67, 93, 86, 70, 87, 112, 68, 68, 86, 71, 67, 66, 91, 69, 87, 89, 91
  14. In my tests , dataserver events have no server lag : the FPS of the sim is not altered . Nevertheless , the delay of 0.1 second is awful to support for the final user when the notecad is big and when the scipt reads the whole notecard. I don t think you need to handle the 300 animations in memory to use your action ; only somes ( for instance a dozen ) is needed if you want to show a menu . Try to read small packets of several lines , prefetch, between each action . An already sorted notecad can help to minimize the calls of the dataserver . You may use a dichotomy algorithm on the sort field You may too use a "slave" script to read the notecad . For instance , if your script must display some lines of your notecard , call link_message to your slave script ; while the main script is delaying because of its display , the slave script reads the next lines of the notecard and link_mesage the lines to the main script .
  15. you are welcome. If you understand my code , i am glad
  16. //Message Constantsinteger AceHearts = 0;integer TwoHearts = 1;integer ThreeHearts = 2;integer FourHearts = 3;integer FiveHearts = 4;integer SixHearts = 5;integer SevenHearts = 6;integer EightHearts = 7;integer NineHearts = 8;integer TenHearts = 9;integer JackHearts = 10;integer QueenHearts = 11;integer KingHearts = 12;integer AceDiamonds = 13;integer TwoDiamonds = 14;integer ThreeDiamonds = 15;integer FourDiamonds = 16;integer FiveDiamonds = 17;integer SixDiamonds = 18;integer SevenDiamonds = 19;integer EightDiamonds = 20;integer NineDiamonds = 21;integer TenDiamonds = 22;integer JackDiamonds = 23;integer QueenDiamonds = 24;integer KingDiamonds = 25;integer AceSpades = 26;integer TwoSpades = 27;integer ThreeSpades = 28;integer FourSpades = 29;integer FiveSpades = 30;integer SixSpades = 31;integer SevenSpades = 32;integer EightSpades = 33;integer NineSpades = 34;integer TenSpades = 35;integer JackSpades = 36;integer QueenSpades = 37;integer KingSpades = 38;integer AceClubs = 39;integer TwoClubs = 40;integer ThreeClubs = 41;integer FourClubs = 42;integer FiveClubs = 43;integer SixClubs = 44;integer SevenClubs = 45;integer EightClubs = 46;integer NineClubs = 47;integer TenClubs = 48;integer JackClubs = 49;integer QueenClubs = 50;integer KingClubs = 51;integer MSG_RESET = 54;integer NOTHING = 0;integer JACK = -1;integer ONEPAIR = 1;integer TWOPAIRS = 2;integer THREEOFKIND = 3;integer FULLHOUSE = 4;integer STRAIGHT = 5;integer FLUSH = 5;integer FOUROFKIND = 6;integer STRAIGHTFLUSH = 7;integer ROYALFLUSH = 8;//Other Global Valuesinteger pc1;integer pc2;integer pc3;integer pc4;integer pc5;list DECK = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];list shuDeck;shuffleCards(){ llSay(0, "Shuffling Deck..."); shuDeck = llListRandomize(DECK, 0); llSleep(0.5);}dealCards(){ pc1 = llList2Integer(shuDeck, 0); pc2 = llList2Integer(shuDeck, 1); pc3 = llList2Integer(shuDeck, 2); pc4 = llList2Integer(shuDeck, 3); pc5 = llList2Integer(shuDeck, 4); llOwnerSay("cards = " + llList2CSV( [ pc1, pc2, pc3, pc4, pc5 ] )); checkwin([ pc1, pc2, pc3, pc4, pc5 ]); checkwin([ ThreeDiamonds, KingDiamonds, SevenDiamonds, TwoDiamonds, TenDiamonds ]); // a flush checkwin([ EightSpades, NineSpades, SevenSpades, SixSpades, TenSpades ]); // a straight flush checkwin([ EightSpades, NineDiamonds, SevenSpades, SixSpades, TenSpades ]); // a straight checkwin([ EightSpades, JackDiamonds, SevenSpades, SixSpades, JackSpades ]); // a pair checkwin([ EightSpades, JackDiamonds, SixDiamonds, SixSpades, JackSpades ]); // two pairs}integer checkwin( list cardvals) { list suits; list matched; integer pairs = 0; // number of pairs integer threes = 0; // number of three of kind integer fours = 0; // number of fours; integer flush = FALSE; integer straight = FALSE; cardvals = llListSort(cardvals,0, TRUE); integer i; integer j; for ( i = 0; i < 4; i++ ) { suits += [ 0 ]; // Initialise suits array to zero } for ( i = 0; i < 13; i++ ) { matched += [ 0 ]; // Initialise matched array to zero } for ( i = 0; i < 5; i++ ) { j = llList2Integer(cardvals, i) % 13 ; matched = llListReplaceList( matched, [ llList2Integer(matched, j) + 1 ], j, j ); // Update matched for cards // equivalent to matched[cardvals[i] % 13]++; j = (integer) (llList2Integer(cardvals, i) / 13) ; suits= llListReplaceList( suits, [ llList2Integer(suits, j) + 1 ], j, j ); // Update suits for cards // equivalent to suits[cardvals[i]/13]++; } // Check for pairs, threes and fours for ( i = 0; i < 13; i++ ) { if ( llList2Integer(matched, i) == 2 ) { pairs++; } else if ( llList2Integer(matched, i) == 3 ) { threes++; } else if ( llList2Integer(matched, i) == 4 ) { fours++; } } // Check for a flush for ( i = 0; i < 4; i++ ) { if ( llList2Integer( suits, i ) == 5 ) { flush = TRUE; } } if ( (llList2Integer(cardvals,4) - llList2Integer(cardvals,1) == 3) && // Consistent with (llList2Integer(cardvals,4) - llList2Integer(cardvals,0) == 12) && // A, T, J, Q, K... flush ) { // If we also have a flush, then its a royal flush llOwnerSay("Royal flush!"); return ROYALFLUSH; } else if ( llList2Integer(cardvals,4) - llList2Integer(cardvals,0) == 4 && flush ) { llOwnerSay("Straight flush!"); return STRAIGHTFLUSH; } // Sort cards by face value (necessary to check for a straight) for ( i = 0; i < 5; i++ ) { // equivalent to cardvals[i] = cardvals[i] % 13; cardvals = llListReplaceList( cardvals, [ llList2Integer(cardvals, i) % 13 ], i, i ); } cardvals = llListSort(cardvals,0, TRUE); if ( fours > 0 ) { llOwnerSay("Four of a kind!"); return FOUROFKIND; } else if ( threes == 1 && pairs == 1 ) { llOwnerSay("Full house!"); return FULLHOUSE; } else if ( flush ) { llOwnerSay("A flush!"); return FLUSH; } else if ( llList2Integer(cardvals,4) - llList2Integer(cardvals,3) == 1 && llList2Integer(cardvals,3) - llList2Integer(cardvals,2) == 1 && llList2Integer(cardvals,2) - llList2Integer(cardvals,1) == 1 && ( llList2Integer(cardvals,1) - llList2Integer(cardvals,0) == 1 || llList2Integer(cardvals,4) - llList2Integer(cardvals,0) == 12 ) ) { llOwnerSay("A straight!"); return STRAIGHT; } else if ( threes > 0 ) { llOwnerSay("Three of a kind!"); return THREEOFKIND; } else if ( pairs == 2 ) { llOwnerSay("Two pair!"); return TWOPAIRS; } else if ( pairs == 1 ) { llOwnerSay("One pair!"); return ONEPAIR; } // otionnally delete this piece of code . it s for machine games not table games else if ( llList2Integer(matched,0) == 2 || llList2Integer(matched,10) == 2 || llList2Integer(matched,11) == 2 || llList2Integer(matched,12) == 2 ) { llOwnerSay("Jacks or better!"); return JACK; } else { llOwnerSay( "No win! Bad luck!"); return NOTHING; }}default { state_entry() { shuffleCards(); dealCards(); }} I ve not tested fully it , but it should help you . The main ideas is to use card % 13 to have the value and card / 13 to have the suit And the second idea is to use temporary arrays ( lists in lsl ) to track your results of matches and suits The third idea is to do two different sorts to help your compares
  17. Nevertheless , it s possible to loop a youtube video . In fact it s dependant of the site who diffuses the video ( so , youtube for your instance ) . Sometimes thay have got a parameter to tell in the goal to loop the video . It s the case for youtube . So, for youtube , you may consult the documentation in this page http://code.google.com/intl/en/apis/youtube/player_parameters.html I give you an instance : let s guess you want to play in loop this video (full URL )or (short URL)To know this URL , you have clicked on the "share button" and checked the "complete or full link" option The general format to display in loop is : http://www.youtube.com/watch?v=VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID so for this video , to loop , you need to load this URL : http://www.youtube.com/watch?v=Wv20U7rJuwU?version=3&loop=1&playlist=Wv20U7rJuwU Of course , you could have a script who is reading some URLs and modify them in the right format with loop option before to display them on your prim Enjoy it
  18. 502 http error several times in a row . It s maybe not server laggy ( there are more javascript excecuted than lsl ) but it s awfully client laggy
  19. You just click on one of his message and choose mute For the items sent , you choose "close all" with sl2 or 3 And you can continue your usual activities . It s innofensive if you refuse everything If it s the guy i ve thought about it ( with a message to phone and a link to a bad site but named linden ) , he will probably with an another bot with zero days to act in an another place an another day Let s let waste his energy stupidly himself
  20. Nope . It s the copied script who has got the same key . It s because , without new compilation , the mono code is shared for efficiency . In its memory , the sim needs only to load one time the bytecode of the script , even if they are multiple : From http://wiki.secondlife.com/wiki/Mono : "Indeed, Mono can do what's called bytecode sharing. Suppose you have a region which uses many instances of the same script, like XYText or Puppeteer, for example. As long as all the instances share the same asset id, the bytecode will only be added to memory once, and shared by all the copies. Key to making this work is ensuring that you simply copy the scripts (or the objects the scripts are within) after they have been saved for the final time. If you have purchased a script that is used many times, ask the creator for a Mono version, and then copy that version into the objects. It's important that you copy the scripts, so that the asset id is the same. If you recompile each instance separately, they will get different asset ids and the engine won't be able to share the bytecode." Run this script to compare and understand : default{ state_entry() { llSay(0, "Key of object="+(string)llGetKey()); llSay(0, "Key of script="+(string)llGetInventoryKey(llGetScriptName( ) )); }} Result : [15:26] Object: Key of object=a94c1925-6c8c-0497-ee61-d41e2eebed69 [15:26] Object: Key of script=41536914-9885-d89a-7c86-b9e75e8ee9a5 After shift drag [15:26] Object: Key of object=221e84a2-ca03-a3f6-2651-2e491371ce49 [15:26] Object: Key of script=41536914-9885-d89a-7c86-b9e75e8ee9a5 After select all and recompile [15:28] Object: Key of object=a94c1925-6c8c-0497-ee61-d41e2eebed69 [15:28] Object: Key of script=af5c0090-a220-5089-1a3a-594c39a532c1 [15:29] Object: Key of object=221e84a2-ca03-a3f6-2651-2e491371ce49 [15:29] Object: Key of script=fe7823af-054e-8d78-0ba0-c8bb5bbabd3f Avoid to have different keys for your script ( for better performances ) and to recompile .In your script test with UUID of the prim and not of the script I think it s the same with content inside your prim (as waves , animations notecarsd other objetcs etc .. ). If you shift drag , the content has got the same keys
  21. I understand that some people want to share . But you don t answer well , or i don t understand well : why to connect with a lsl script ? The users may do exactly the same inside my.secondlide.com , and more secure Maybe you may have a look about a script with twitter to connect from secondlife . http://wiki.secondlife.com/wiki/Twitter_OAuth_Library It s not facebook of course , but twitter and facebook use both the OAuth protocol. Have a look too about http://developers.facebook.com/docs/authentication/ Nevertheless , personnaly , never i will trust as consumer , someone who has got my private key . Particulary if the script is not open source
  22. I don t care about the rights inside SL . What is the problem to see everybody inside SL wearing my items ? If people have fun with my items , i will be proud of this . But I care more about rights outside SL : i don t want my 3d model that i ve done to have fun inside SL be sold to turbosquid or other merchant sites who sell the model 3d higher price than inside SL. We are talking about real money , not virtual money
  23. either you don t need it either your goal is useless Second life people can already link their sl account with some social networks accounts as Facebook Twitter Flickr LinkedIn Plurk Youtube Check the page https://my.secondlife.com/en/settings/profile under social identities To add , the bind insidemy.secondlife.com is authetified and SSL secured . So it means not shareable without the final user agrees it. It s not easy to be secured within LSL So why people will they use your thing ?
  24. There is very little mesh on the grid as of now. So, unless you were in a mesh sandbox the likelyhood of mesh being the problem is pretty slim. Yes , there are very few meshes actually ... except inside sandboxes .. and i am working some scripts inside sandboxes too .. So what is your point ?
×
×
  • Create New...