Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What do i wrong with llSetLinkPrimitiveParams ?

Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
08-01-2009 07:31
I am making a pillow where i use a self made function but somehow it don't work like i espected :(

the function is:
AvatarSit(vector POSITION, vector Rotdeg, integer iNrAnim)
{
if(llGetNumberOfPrims()> iPrimsDefault)
{
llStopAnimation("sit";);
llStopAnimation(SitAnim);
SitAnim=llGetInventoryName(INVENTORY_ANIMATION,iNrAnim);

POSITION=llGetPos()+ POSITION;
llOwnerSay((string)POSITION);

llSetLinkPrimitiveParams(iPrimsDefault +1, [PRIM_POSITION, POSITION, PRIM_ROTATION, llEuler2Rot(Rotdeg*= DEG_TO_RAD)]);
llStartAnimation(SitAnim);
}
}

when i call this function i give the offset compare to the root prim (have to do that for the rotation to but thats not implemented yet) and a integer with the number of the animation it has to load from the invertory.
iPrimsDefault is count of prims without anyone sitting on it.

llOwnerSay give the correct coordination but somehow i sit about 50 m away from the pillow and i don't understand why :(

EDIT: i am testing it with line POSITION=llGetPos()+ POSITION; disabled
it looks like that the Position is already relative to the root.
but after i move the pillow it the function sometimes don't work anymore and resetting the script don't work then (very weird)
but the rotations isn't relative to the root prim :(
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-01-2009 08:06
Try llGetLocalPos().
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
08-01-2009 08:10
i did it with llGetRot and that works too but now the position is wrong again.
because the pillow is more a rectangle and you rotate the pillow the x,y position aren't good anymore :(

but thanks for the answer.
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
08-01-2009 09:14
You have to multiply the postition and the rotation by llGetRot() .
However I am not able to remember how exactly to do this :o so i'm hoping someone else steps in.
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
08-01-2009 09:45
Thanks Ron and Rolig,

i understand what i did wrong now :) :)

I will try to figure out how to multiply the position with the rotation.
Wish i was better in math :)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-01-2009 10:30
When in doubt, consult the oracle .... . :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-01-2009 16:10
thanks Rolig, for the laugh =)

::gave me a picture of myself blind, standing over a volcanic vent, high on toxic gases, saying "isn't it delicious?"::
_____________________
|
| . "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...
| -