Jump to content

SubZeroWins

Resident
  • Posts

    162
  • Joined

  • Last visited

Posts posted by SubZeroWins

  1. I added one more list item for each person as for their key id, so I ran the following code

    list highscores = [8, "3c9de8a0-1f38-4882-8dea-fdaee69f0fb6", "SubZeroWins", 10, "4354-32342324-3324342-3224323", "someotheravatar"];
    
    default
    {
        touch_start(integer total_number)
        {
        highscores = llListSort(highscores, 2, FALSE);
        integer a;
            for(a = 0; a < llGetListLength(highscores); ++a)
            {
            llOwnerSay((string)llList2String(highscores,a) + "\n");
            }
        }
    }

    This is what returned:

    SubZeroWins
    10
    4354-32342324-3324342-3224323
    someotheravatar
    8
    3c9de8a0-1f38-4882-8dea-fdaee69f0fb6

     

    It shouldnt, right?

  2. Hello all

    I have 2 lists which are parallel. I need to order the first one and at the same time order the second one (based the first's order)

    list Names=["John","Chris",George"]
    list Points["10","9","15"]

    Given the lists above:

    John has 10 points

    Chris has 9 points

    George has 15 points

     

    I will first order the Points list descending, using llListSort to become

    list Points=["15","10","9"]

    The Names list should now be ordered like

    list Names=["George","John","Chris"]

     

    I read a post for this which it seems to be complicated for me, can this work for me or should I search for another solution?

  3. 1 hour ago, animats said:

    There's a L$0 full-perm wheel on Marketplace for this: https://marketplace.secondlife.com/p/Steam-Fair-Wonder-Wheel-4-prims/6324032

    wonderwheel2.thumb.png.368c008dcd8b5ec953408c4f29875168.png

    Full perms, so you can look at the code. Here's the inner loop which runs that wheel:

    
         while(numberMoves > 0)
         {
            angle += changeAngle;
            llSetLinkPrimitiveParamsFast(linkNumber,
                                        [PRIM_ROTATION,
                                        llEuler2Rot(<0.0,0.0,angle>)*llList2Rot(baseRot,0)/llGetRootRotation()/llGetRootRotation()]);
            llSleep(0.003); // Sleep controls spin duraction, was 0.03
            changeAngle *= 0.98;//deceleration of wheel only
            numberMoves -= 1;
         }
        
        baseRot = llGetLinkPrimitiveParams(linkNumber,[PRIM_ROTATION]);
        vector finalRot = llRot2Euler(llList2Rot(baseRot,0)/llGetRootRotation());

    It's real prim movement, not viewer side animation. It's really random, too; not rigged. That sleep is shorter than it needs to be, though. 0.03 second works fine if you change some of the other constants that control wheel timing. Any sleep shorter than 0.022 second is too short, because that's the minimum physics frame time and nothing in-world will happen faster than that. Shorter, and you're wasting script time and may get throttled.

    Where was that hidden lol I was searching for days for one, its very good, thank you so much!

    • Like 1
  4. Hello all,

    Im trying to create a simple wheel of fortune, since so far I managed to make it spin

    default
    {
    	touch_start(integer total_number)
        {
        llSetTimerEvent(1.0);
        llTargetOmega(<0.0,0.0,1.0>,1.0,1.0);
        }
        
        timer()
        {
        llOwnerSay((string)llGetLocalRot());
        }
    }

    the script is inside the wheel which is part of a linkset as a child, however when trying to get its current rotation I always get "<0.00000, 0.00000, 1.00000, 0.00000>".

    Anybody can tell me what is wrong?

  5. Thank you both, will try.

    I attached a small cube on my arm and I use something that supposed to be a syringe to make an injection so when the needle touches this cube's face to play an animation.

    But this pi thing always confuses me.

     

    PS Do you think I should better use collision?

  6. 8 hours ago, Whirly Fizzle said:

    Did you maybe use "Rem DN" in Contact Sets to remove that avatars display name?

    :D Thank you so much!!!!!!!!!!!

    Now I remember, few days ago I was playing around with these settings there.

    Thank you again!!!!

    • Like 1
  7. 2 minutes ago, Phorumities said:

    Someone once asked me (on another account) how  I was able to hide my login name and only show a display name. I explained that I had never used a display name.

    Point is that everyone else can see this displayed name...

  8. 2 hours ago, ellestones said:

    its a bit unclear what you mean by it doesn't work. Would be good if you could explain that a bit more

    i notice that in the 2nd you use Mode, in the 1st you don't. Other than that both codes are functionally the same

    The first piece, having or not the Mode, it doesnt work. I mean it doesnt print any array of the passing list

    Play(list Which, integer MyLen, string Mode)
    {
        for(a = 0; a <= llGetListLength(Which); ++a)
        {
        llOwnerSay(llList2String(Which,a));
        }
                                              
    	Get2=[];
    	RandomNum=RandInt(0,MyLen); //THIS IS ANOTHER FUNCTION I USE TO CREATE A RANDOM NUMBER SO NEXT TO GET A RANDOM ARRAY FROM THE CHOOSEN LIST
    	
    	Get2=llParseString2List(llList2String(Which,RandomNum),["|"],[""]); //EACH ARRAY LOOKS LIKE Sound1|3.5 WHERE RIGHT TO PIPE IS THE DURATION
                                               
    	Duration=(float)llList2String(Get2,1);
    	ToPlay=llList2String(Get2,0);
    	llPlaySound(ToPlay,1.0);
    }

     

  9. In details, what Im trying to do is to play sounds using the function, so my function is 

    Play(list Which, integer MyLen, string Mode)
    {
    	Get2=[];
    	RandomNum=RandInt(0,MyLen); //THIS IS ANOTHER FUNCTION I USE TO CREATE A RANDOM NUMBER SO NEXT TO GET A RANDOM ARRAY FROM THE CHOOSEN LIST
    	
    	Get2=llParseString2List(llList2String(Which,RandomNum),["|"],[""]); //EACH ARRAY LOOKS LIKE Sound1|3.5 WHERE RIGHT TO PIPE IS THE DURATION
    
    	Duration=(float)llList2String(Get2,1);
    	ToPlay=llList2String(Get2,0);
    	llPlaySound(ToPlay,1.0);
    }

    But still this doesnt work

    So far I made it work this way

    Play(string Which, string Mode)
    {
    llStopSound();
    Get2=[];
    	//HAVE ALREADY GLOBALLY DEFINED 2 LISTS WITH NAMES "Laugh" AND "Shout"
        if(Which=="Laugh")
        {
        RandomNum=RandInt(0,LaughLen);
        Get2=llParseString2List(llList2String(Laugh,RandomNum),["|"],[""]);
        }
        else if(Which=="Shout")
        {
        RandomNum=RandInt(0,ShoutLen);
        Get2=llParseString2List(llList2String(Shout,RandomNum),["|"],[""]);
        }
    
    Duration=(float)llList2String(Get2,1);
    ToPlay=llList2String(Get2,0);
    llPlaySound(ToPlay,1.0);
        if(Mode=="1")
        {
        llSetTimerEvent(Duration);
        }
    }

    but I dont like it

  10. Hello

    I was wondering if I can manipulate different lists through a function.

    For example:

    list ListA=["1","2","3"];
    list ListB=["4","5","6"];
    list ListC=["7","8","9"];
    
    MyFunction(string TheList)
    {
    llOwnerSay(llList2String(TheList, 2));
    }
    
    default
    {
    	touch_start(integer total_number)
        {
    	//TO PRINT 3, 6 and 9
        MyFunction(ListaA);
    	MyFunction(ListaB);
    	MyFunction(ListaC);
        }
    }

    Of course this is the wrong way but you can get the idea of what I want to learn.

×
×
  • Create New...