Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

smooth bow

jeanette Burnstein
Registered User
Join date: 10 Aug 2008
Posts: 2
06-22-2009 08:36
Hello, i have this tentacle script, but i like to make the movements more smoothly (not so nervous) Have changed the parameters, but without success. I like to have the movement like a bow.

Here is the script

CODE

default
{
state_entry()
{
llSensorRepeat("",NULL_KEY,AGENT,10,PI,1.0);
}

sensor(integer num)
{
key target = llDetectedKey(0);
vector mypos = llGetPos();
vector targetpos = llDetectedPos(0);
vector test = llVecNorm(targetpos-mypos);
llSetPrimitiveParams([PRIM_FLEXIBLE, TRUE, 3,0.55,0.0,0.0,5.0,test]);
//llOwnerSay("Test: " + (string)test);

}
no_sensor()
{
key target = llDetectedKey(0);
vector mypos = llGetPos();
vector targetpos = llDetectedPos(0);
vector test = llVecNorm(targetpos-mypos);

llSetPrimitiveParams([PRIM_FLEXIBLE, FALSE, 3,0.5,0.0,0.0,1.0,test]);
}
link_message(integer sn, integer num, string str, key id)
{
if(str == "OFF")
{
state off;
}
}
}

state off
{
state_entry()
{
key target = llDetectedKey(0);
vector mypos = llGetPos();
vector targetpos = llDetectedPos(0);
vector test = llVecNorm(targetpos-mypos);

llSensorRemove();
llSetPrimitiveParams([PRIM_FLEXIBLE, FALSE, 3,0.5,0.0,0.0,1.0,test]);
}

link_message(integer sn, integer num, string str, key id)
{
if(str == "ON")
{
state default;
}
}
}


Thanks in advance
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
06-22-2009 10:12
You might want to add some drag to the flexi parameters, it's the 5th parameter in the list (2.0 in my example below) and is used to slow down the reactions of the flexi.

CODE

llSetPrimitiveParams([PRIM_FLEXIBLE, TRUE, 3,0.55,2.0,0.0,5.0,test]);
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
jeanette Burnstein
Registered User
Join date: 10 Aug 2008
Posts: 2
thanks
07-02-2009 12:17
Thanks a lot, problem solved :)