Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Flexi prim memory(?)

Quik Taurog
Quik Taurog
Join date: 17 Aug 2007
Posts: 30
09-08-2007 08:09
Is it possible to create a script that would act on a flexi prim object to the effect that it would remember the original posiiton and snap back to that position on interaction by the user, like an elastic band with an original position and a stretched position and be able to work that free of fixed coordinates, like to simulate realism of a fishing line when a bite happens?

Or, would that be considered more of an animation? I'm not sure, when I need the effected prim to act this way with an attachment responding to the dynamics of it. like the fish and the lure on the end of the line...

Any constructive input would be appreciated...

Quik
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
09-08-2007 08:29
From your script, you can change the prim to be flexi or not. When it is flexi, it will stretch and waver, But when you set it back to non-flexi, it will snap back to its original position.

Try this in a tall box, and touch the box once in a while:

From: someone

integer F;

default
{
state_entry()
{
F = TRUE;
llSetPrimitiveParams([ PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 1.0, 1.0, <1, 0, 0>]);
}

touch_start(integer total_number)
{
F = !F;
llSetPrimitiveParams([ PRIM_FLEXIBLE, F, 2, 0.3, 2.0, 1.0, 1.0, <1, 0, 0>]);

}
}