VintFalken.com

Egg-puzzling: meta-SOS!

April 6, 2007 5:21 am

Ok, I have the top of the egg (3 linked prims) opening on click with this script:

default
{
touch_start(integer total_number)
{
rotation rot = llGetLocalRot();

if (rot.z = -0.012325)
{
rot.x = 0.315091;
rot.y = 0.644241;
rot.z = 0.293651;
rot.s = 0.632013;
}
else
{
rot.x = 0.012357;
rot.y = 0.707909;
rot.z = -0.012325;
rot.s = 0.706088;
}

llSetLocalRot(rot);

}
}

and another two prims linked together rotating inside the egg with the standard rotation script.

Which works great… until I try to link the whole egg together (top, base and rotating middle part).

Then all scripts die and my egg goes all haywire… Everything moves when clicked, and only one of the two prims that were originally affected by the rotating script still rotates.

What am I doing wrong? How do I declare the script to only target some prims (prim groups)? *very sad look*

  • No Related Posts

5 Responses to “Egg-puzzling: meta-SOS!”

Tiessa Montgolfier wrote a comment on April 6, 2007
MyAvatars 0.2

There are only two things you can modify like that the prim the script is in or the object as a whole.

You have three options:
1) You can make the object a ‘multiple object’ object by not linking them. But then you’ll have to figure out autorez or one of the other ‘multiple related objects’ rezzing systems.

2) Reduce the rotating portions to single prims.

3) Coordinate the rotating by messaging between various scripts in the various prims.

There is a reason why doors that open and close in pre-fab houses are single prims :)

Vint Falken wrote a comment on April 7, 2007
MyAvatars 0.2

Just discovered I can curse in five different languages. :/

Tiessa Montgolfier wrote a comment on April 7, 2007
MyAvatars 0.2

Then you are a better programmer than I am, I can only curse in three.

Melissa Yeuxdoux wrote a comment on April 9, 2007
MyAvatars 0.2

If LSL is like C, the operator for checking equality is ==, not =. (Yup, checked with the LSL wiki.) That means the then clause will always be taken. Wish I had a nickel for every time I did that when I started coding in C.

Now…once that’s corrected, there’s another issue, namely that it’s not a good idea to do equality comparisons with floating point numbers, because the two values will almost never be equal, so that you’ll switch from always taking the then clause to always taking the else clause. You’ll need to rethink how you make that decision.

Wrath wrote a comment on April 10, 2007
MyAvatars 0.2

Wow, you guys totally lost me at: {

Care to comment?