llGetObjectDetails works, llSetLinkPrimitiveParams doesnt?
|
|
Remo Brentley
Registered User
Join date: 7 Apr 2009
Posts: 10
|
06-06-2009 15:04
Alright I'm trying to do a reletively simple script, and have been working hours at this trying to figure out why is not working  I have 2 large doors, and the root prim below. They are linked, and the root prim is for sure the one under the doors (so it can hold the script). Now, I can pull the data using llGetObjectDetails. From: someone list objname = llGetObjectDetails(llGetLinkKey(2),[OBJECT_NAME,OBJECT_POS]); llSay(0,"Obj Name for #2 = " + (string)objname);
It tells me "[14:51] Door Root: Obj Name for #2 = Right Door<206.301071, 114.577400, 26.722103>" However, when I Try to do From: someone vector pos_2_shrink = <204.261, 114.577, 26.722>; llSetLinkPrimitiveParams(2 , [ PRIM_POSITION, pos_2_shrink]);
It doesn't do anything at all.  I've verified using scripts from the wiki that the objects are indeed linked and are detected as llGetObjectDetails even verifies, but I cannot scale or re-position the linked door at all. Any hints? I gotta be missing something stupid
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
06-06-2009 15:11
The linkset isn't locked, is it? I made a hinged gangplank once that wouldn't lift because I had absent-mindedly locked it while I was locking the rest of the pier it was next to.
_____________________
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 
|
|
Remo Brentley
Registered User
Join date: 7 Apr 2009
Posts: 10
|
06-06-2009 15:14
From: Rolig Loon The linkset isn't locked, is it? I made a hinged gangplank once that wouldn't lift because I had absent-mindedly locked it while I was locking the rest of the pier it was next to. Good idea, but it shows the "locked" box under the object tab as unchecked. Thanks though Still need help, pullin hairs out over here lol
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-06-2009 15:21
You are using region coordinates to move a child prim, ain't gonna work. It works like llSetPos, you need to use coordinates relative to the root to make the child move. The same 10 meter limitation is there, and also you can't move the child outside the link limit, both will make nothing happen. (Hm, a >10m setpos that stays inside the link range might work and stop at 10, kind of like for roots, but I've always run into the link distance first.)
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
06-06-2009 15:29
To be precise you want something like:
llSetLinkPrimitiveParams(2 , [ PRIM_POSITION, pos_2_shrink - llGetPos()]);
|
|
Remo Brentley
Registered User
Join date: 7 Apr 2009
Posts: 10
|
06-06-2009 15:32
From: Viktoria Dovgal You are using region coordinates to move a child prim, ain't gonna work. It works like llSetPos, you need to use coordinates relative to the root to make the child move. The same 10 meter limitation is there, and also you can't move the child outside the link limit, both will make nothing happen. (Hm, a >10m setpos that stays inside the link range might work and stop at 10, kind of like for roots, but I've always run into the link distance first.) Ohhh, ok, I got it to move, but is there a way to find out the reletive positive from the root to where the object is initially resting at?
|
|
Remo Brentley
Registered User
Join date: 7 Apr 2009
Posts: 10
|
06-06-2009 15:35
From: Argent Stonecutter To be precise you want something like:
llSetLinkPrimitiveParams(2 , [ PRIM_POSITION, pos_2_shrink - llGetPos()]); Nevermind, thanks for this, don't know why I didn't think about doing it like that in the first place lol. <3 everyone, it all works now. =)
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-06-2009 16:47
llGetLocalPos called from the child prim will return the childs offset from the root, in the roots LOCAL frame of reference (eg as if the root were rotated to ZERO_ROTATION, meaning it returns the same offset regardless how the parent object is rotated)
note: there is no SetLocalPos, llSetPos (and it's equivalents) automatically work in local mode when used on child prims.
_____________________
| | . "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... | - 
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
06-06-2009 17:56
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
06-07-2009 03:03
_____________________
| | . "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... | - 
|