Jump to content

Help with a random rotation vector script?


Gawain Galtier
 Share

You are about to reply to a thread that has been inactive for 3648 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello!

I am trying to create a script that makes an object rotate in random rotations several times / as a visual effect. I created a list of the rotational vectors that I require to use, and I'm hoping to pull them randomly into use. I am getting an error message and I can't figure this out. Here's what I have:

 

//list of rotations
list t_rot= ["<-0.05234, 0.00000, 0.00000, 0.99863>", "<0.04363, 0.00000, 0.00000, 0.99905>","<0.00000, 0.06105, 0.00000, 0.99813>","<0.00000, -0.04364, 0.00000, 0.99905>"];
      
t_fx()
{
    //l
    llSetLinkPrimitiveParams(3,[PRIM_ROTATION, llList2String( llListRandomize(t_rot, 1 ), 0 ), PRIM_POSITION, <-0.00035, -0.00040, 0.00346>]); 
    //2
    llSetLinkPrimitiveParams(3,[PRIM_ROTATION, llList2String( llListRandomize(t_rot, 1 ), 0 ), PRIM_POSITION, <-0.00035, -0.00040, 0.00346>]); 
    //origin
    llSetLinkPrimitiveParams(3,[PRIM_ROTATION, <0.00000, 0.00000, 0.00000, 1.00000>, PRIM_POSITION, <-0.00035, -0.00040, 0.00346>]); 

}
 
default
{
    state_entry()
    {
    }
    on_rez(integer start_params)
    {
    }
    link_message(integer sender, integer num, string messg, key id)
    {
        if ( num == 344 && messg == "t_fx")
        {
            //visual effects
            t_fx();
        
        }
    }
}

 

I tried using the llList2Vector but that didn't seem to work either. Any advice available?

Link to comment
Share on other sites


Dora Gustafson wrote:


arton Rotaru wrote:

How about llList2Rot()?

Well spotted except llList2Rot() doesn't work, See the

:smileysurprised:
:)
:smileyvery-happy:

Yeah I know. :matte-motes-big-grin: It was just a quick hint (because I'm in a hurry) to better apply a rotation when a rotation is required, rather than applying a string. Why the rotation vectors are stored as strings in the list is another question. Also the usefulness of the script as is is questionable anyway, becaus it will always apply the rotation in the last llSLPPF call anyway.

 

So I suspect this will take a little longer to get it all straight. :matte-motes-wink:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3648 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...