Jump to content

How to Make a VERY Slow Script?


Prokofy Neva
 Share

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

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

Recommended Posts

There's this script by Alicia Stella that seems to have the options to make things very slow, but when I put it in a prim and add VERY SLOW to the quotation marks, which seems like what you have to do, it doesn't work. I try new prims because I realize sometimes prims "remember" scripts and you can't shake them, but neither this script or any other rotation script I have can be slowed down. I mean to be super slow, for a planetarium.

 

Link to comment
Share on other sites

Nothing stops you to try other values. lower is slower

Hmmm it uses the axis to change the speed - lets see:

llTargetOmega( vector axis, float spinrate, float gain );

spinrate is set to PI and that stands for a half rotation per second. The magnitude of axis is used to slow it down.

I suggest to simply set a lower spinrate - 0.3 will reduce the speed to 1/10th

Edited by Nova Convair
Link to comment
Share on other sites

2 minutes ago, Nova Convair said:

NORMAL and VERY SLOW set the same speedvector so there is no difference between them. Looks to me like a typo - 0.6 instead of 0.06

Nothing stops you to try other values. lower is slower

the number is the angle per second that the object rotates. (in radians) So 0.06 will result in over 100 sec for a full rotation.

 

No they don't.   Look at the code:

if (speed == "VERY SLOW") 
        { 
           speedvector = <0,0,0.15>; 
        } 
        else if (speed == "SLOW") 
        { 
           speedvector = <0,0,0.3>; 
        } 
        else if (speed == "NORMAL") 
        { 
           speedvector = <0,0,0.6>; 
        } 

if the variable speed is set to VERY SLOW, then speedvector is set to <0.0,.0.0,0.15> and if it's set to NORMAL then speedvector.z is 0.6;

I've just tried it in world.   This is what it looks like with speed at VERY SLOW

https://i.gyazo.com/5c98a5028d324811b5f5b35f42b3cea9.mp4

and this what NORMAL looks like

https://i.gyazo.com/9becfbee94fdd9364c199c0fd5ca3cdb.mp4

One seems, at least to me, clearly faster than the other.

So I don't understand why Prok is having difficulties with it, but I have to say I think the script over-complicates things.   All that's needed is something like this

default
{
    state_entry()
    {  
        float RevsPerSecond = 0.1;
        llTargetOmega(<0.0,0.0,TWO_PI>*llGetRot(),RevsPerSecond,0.01);
    }
}

where RevsPerSecond is the number of revolutions on its own local z axis the object should make in one second (so this is very slow, one full revolution every 10 seconds).  This will rotate it anti-clockwise.  To rotate clockwise, use a negative value for RevsPerSecond.   

  • Like 1
Link to comment
Share on other sites

Ah. The problem here is that you're setting what SL calls "omega", which is the angular acceleration vector. If that value is very small, it will be treated as zero by the physics engine, to reduce load on the simulator. If you want really slow rotation, like 1 RPM or less, you'll probably have to compute and set angular position directly. Try using llSetLocalRot on your planetarium objects, and update the positions from a timer. See http://wiki.secondlife.com/wiki/LlSetLocalRot

  • Like 3
Link to comment
Share on other sites

I suppose that might be possible, for non-physical objects. Many years ago, I had a commission to script a rotating restaurant -- think Space Needle -- and ended up having to use Animat's solution because llTargetOmega would not rotate the structure slowly enough.The problem has been mentioned here by other people a few times in the past (although I can't put my finger on one at the moment), but I have never seen a good technical explanation.

  • Thanks 1
Link to comment
Share on other sites

32 minutes ago, Innula Zenovka said:

I could well be mistaken, but I read the original post as meaning that Prokofy can't get the object to slow down at all rather than that he can't get it to move at all.  

That could be.   The actual words were

On 1/14/2018 at 4:57 PM, Prokofy Neva said:

when I put it in a prim and add VERY SLOW to the quotation marks, which seems like what you have to do, it doesn't work.

which Animats and I took to mean that it doesn't revolve at all when the speed is set to VERY SLOW.  Maybe a clarifying update would help.....

Edited by Rolig Loon
Link to comment
Share on other sites

On 1/16/2018 at 1:27 PM, Innula Zenovka said:

I could well be mistaken, but I read the original post as meaning that Prokofy can't get the object to slow down at all rather than that he can't get it to move at all.  

Obviously (or perhaps not) I grasp that you need to change values on a script to, er, change it. That's self-evident from logic and common sense when I see how a script works that has a table that says VERY SLOW to FAST. But the problem is that *even when* I put a value "VERY SLOW" in between quotation marks AS INDICATED in the liner notes, or even when I put in a value EVEN LOWER than her "VERY SLOW" I still get nothing changing, despite resetting the script multiple times, trying it in a new prim, etc. This may be a viewer issue. I don't know. But testing a half dozen different rotation scripts with different features, I keep seeing that none of them are slow enough. Yet my viewer can see slower rotations because I see them on things in world. Anyway, don't chip your nails...

Edited by Prokofy Neva
Link to comment
Share on other sites

2 hours ago, Prokofy Neva said:

Obviously (or perhaps not) I grasp that you need to change values on a script to, er, change it. That's self-evident from logic and common sense when I see how a script works that has a table that says VERY SLOW to FAST. But the problem is that *even when* I put a value "VERY SLOW" in between quotation marks AS INDICATED in the liner notes, or even when I put in a value EVEN LOWER than her "VERY SLOW" I still get nothing changing, despite resetting the script multiple times, trying it in a new prim, etc. This may be a viewer issue. I don't know. But testing a half dozen different rotation scripts with different features, I keep seeing that none of them are slow enough. Yet my viewer can see slower rotations because I see them on things in world. Anyway, don't chip your nails...

If you are using Alicia Stella's script, then if you change,  up at the top of the script

string speed = "NORMAL"; //"VERY SLOW", "SLOW", "NORMAL", "FAST", "VERY FAST" 

to read 

string speed = "VERY SLOW"; //"VERY SLOW", "SLOW", "NORMAL", "FAST", "VERY FAST" 

then that will cause the script to set the value of speedvector to 

 speedvector = <0,0,0.15>; 

a little later on.   This, in English, tells the script to make the object seem to rotate through 27 degrees a second.    That is because in

llTargetOmega(speedvector,PI,1.0); 

PI means 180 degrees in Euler notation (which is what LSL uses for rotations) and the command is telling the script to rotate the object at speedvector * PI degrees a second, and 180 * 0.15 is 27.     

If you want to rotate it slower, go to 

default 
{ 
    state_entry() 
    { 
        vector speedvector = <0,0,0.6>; 
        if (speed == "VERY SLOW") 
        { 
           speedvector = <0,0,0.15>; 
        } 

and replace the 0.15 with a lower value.   

Or you could try the fragment I posted above, 

default
{
    state_entry()
    {  
        float RevsPerSecond = 0.1;
        llTargetOmega(<0.0,0.0,TWO_PI>*llGetRot(),RevsPerSecond,0.01);
    }
}

and play around with the value of RevsPerSecond.  My script is written slightly differently, and uses RevsPerSecond to tell the script how many times to rotate in a second.   Try 

float RevsPerSecond = 0.01;  

and see how that works for you.   I've tried it just now and the movement is visible.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2289 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...