Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation script malfunction

duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
02-24-2008 23:03
http://img.photobucket.com/albums/v38/neko-vamp/moonspinny.gif

I'm recreating the star locket from Sailor Moon and am trying to make the moon spin around the center of the locket. It works fine.. up until linking it with the rest of the prims. I've read a bit about Omega coding being messed up, is this what it was referring to?

here's the code (as show on the image above):
CODE
default
{
state_entry()
{
//multiply desired rotation (<x,y,z>) with local rotation of parent, rate is PI, gain is 1.
llTargetOmega(<0,0,-.2> * llGetLocalRot(),PI,1.0);
}

}


I'm terrible with scripts and as minimal as this one is... it's getting the best of me ~__~
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-24-2008 23:34
I can't remember all the vagueries of how target omega is borked for attachments... other than it being borked.

that said the usual solution is to rotate the prim(s) physically with llSetRot (or llSetLocalRot), rather than visually with llTargetOmega....

the difference is that set rot is a one time reposition, wich has to be called repeteadly, compared to target omega which is a continuous movement needing only one call.

without understanding exactly where the moon is on the object or on what axis it needs to rotate I can't suggest the exact way to code it.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
02-25-2008 00:01
Actually, just make sure that when you link it to the rest of the prims, you make sure it is *not* the parent prim and you will be fine. At this point, if you have accidently made it the parent prim, then you might consider setting rotation to 0, relinking it as parent, unlinking it, setting your rotation back up, then linking it back in as a child prim.

Once you've done that, it will rotate however you have it set up independently from any other system in the link set.

Other than if you have it on an "arm" or something that is rotating that it will follow along with of course, but still, it will rotate around it's own axis and ignore the center of the root prim as long as you setup the scripts rotation in it as a child prim.

I use it all the time in gyroscope type things in buildings and pyramids, etc that are linked.

If you need help with it, IM me in world, be happy to help. :)

Take care,
Hap
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
02-26-2008 09:21
ommggg, I figured it out. I had the sculpty star set as the root prim so it was trying to spin around the star and not the middle base... /resounding "OOOoohhhhhhh"

<3 you guys are awsome
Tryptofaa Sands
Registered User
Join date: 25 Mar 2007
Posts: 6
02-27-2008 10:13
I have a question to add to this theme...

I'm using llTargetOmega in a child prim for a rotor on a vehicle. While the vehicle is non-physical, no problem, but when I make it physical, the whole thing starts to spin.. only not EVERY time. I've yet to work out why this sometimes works just fine, and sometimes spins the whole vehicle. I realise setting to physical means lltargetomega movement is registered with the server, but I assume this is only if it's in the root prim? As I say, sometimes it works, sometimes it doesn't!

Tryp