Moving an avi -with- a sit-target
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-02-2008 03:40
I have a seat with a simple animation inside This seat can move from move vector-pos to another. I thought that an avatar that was sitting in a pose ON a target actually was a linked prim and would move along with the target. It does not. Is it posible to make the avatar move with my sit-target? tyia ab
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-02-2008 03:43
Yes, that does normally work fine. Post an example that isn't working please (just enough to demo your trouble)?
Oh, thinking more about how you asked that, you don't get to change the sit target after the avatar is seated, but you can shift the avatar. There is an example in the SL wiki's llSitTarget of how to work around that. But, if you are moving the whole object, the avatar should travel along with it.
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-02-2008 03:50
are you sure you are sitting on the prim you think you are sitting on?
_____________________
From Studio Dora
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-02-2008 04:50
Hi Dora and Viktoria, yes I do sit on target - have this: The sittarget is linked to parent The parent send a message then if(message=="Opt1"  //first option respond { vector move1 = <1,0,0>; llSetPos(llGetLocalPos() + move1); } On that prim the av is already seated (that is just a std sittball event in a different script ...ooh.. is -that- an isue...? That the sit is in ONE script and the target is moved in an OTHER script.. ?)
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-02-2008 05:20
Oh, so you are moving a child prim in a link set? Yeah, that won't work like that. An sitting avatar will move along with the root prim, but if you are moving a child you would have to move the avatar in a separate step (because it's another child).
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-02-2008 06:10
oh.. i see Victoria, ...but then ... i can get 'to' the avi like key agent = llAvatarOnSitTarget(); BUT i cant use -that- to move it ...Handles is a sls nono wouldent "agent.llSetPos(llGetLocalPos() + move<n>  " be sweeeet.. No go ofcause.. :/ I'm stumped :?
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-02-2008 06:19
You might look at the UpdateSitTarget function that Strife put into http://wiki.secondlife.com/wiki/LlSitTarget but you would be moving the seat and avatar in separate steps and it will look strange. Another possibility might be to change things up so that the seat is the root prim. Then you could move the avatar and seat in one movement, and shuffle the other part back. A third way would be for the seat to be a separate object that is rezzed by the root you have now. This lets you move the seat with avatar independently, but you do get the extra work of tracking a second object and dealing with it getting lost in a move and so on.
|
|
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
|
06-02-2008 07:34
Victoria, i think the last option is the one that is the best , but i have NO idea how i can get the master-prim to either rez or to get the id of the objects (prims) that this master has rezzed. Could you point me in a direction with the functions i have to use here? (or even show me a short snippet 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-02-2008 08:50
Iterate through llGetLinkKey(n) for n=1..llGetNumberOfPrims() until it returns they key of the sitting avatar. Then use llSetLinkPrimitiveParams() with PRIM_POSITION to move that "prim" which is actually the avatar. If you want llAgentOnSitTarget() to continue to function, returning the same avatar, you'll want to ALSO move the sit target with llSitTarget().
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
06-02-2008 09:30
Sent one of the popular teleporters in world, pull it apart and see what makes it tick. The platform inside is set to temp rez, so you'll want to turn that off as soon as you fetch a copy from the base's inventory. From there, the scripts inside each will let you see how the two parts communicate.
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
06-03-2008 09:51
From: Hewee Zetkin If you want llAgentOnSitTarget() to continue to function, returning the same avatar, you'll want to ALSO move the sit target with llSitTarget(). This is unnecessary. Assuming a sit target has been set, llAvatarOnSitTarget() will return the key of the first sitting avatar, even if they've been moved by llSetLinkPrimitiveParams().
|