Forums


Need Script for moving prims

Creating scripts

Need Script for moving prims

Postby Koshari Mahana » Thu Sep 07, 2017 10:41 pm

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


//======================================================================================
    }
}
Four Winds Store on Kitely Market
https://www.kitely.com/market?store=9230634

Image
User avatar
Koshari Mahana
 
Posts: 33
Joined: Fri Feb 06, 2015 8:14 am
Has liked: 9 times
Been liked: 27 times

Re: Need Script for moving prims

Postby skindup truk » Tue Sep 12, 2017 9:48 am

do u mean 20fps?

do u know why are there only 5x prim rotations hard coded?
User avatar
skindup truk
 
Posts: 46
Joined: Fri Aug 29, 2014 8:39 pm
Location: Australia
Has liked: 7 times
Been liked: 36 times

Re: Need Script for moving prims

Postby Koshari Mahana » Wed Sep 13, 2017 2:31 am

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?
Four Winds Store on Kitely Market
https://www.kitely.com/market?store=9230634

Image
User avatar
Koshari Mahana
 
Posts: 33
Joined: Fri Feb 06, 2015 8:14 am
Has liked: 9 times
Been liked: 27 times

Re: Need Script for moving prims

Postby Graham Mills » Wed Sep 13, 2017 11:50 am

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.
Graham Mills
 
Posts: 952
Joined: Sun Dec 23, 2012 2:26 pm
Has liked: 583 times
Been liked: 721 times

Re: Need Script for moving prims

Postby skindup truk » Fri Sep 15, 2017 8:13 am

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
skindup truk
 
Posts: 46
Joined: Fri Aug 29, 2014 8:39 pm
Location: Australia
Has liked: 7 times
Been liked: 36 times

Re: Need Script for moving prims

Postby Koshari Mahana » Fri Sep 15, 2017 10:08 pm

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 :)
Four Winds Store on Kitely Market
https://www.kitely.com/market?store=9230634

Image
User avatar
Koshari Mahana
 
Posts: 33
Joined: Fri Feb 06, 2015 8:14 am
Has liked: 9 times
Been liked: 27 times


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests