|
Bobsy Bernstein
Registered User
Join date: 16 Jul 2005
Posts: 8
|
07-26-2005 02:13
(decided to put this here because it refers to application of scripts rather than writing them)
What I'm having trouble getting my head around is how SL deals with scripts within linked groups of prims. For example: I made a prefab room which contained a decorative thing set with the basic rotation script. I linked it all up, stuck it in my inventory, but when I brought it out again the entire room was spinning round along the axis of the original object!
This was of course get-aroundable because I needed it unlinked for use anyway, but I've had similar problems in other projects. I tried modifying an existing air vehicle by making the propellers spin. Each prop was two prims, and when they were linked to each other and had the scripts applied they span fine, but when I linked the rest of the vehicle back with the propellers only one prim per prop was spinning, and the vehicle couldn't fly any more.
My problem then is this: getting multiple scripts working within a single linked object, but applied only to certain prims or groups of them rather than the whole thing.
|
|
Barbarra Blair
Short Person
Join date: 18 Apr 2004
Posts: 588
|
07-26-2005 09:48
you need to use llSetLocalRot instead of llSetRot.
You can't use llTargetOmega.
_____________________
--Obvious Lady
|
|
Racer Plisskin
Rezerator
Join date: 2 Jan 2005
Posts: 147
|
07-26-2005 14:58
For spinning props, a disk (short, fat cylinder) with a rotating texture of prop blades might do what you need with much less work. Also, it will not require the physics engine to do anything as the prim would not need to move (always a good thing to help conserve simm CPU resources in any case).
Aside from the root prim (last prim selected in a set) assume any script in any individual prim should be written to only affect that prim. Thus, for spinning prop blades (if you don't go the spinning texture route), you would need to put a 'spin' script in each individual blade. Keep in mind that it's really hard to synchronize the spinning blades...
A spin script in the root prim would spin the entire object after linking it together. A spin script in any other prim of an object, shoul donly spin that individual prim.
-Racer P
_____________________
"What's important in life is not how many breaths we get to take but those moments that take our breath away." -- Jaques Cousteau
"A thin line separated serious homicidal purpose from buffoonery." -- Dean Koontz
"CanYouFixTheSpaceBarOnMyKeyboard?" -- Email to Helpdesk
|