Page 1 of 1

Need Script for moving prims

Posted: Thu Sep 07, 2017 10:41 pm
by Koshari Mahana
I have a butterfly as part of a build and it has prim wings that flap in sync, they are linked, along with the stationary body and head to a base prim that contains two scripts, (one for each wing) that has the recorded positions for the movement of the wings. The positions are relative to the base prim, not the region, which is the way I want it. Below is one of the scripts.

The problem is that they are running at 20.000 and I'll like to reduce that considerably. Does anyone have a script that works in this way but works better for OS grids?

Thanks!
Koshari

Code: Select all

 
 
//Place the script named "get pos and rot" in the prim that you are going to be moving around

//get as many positions as you want and paste them in the timer, below, in the order that you want them to show

//The timer is now set so that the part will move every 1.0 sec.  Change tincr to whatever value you want: bigger tincr is slower motion, smaller is faster motion.

float tincr = 1.0;  //only change the 1.0, leave everything else the same

//When you are ready, save the script.

default
{
    state_entry()
    {
        llSetTimerEvent(tincr);
    }
    
    timer()
    {//paste your lines in here, instead of the ones that are there, one after the other, in the order you want.  
    
    //===============================================================================
 llSetLinkPrimitiveParams(7, [PRIM_POSITION,<-0.072067,0.055054,0.956909>, PRIM_ROTATION, <0.992595,-0.000809,0.121284,0.006622>/llGetRot()]);
 llSetLinkPrimitiveParams(7, [PRIM_POSITION,<-0.072067,0.348053,0.925049>, PRIM_ROTATION, <0.973584,0.022049,0.119266,0.193453>/llGetRot()]);
 llSetLinkPrimitiveParams(7, [PRIM_POSITION,<-0.072067,0.630615,0.768188>, PRIM_ROTATION, <0.917136,0.044892,0.112673,0.379673>/llGetRot()]);
 llSetLinkPrimitiveParams(7, [PRIM_POSITION,<-0.072067,0.348053,0.925049>, PRIM_ROTATION, <0.973584,0.022049,0.119266,0.193453>/llGetRot()]);
 llSetLinkPrimitiveParams(7, [PRIM_POSITION,<-0.072067,0.055054,0.956909>, PRIM_ROTATION, <0.992595,-0.000809,0.121284,0.006622>/llGetRot()]);


//======================================================================================
    }
}

Re: Need Script for moving prims

Posted: Tue Sep 12, 2017 9:48 am
by skindup truk
do u mean 20fps?

do u know why are there only 5x prim rotations hard coded?

Re: Need Script for moving prims

Posted: Wed Sep 13, 2017 2:31 am
by Koshari Mahana
These are wings, they don't rotate all the way around (360 degrees) they only move about 30 degrees then return to their original positions.
skindup truk wrote:do u mean 20fps?

do u know why are there only 5x prim rotations hard coded?

Re: Need Script for moving prims

Posted: Wed Sep 13, 2017 11:50 am
by Graham Mills
Not the sort of thing I do but would using llSetLinkPrimitiveParamsFast help at all (assuming it's implemented)?

Re: Need Script for moving prims

Posted: Fri Sep 15, 2017 8:13 am
by skindup truk
it seems the critter needs to behave, and then be pushed along a world path that u want...

im still not sure what "20.000 reduced" means sorry!

i hope to setup some scripts in my world soon, so i look fwd to sharing any tips soon :)

Re: Need Script for moving prims

Posted: Fri Sep 15, 2017 10:08 pm
by Koshari Mahana
I don't mean they ARE rotating all the way around, I mean I don't want them to - nor do they. I was just trying to explain how they work (they flap like wings do).

20.000 is just the number that the script is using that shows in the first column when I use the debugger, considerably higher than all other scripts in the region (which isn't good). They are working perfectly, the script works, it's just not fine tuned so that it's efficient for OS grids. Hope that clarifies a bit.

I had a script in Second Life that worked well at moving the position of individual prims in a linked set (ie, expanding stairs, moving parts in a machine etc...) I wish I could remember the name of it but I can't. I am looking for something similar that works in Kitely and other OS grids without being a drain on the regions and servers.

Thanks :)
Koshari
skindup truk wrote:it seems the critter needs to behave, and then be pushed along a world path that u want...

im still not sure what "20.000 reduced" means sorry!

i hope to setup some scripts in my world soon, so i look fwd to sharing any tips soon :)