Jump to content

I need help finding a script!!


Tailsy Loxely
 Share

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

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

Recommended Posts

Hi Tailsy try this one out i have been messing about with it and got it to bob up and down in the air if thats what you're after :)

float h=0.8;   //the hight it bobs up you can change thisfloat m = 0.7;  //0.1 slow bob 0.9 faster bob lolvector pos; float x=0; vector bob; default { state_entry() { llSetBuoyancy(1.0);llSetTimerEvent(0.5);pos=llGetPos() + <0,0,1.5>;llSetStatus(STATUS_PHANTOM , TRUE);llSetStatus(STATUS_PHYSICS , TRUE);} on_rez(integer start){    llResetScript();}timer(){ x+=m;bob = <0,0,llCos(x)*h>;llMoveToTarget(pos+bob,0.8);} }

 

Link to comment
Share on other sites

Why does an object need to be physical to simply move up and down?

Seems server load would be somewhat lighter if just using a regular non-physical object. llMoveToTarget() used to be more visually gracefull than llSetPos() because of 200 msec delay in the latter but since it is now possible to set position via llSetLinkPrimitiveParamFast() with no delay, it is no longer the case.

Link to comment
Share on other sites

It should be proved that llSetLinkPrimitiveParamsFast will be lighter in THIS paticular case

 

Firstly , the prim doesn t need the collisions . So it s possible to filter out all collisions out with llColisionFilter.

Secondly, there are several ways to move vertically :

  • llSetBuoyancy with llMoveToTarget
  • llSetHoverHeight and llStopHover
  • llGroundRepel
  • and the last  llSetPhysicsMaterial( integer material_bits, float gravity_multiplier, float restitution, float friction, float density ) with a very low gravity , sometimes = 0 sometimes negative . You may change the density to change the mass of the object too ( sorry, the wiki page doesn t exist ) 

Each physical function has not the same weight to loead in the server . Probably i would avoid llMoveToTarget.

llSetPhysicsMaterial is great : it consumes very few Energy even with a 64*64*64 prim

 

 

If we just want the effect of levitation but we don t care with exactitude the final height , physics are great . It doesn t a linear movement with constant velocity and so it can be nicer to watch . To add , to have a smooth movement will llSetLinkPrimitiveParams you need to spam and to grow up the number of events per seconds . 

Link to comment
Share on other sites

See the thread right next to this one in the LSL Scripting forum.  In particular, look at Cerise's very simple example of a user defined function that makes use of llSetKeyframedMotion.  The only thing you have to remember if you take this approach is that your object has to be defined in terms of the new Prim Equivalency system.  That means adding

llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); 

 to your script before you call Cerise's function.

Link to comment
Share on other sites

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