Need Script for moving prims

Creating scripts
Post Reply
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Need Script for moving prims

Post 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()]);


//======================================================================================
    }
}
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
skindup truk
Posts: 46
Joined: Fri Aug 29, 2014 8:39 pm
Location: Australia
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: Need Script for moving prims

Post by skindup truk »

do u mean 20fps?

do u know why are there only 5x prim rotations hard coded?
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: Need Script for moving prims

Post 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?
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Need Script for moving prims

Post by Graham Mills »

Not the sort of thing I do but would using llSetLinkPrimitiveParamsFast help at all (assuming it's implemented)?
Last edited by Graham Mills on Fri Sep 15, 2017 10:14 pm, edited 1 time in total.
These users thanked the author Graham Mills for the post (total 2):
Ilan TochnerHandy Low
User avatar
skindup truk
Posts: 46
Joined: Fri Aug 29, 2014 8:39 pm
Location: Australia
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: Need Script for moving prims

Post 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 :)
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: Need Script for moving prims

Post 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 :)
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
Post Reply