Jump to content

TessaAnnaMarie

Resident
  • Posts

    20
  • Joined

  • Last visited

Posts posted by TessaAnnaMarie

  1. I have most of the script figured out for what i need it today. But basically i have a note card with lets call them "Cause" and "Effects"; Listed as such in the notecard...

    ! Cause1
    ! Cause2
    ! Cause3

    % Effect1
    % Effect2
    % Effect3

    I know i can tell the script to only read lines with the ! or %, and delete them using llGetSubString(strData, 2, 400)

    What i need to do is have the notecard read for lines that have "!" at the start, and pick a random line to read out. Just not sure how i can do this. Advice?

    I know the "easy" way to do this would be to have 2 notecards, one with Causes, one with Effects. But ideally i'd like to keep it inside of one notecard, as im sure it is doable - i'm just not sure how. 

  2. I'm using Avastar and Blender to make animations. 

    Is there a way to lock a specific bone in place so that moving other parts of the skeleton won't change that bone's global position? 

    Trying to do an animation where the Avi squats, but I can't lock the feet in place, so as I move her down the feet slide and then hard snap in the animation playback. Not 100% sure how to explain what I mean.. but if you understand.. awesome. 
    Basically, I want to pin the Feet to 1 spot, and no matter what I do to the skeleton they will not move during pose mode. 

  3. 36 minutes ago, Quistess Alpha said:

    minimal demo of that would be

    Omg thank you so much! This did exactly what I needed, obviously I will need to do some tweaking. But it pointed me in the right direction. T-H-A-N-K!!!!! Y-O-U!!!

    • Like 1
  4. On 10/20/2023 at 3:26 AM, elleevelyn said:

     

    for slowing avatar movement then Quistess shows the basic howto here

     

    Thank you for this. Works wonders for moving forward. However I ran into 2 issues. 

     vector move = llVecNorm(
                    <-1, 0,0.0>*!(level&CONTROL_FWD) +
                    < 1, 0,0.0>*!(level&CONTROL_BACK)+
                    < 0,-1,0.0>*!(level&CONTROL_LEFT)+
                    < 0, 1,0.0>*!(level&CONTROL_RIGHT));
                vector turn = 
                    <0,-1,0>*!(level&CONTROL_ROT_LEFT)+
                    <0, 1,0>*!(level&CONTROL_ROT_RIGHT);
                if(level&CONTROL_BACK)
                {
                    llSetForce(<0,0,0>,TRUE);
                    move=-move;
                    turn=-turn;
                    gShoulder = <0,0,0>;
                }    
                else
                {
                    llSetForce((Speed*move)+<0,0,1>,TRUE);
                    vector vel = llGetVel();
                    if(vel.z>0) vel.z = 0;
                    llSetVelocity(vel,FALSE);

    }

    When I move Forward, like I said it works perfect. 

    1st issue: However when I click "S" or the Back arrow, I move at normal speed. 

    2nd issue: When I hold down the forward key, and then press the break button (Space) the avatar turns around and SPRINTS full speed. Need this to not happen. 

     

    20 hours ago, Quistess Alpha said:

    For a restrictive thing, you may want to consider llMoveToPos() the wearer's current position in adition to taking their controls and doing nothing with them. other than that, see what @elleevelyn linked. The best methods I've found are allowing the underlying SL movement and applying a reverse force, or directly setting the avatars velocity given their input. Both can have some nasty side-effects if edge-cases aren't carefully considered. llMoveToPos() as the movement mechanism would also work, but it interacts badly with jumping.

     

    I found out I can remove all movements with llTakeControl() - Thanks for this. I did try llMovetoPos, but it interacted weirdly. I've determined I need to separate them. I'd be happy if Moving forward would slow speed and backwards would stop it. But every way I try even with llmovetopos, it just gets buggy.. then screws up the move forward. 

  5. I have tried several ways to script it myself. Looked up several forums and what not. 

    Can someone point me in the right direction for slowing movement speed / stopping it all together? I'll be blunt, I'm looking to slow down speed similar to how RR (Real Restraints) Cuffs slow the avatar. I understand the animation side, that I need to slow the animation time / make a new one (I will be making a new one for the need that I need this for). But everything I've tried is "Clunky."

    If someone knows the system I am talking about and knows the right direction. I would love to be pointed in the direction so I can bring a project... or 7 I'm working to, to life. 

  6. 2 minutes ago, Quistess Alpha said:

    An interesting feature/bug I found when testing it (without my usual scripted movement control on) is that if you begin to hold down space while already walking forward, you never come to a complete stop, but continue walking at slow speed, but if you try to start walking while space is held, then you're stuck in place.

    Thanks for all the input will look over your way of doing it and see if that works for me. 

    As for why walking while holding space, its not the intention. I'm working on creating a combat game that can hinder movement, most things are scripted out and working but wanted to tackle this monster. So its important for me to not have a way for players to over-ride it as simple as pressing the space bar. next monster to tackle is a "You can't move at all" feature, so still al long way to go. 

  7. I am working on creating a script to slow/speed up avatar movement. 

    This is what I have so far. 

     

    float IMPULSE = 2.7;


    default
    {
        state_entry()
        {
            llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
            llStopMoveToTarget();
        }

        touch_start(integer total_number)
        {
            llSay(0, "Touched.");
            llStopMoveToTarget();
        }
        run_time_permissions(integer perm)
        {
            if(PERMISSION_TAKE_CONTROLS & perm)
            {
                llTakeControls(
                                CONTROL_FWD |
                                CONTROL_BACK |
                                CONTROL_LEFT |
                                CONTROL_RIGHT |
                                CONTROL_ROT_LEFT |
                                CONTROL_ROT_RIGHT |
                                CONTROL_UP |
                                CONTROL_DOWN |
                                CONTROL_LBUTTON |
                                CONTROL_ML_LBUTTON ,
                                TRUE, TRUE);
                               
            }
        }

        control(key id, integer level, integer edge)
        {
            vector v;
            if (level & CONTROL_FWD)
                v.x = -IMPULSE;
            else if (level & CONTROL_BACK)
                v.x = IMPULSE;
            else if (level & CONTROL_LEFT)
                v.y = -IMPULSE;
            else if (level & CONTROL_RIGHT)
                v.y = IMPULSE;
            llApplyImpulse(v, TRUE);
        } 
        
    }

     

     

    This seems to work as attended. Nearly perfectly. Couple of small issues though. 

    1. If I raise the number above 3 when I try to walk backwards (Down arrow / "S") it will not turn my avatar around, the animation is walking forwards while the avatar is moving backwards. Any fix to this?

    2. If i press my "Space bar" it will revert back to normal movement speed for as long as i hold the space bar and send me in the opposite direction (If I'm Holding "W" and click space, i will speed up and go backwards). This is my bigger issue that i need to fix, as this is just "breaking" everything I'm trying to do with the script. 

     

    Note: either of these issues only happen when i go positive with the IMPULSE variable (Or slow down), if i speed up, i don't have these issues. 

     

     

    If there is a better way to do what I'm trying to do, please let me know. Been working on this for weeks. This is the closest i have gotten. 

  8. 17 minutes ago, CmpZ said:

    I'm not in front of a computer that can run SL at the moment, so I can't test it, but I believe you do this:
     

    Do_The_Thing( string value ) {
    
        integer n;
    
        n = llListFindList( Numbers, value );
    
        if (-1 == n) {
    
              // not found
    
        } else {
    
            llOwnerSay( llList2String( Letters, n ) );
    
        }
    
    }

    The difference between this & your original code is that this one saves the result from llListFindList &, if it's in range (not -1), uses it as the index into the Letters list.

     

    Thank you! Some minor adjustments and yes, this works! Thank you!

  9. Okay i have 2 lists. I'll keep it simple here. 

    list Numbers = ["1", "2", "3", "4", "5"]
    list Letters = ["A", "B", "C", "D", "E"]

    What I need to do is check to see if something is in a list. 

    if(msg == llListFindList(Numbers, (Numbers)msg))
    {
          llSay(0, **this is where I need help**);
    }

    Simple. But what I need the outcome to do is use the letter that corresponds to the number. Meaning if the message is "3", the outcome will say "C". I'm pretty sure this is doable, but I can't for the life of me figure out how. 

  10. I'm looking for an experienced Rigger and Weight painter with the Legacy and Reborn Dev kits to Rig and Weight paint a few things i have made. I understand this process is not cheap, and am willing to pay a fair agreed upon price. I am somewhat familiar with the processes using blender myself and creating stuff for other games and know the work it takes. 

    Please respond here, in Message or on Grid: TessaAnnaMarie

    Let me know your price and if you have a portfolio that would be wonderful to see, though not required. If you are a new rigger/weight painter but are serious about getting into the field feel free to leave a comment, i am looking to have quiet a few things made. Thank you in advance! 

  11. 9 minutes ago, primerib1 said:

    If you check the documentation, llFrand(x) returns a number between 0 and x, inclusive of 0.

    In this case, a number greater than or equal 0, but smaller than 5969.

    Then you add to that, the number of 4132.

    If llFrand(x) returned 2889, which is still between 0 and 5969 then you'll of course end up with 7021.

    If you want an integer number between "low" and "high", inclusive at both ends, you have to do it like this:

    llFloor(llFrand(high-low+1)) + low

    Basically, you convert the inclusive range of [4132, 5969] into 4132 + [0, 1837]

    But because llFrand is exclusive of the end value, you have to make the range into [0, 1838)  <== note the right value is now exclusive.

     

    Edit: The notation [x, y] means a range of numbers inclusive of x and y.  [x, y)  means a range of number inclusive of x, but exclusive of y. Pay close attention to the ending character; the first one uses a right bracket ] , the second one uses a right paren )

    I solved it with this
            integer temp = highcheck - lowcheck;
            integer addnumber = llFloor( llFrand( temp )  +1 );
            Amount = lowcheck + addnumber;
            llSay(0, (string)Amount);

     

    Thank you :) Been fighting this part of the script all day! Lol

  12. integer  highcheck = 5969

    integer lowcheck = 4132;

    Amount = llFloor(llFrand(highcheck) + lowcheck);

     

    Can someone please explain to me... why the outcome of this line of script would be 7021?

    I am trying to make it pull a random number between 4132 and 5969. Can't seem to figure out what im doing wrong. 

  13. 39 minutes ago, Jenna Huntsman said:

    Use a typecast as part of your listen:

    integer myInt;
    
    listen( integer channel, string name, key id, string message )
    {
        if((integer)message) //check if message is an integer (and is not 0)
        {
            myInt = (integer)message
        }
    }

     

    Okay, i have in fact verified that it is being set as an integer. Now to send it to the other script?

  14. So i need to send an integer from one script to another. 
    I am using llTextBox to allow the player to enter a integer. I need to be able to pass that integer to another script in an unlinked prim.

    I have been using llSay + Listen, i can make objects talk to one another no problem. What i can't figure out is how to allow the script to communicated the integer.

    Basic run down. 
    Cube is being click, pops up the text box. I enter 5. I can't even get that value to save as an integer.

×
×
  • Create New...