|
Madhu Maruti
aka Carter Denja
Join date: 6 Dec 2007
Posts: 749
|
01-01-2008 16:54
I hope this is a well-defined question; I'm very new to modifying scripts.
I found a stool that had a copyable, moddable sit animation that I liked; I added the animation and the script to a different stool.
On the new stool, when you sit on it, it seats your avatar at a rotation of 90 degrees relative to the original stool - and relative to the proper seating position. So instead of sitting straight up and down on the stool, you are kind of floating in the air with your back parallel to the ground and your legs hovering over the seat.
It seems like this should be something I can fix by changing the orientation at which the script executes its animation. But I can't really understand the script well enough to find what to change. Is there a line of the script I should be looking for that sets an orientation for the animation?
Thanks!
|
|
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
|
01-01-2008 17:18
gonna need alittle more information =(
somewhere in the script is a line that reads
llSitTarget(offset, ZERO_ROTATION);
or something similar. Basically look for llSitTarget, and copy that whole line and post it if you can.
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
01-01-2008 17:27
Yep, you're looking for a line that looks something like this: llSitTarget(<0,0,.1>, <0.0, 0.0, 0.0, 1.0>  ; The first set of three numbers define the position front/back, left/right, up/down. The second set of numbers define the rotation in quaternions, which are not easy to explain briefly. Either the old stool or the new stool has the root prim rotated 90 degrees (not at all uncommon for furniture, since things like toruses work best for furniture when lying flat) and as a result the sit target must compensate by being rotated in the opposite direction. Fix: llSitTarget(<0,0,0.1>, llEuler2Rot(<0,0,0> * DEG_TO_RAD)); Now the rotation is revealed in the second set of numbers, in normal degrees which you can tweak by hand. Try 0,0,0 first, if that doesn't work then the new stool is the one that's rotated and you can try things like 90,0,0 or -90,0,0 or 0,90,0 or 0,-90,0 to get you tipped 90 degrees in the right direction. Then tweak the first set of numbers to adjust your position. Just don't set all the first numbers to 0 or sitting will stop working at all.
|
|
Madhu Maruti
aka Carter Denja
Join date: 6 Dec 2007
Posts: 749
|
01-01-2008 19:06
Thank you both! This is just what I needed. I found the relevant line of script and will start tinkering post-haste.
ETA: Got it all working perfectly, thanks again. I had to tweak the "position" settings also but with the information above I was easily able to figure out how to do that as well.
|