Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

texture animation on a child prim

Lost Oddfellow
Registered User
Join date: 15 Sep 2005
Posts: 33
03-09-2008 10:08
I have been looking for a way to set a texture animation going on a child prim from a script in the root of the link set.

I've asked on a number of scripting groups in SL, sadly for those I could open a chat session for without getting an error I was only actually able to post my question on one without the message being eaten by lag and I got no reply from anyone in that group.

llSetLinkPrimitiveParams() doesn't appear to allow setting up texture animations at all that I can see,
and LlSetTextureAnim() don't seem to allow for setting up animation in prims other than the one the script is in.
if there are any alternatives or other possibilities for reaching the same end effect I'd love to hear it.

until then I'll have to stick with three script to do one job.
_____________________
I've made my statement and I stand by it,
but I could be wrong.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
03-09-2008 10:20
There's no way to do it with one script from the root prim, but you don't need 3..
_____________________
Lost Oddfellow
Registered User
Join date: 15 Sep 2005
Posts: 33
03-09-2008 10:27
well animation at 2 different speeds needs to play on 2 child prims activated by a touch on any prim in the link set
the touch activation part needs to go in the root in order to be turned on by a touch anywhere,
and each animation needs to have it's own script too if there is no way to set a texture anim going from outside the prim you want the animation going in.
that's 3 scripts.
_____________________
I've made my statement and I stand by it,
but I could be wrong.
Dehlia Steinhardt
Registered User
Join date: 11 Oct 2006
Posts: 1
Animation on child controled by root
03-10-2008 09:39
The llSetTextureAnimation is a propperty of the prim itself, it can be set by the script, then you can delete the script, but the property is still set that way even without script.
So create the child(s), set the parameters in the script the way you want, delete the script again, make a linked set of it all, and adress the child fom the root prim with:
llSetLinkTexture( integer linknumber, string texture, integer face );
to change the texture with a solid colored texture or maybe llSetLinkColor so you dont see the animation.

default
{
touch_start(integer detected)
{
llSetLinkTexture(LINK_SET, "66bf4030-04f9-a808-43ab-b48b6aeb6456", ALL_SIDES);
}
}
//the texture key is from an example, have no clue what it is :)

Now you can control the child from the root prim, and reduce the number of scripts.
Kettu Keiko
Registered User
Join date: 18 Dec 2005
Posts: 25
Root Script to Control Child Texture Animations
03-12-2008 10:13
in each Child Prim..
//----------------------------------\\

float ANIM_SPD = 0; // we'll use ANIM_SPD as a variable for the
// animation speed float in the llSetTextureAnim command.
float X = 0.020;// replace this example number with a valid
// float for the speed you want. using a variable at top
// makes it easier to change as this script will
// set the speed to this variable when it's called.
// each script in every child prim will have different float values
// here to achieve your desired effect.

default
{
state_entry()
{
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,0,1,1.0, 1,ANIM_SPD);
}

link_message(integer sender_num, integer num, string str, key id)
// the link_message event is the "listen" of the MessageLinked event of the root script.
{
if(str=="on";) // this takes the string called str from the incoming MessageLinked
// and sets the condition that if the message srting is specifically "on" to..
{
ANIM_SPD=X; // sets ANIM_SPD variable to X value defined
// at the beginning of the script. This method makes it
// easier to make adjustments.
} else // this makes it so if the message is ANYTHING BUT "on" to do the following...
{
ANIM_SPD=0; //this is zero, to stop the animation
}
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,0,1,1.0, 1,ANIM_SPD);
}
}

_________________________
link your prims then in the root prim put in this
//----------------------------------\\

string toggle;

default
{
state_entry()
{
toggle = "off";
llMessageLinked(LINK_SET, 0, toggle, NULL_KEY);
}

touch_start(integer total_number)
{
if(toggle=="off";)
{
toggle="on";
} else
{
toggle="off";
}
llMessageLinked(LINK_SET, 0, toggle, NULL_KEY);
}
}



__________
i just built this inworld and it works :)
Kettu Keiko
Registered User
Join date: 18 Dec 2005
Posts: 25
heh okay i feel silly
03-12-2008 10:33
i originally (somehow) interpreted the OP as being able to touch toggle animations on and off so that's what my scripts do

o.O

this is what i get for trying to understand things before waking up :P
HarleyMC Homewood
Registered User
Join date: 31 Mar 2007
Posts: 15
linked prims - moving/ rotating /stretching textures
04-24-2008 20:35
Apologies for the need to reinvent the wheel.

Months and months ago I found some simple examples of how to get all prims in a linked set to have the texture animation do the same thing....
problem is these forums are not searchable in any useful way. so apologies for asking the basics... ie Animate brings up lots of stuff on moving avs, texture brings up lots of stuff on using photoshop....

How do you animate a texture to behave the same way on all members of a linked set of prims? example sripts would be nice- with any explanations of basic terms.