llSitTarget variable
|
|
Dragos Zaoh
Registered User
Join date: 11 Dec 2006
Posts: 58
|
04-22-2007 01:53
I was trying to create a varible sit Target in the same object. llSitTarget (x,y,z) where x,y,z will change from menu or notecard, however if the avatar already sit on that object, the SitTarget will not change because avatar has to stand up and sit again for a new Sit Target. Can someone give me a suggestion , how can i create a variable sit target in the same object? The object contains 2 different animations and their start position is different therefore i have to set 2 sit targets withour standing up the avatar. Waiting for some tips. Thank you.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-22-2007 06:23
From: Dragos Zaoh I was trying to create a varible sit Target in the same object. llSitTarget (x,y,z) where x,y,z will change from menu or notecard, however if the avatar already sit on that object, the SitTarget will not change because avatar has to stand up and sit again for a new Sit Target. Can someone give me a suggestion , how can i create a variable sit target in the same object? The object contains 2 different animations and their start position is different therefore i have to set 2 sit targets withour standing up the avatar. Waiting for some tips. Thank you. Not sure if I've understood your question correctly or not but as you say the sit target caqnnot be chanegd while being sat on, or at least it will not update until resat on. A possible way around it would be to move/rotate the prim which is being sat on for each animation.
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
04-22-2007 08:08
Another way to do it is with the new llSetLinkPrimitiveParams. Since a seated avatar is considered just another linked prim by LSL - more specifically the last prim in a linkset - it can have its position adjusted like any other linked prim. llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, Desired_Pos ] );
Specifying the link number as llGetNumberOfPrims() selects the last link in the set, which will always be the avatar if there is exactly 1 avatar sitting on the object. So the sit target remains the same, but you can move the avatar to some arbitrary new position for each different animation. This elegant solution thanks to Deanna Trollop, who originally posted it to the forums here (at least to my knowledge).
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
04-22-2007 12:00
While I appreciate the credit, Anti, alas, it does not belong to me. Someone else discovered this extremely useful trick, I merely repeated it. (I'd pass on the correct attribution if I remembered who it was. Apparently "llSetLinkPrimitiveParams" is too long of a keyword for the board's search function.)
|
|
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
|
04-22-2007 12:10
I don't know if it's the correct behaviour, but llSetLinkPrimitiveParams seems to require local coords, not global ones. Wiki says it's the same as llSetPrimitiveParams, with the page for that giving [PRIM_POSITION, <128, 128, 40>] as an example. Using those coords would silently fail as it tries to push it 128m on x, 128m on y and 40m on z, which exceeds the max linking distance.
Haven't had a chance to test on llSetPrimitiveParams to see if the behaviour there is the same.
|
|
Dragos Zaoh
Registered User
Join date: 11 Dec 2006
Posts: 58
|
04-23-2007 02:29
Thank you very much guys. With your help i could do what i wanted using " llSetLinkPrimitiveParams " which is really awesome and very usefull. Many thanks for your prompt replies 
|
|
TomoKwihnai Takacs
Registered User
Join date: 27 Mar 2007
Posts: 5
|
06-14-2007 12:41
Does anyone know what happens to llAvatarOnSitTarget() when you move the Avatar off the target position?
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
06-14-2007 12:50
Pretty sure that they are still considered to be sitting on the SitTarget.
|
|
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
|
06-14-2007 13:46
you CAN change a sittarget without an avatar standing up, just make the object belive the avatar is another object, if u want the code look in the scripting forum for strifs llUpdateSitpos funcion 
|
|
TomoKwihnai Takacs
Registered User
Join date: 27 Mar 2007
Posts: 5
|
06-14-2007 14:00
Or just use llSetLinkPrimitiveParams on the Avatar to move it…
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-15-2007 03:12
From: Daten Thielt you CAN change a sittarget without an avatar standing up, just make the object belive the avatar is another object, if u want the code look in the scripting forum for strifs llUpdateSitpos funcion  Although for this purpose probably superceded by llSetLinkPrimitiveParams(), this sounds fiendishly clever--but I can't find it in this forum, nor the Library... closest was a 3 year-old thread, but search couldn't find Strife posting in that thread. Any chance of a link?
|
|
Robin Mapp
Registered User
Join date: 23 Dec 2006
Posts: 6
|
llSitTarget
06-17-2007 09:07
From: Qie Niangao Although for this purpose probably superceded by llSetLinkPrimitiveParams(), this sounds fiendishly clever--but I can't find it in this forum, nor the Library... closest was a 3 year-old thread, but search couldn't find Strife posting in that thread. Any chance of a link? Guys ...Great tip! can rotation be set as well, when adding rotation coordinates as such... llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, <-0.99,0.0,0.7>,<0,0,0.0,-0.0>] ); I get an error...llSetPrimitiveParams error running rule #2: non-integer rule. Any help would be awesome!
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
06-17-2007 09:14
From: Robin Mapp llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, <-0.99,0.0,0.7>,<0,0,0.0,-0.0>] );
I get an error...llSetPrimitiveParams error running rule #2: non-integer rule. PRIM_POSITION takes one parameter, a vector. You're following that with a rotation, but it's expecting another parameter type definition, which is just an alias to a constant integer value. You want: llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, <-0.99,0.0,0.7>, PRIM_ROTATION, <0,0,0,1>] );
|
|
Robin Mapp
Registered User
Join date: 23 Dec 2006
Posts: 6
|
llSitTarget
06-17-2007 10:05
From: Deanna Trollop PRIM_POSITION takes one parameter, a vector. You're following that with a rotation, but it's expecting another parameter type definition, which is just an alias to a constant integer value. You want:
llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, <-0.99,0.0,0.7>, PRIM_ROTATION, <0,0,0,1>] ); Following your logic, and very MUCH Appreciate the help, but now a new error develops llSetPrimitiveParams error running rule #2 (PRIM_ROTATION): arg #1 quaternion expected but vector given.
|
|
Robin Mapp
Registered User
Join date: 23 Dec 2006
Posts: 6
|
llSitTarget
06-17-2007 10:10
From: Robin Mapp Following your logic, and very MUCH Appreciate the help, but now a new error develops
llSetPrimitiveParams error running rule #2 (PRIM_ROTATION): arg #1 quaternion expected but vector given. Scratch that! my stupid mistake! it is working ...THANK YOU VERY MUCH!!!!!!!!!!!!!!!!!!
|