Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

the flexi-prims that move towards avatars

Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
06-03-2006 15:40
i cant find a script for this anywhere so can someone help me?

please and thankyou
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
06-03-2006 17:39
Hows this for a start:

CODE

float gForceMag = 1.0;

default
{
state_entry()
{
llSensorRepeat("",llGetOwner(),AGENT,20.0,PI,5.0);
}

sensor(integer num_detected) // assume closest, so use only 0
{
vector force = gForceMag * llVecNorm(llDetectedPos(0) - llGetPos()) * llGetRot();
list get_flex_params = llGetPrimitiveParams([PRIM_FLEXIBLE]);
list set_flex_params = llListReplaceList(get_flex_params,[force],-1,-1); //replace the force vector (last property in list)
llSetPrimitiveParams([PRIM_FLEXIBLE] + set_flex_params);
}
}

Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
06-04-2006 07:22
thanks
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-05-2006 15:50
Works better if you sum the inverse squares of the distance to the nearest avatars.

Have a look at the carnivorous plants at the coonspiracy store to see how it works with a bunch of people teasing them from all sides.