I'm making this rotating/sound effects/particle thingie which has several linked components, some invisible. Oh, and it's all phantom. No physics.
I wanted to occasionally be able to see the invisible parts so I added a listen with show/hide commands, and scripted the components to change texture based on link messages.
Here's the root prim code (codes 1 and 2 in the llMessageLinked call turn on and off sound effects in other linked prims).
CODE
After this change it started to go funny. Now I could click and drag it around as if it had physics on (it didn't -- I checked three times), and llTargetOmega stopped working consistently (I know the llTargetOmega statement was being executed because the sounds went on and off in response to the link messages which were sent out at the same time).
integer rotating = 0;
default
{
state_entry()
{
llListen(0, "", NULL_KEY, "");
}
touch_start(integer total_number)
{
if (rotating)
{
llTargetOmega(<0,0,1>, 0.0, 1.0);
llMessageLinked(LINK_SET, 1, "", NULL_KEY);
rotating = 0;
}
else
{
llTargetOmega(<0,0,1>, .3, 1.0);
llMessageLinked(LINK_SET, 2, "", NULL_KEY);
rotating = 1;
}
}
listen(integer channel, string name, key id, string message)
{
if (message == "HideRotator")
{
llMessageLinked(LINK_SET, 9, "", NULL_KEY);
}
else if (message == "ShowRotator")
{
llMessageLinked(LINK_SET, 10, "", NULL_KEY);
}
}
link_message(integer sender, integer num, string str, key id)
{
if (num == 9)
{
llSetTexture("Invisible", ALL_SIDES);
}
else if (num == 10)
{
llSetTexture("Visible", ALL_SIDES);
}
}
}
Every now and then I could get it to start or stop rotating (as it was supposed to) by touching it, but most of the time it wouldn't start (or wouldn't stop if it was going). However, when I clicked and dragged it the rotation stopped or started. Showing or hiding it also seemed to help.
Maybe the server is not telling the client about the llTargetOmega call until it has something else to say as well. I relogged, and it didn't help, and other objects sitting right next to it don't behave this way.
Shall I just throw it out and start over?
Help!
--Almarea