Jump to content
GManB

AV Not Moving w Object

Recommended Posts

Posted (edited)

I made a swing. Wrote a script to make it swing. Used avsitter2 to set up a sitting animation. AV sits on the swing fine but does not move when I start the swing motion script. The swing  moves back and forth through av but the av remains in the sitting pose. 
I’m sure I am missing something simple. 
Any help or pointers appreciated. 
Thanks,

G

Edited by GManB
Notify

Share this post


Link to post
Share on other sites

I'm not sure if AVsitter has something specific for this, but a sitting avatar becomes a part of the object they sit on and can be moved just like any other prim.

If you managed to move multiple prims in sync already, adding the avatar to that movement is trivial. 

Share this post


Link to post
Share on other sites

How are you moving the prim? Did you by any chance use llTargetOmega? That doesn't really move a prim in-world, but it makes the viewer show it as rotating. It's used for wheels, windmills, fans, etc. which need to appear to rotate and don't affect anything else. It's a low-overhead special case, usually used only for round things.

Share this post


Link to post
Share on other sites
Posted (edited)

In the other thread you stated that your swing is linked.

Sitting avatars and child prims are all linked to the root. The sit target makes it look like its sitting on a child, but technically an avatar is linked to the root and not the child.
Moving the child prim will not move the avatar. AVSitter doesn't matter here - it don't changes the facts.

So you need to move the swing AND the avatar - synced. That will not work smoothly - especially since the omega rotations will not help you here. The only useful method to make smooth movements is to make the swing a separate object.

Edited by Nova Convair
  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Nova,

Then what you are saying, for example, for a vehicle with many prims it is the root prim that the script moves and the child prims, including now any avs sitting on any child prim, move with the root prim.

Is my interpretation correct?

 

Thanks,

G

Edited by GManB
typo

Share this post


Link to post
Share on other sites

animats,

I am moving the child prim (which is the swing bench and ropes) with

llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,llList2Vector(posList,stepIndex), PRIM_ROT_LOCAL,llList2Rot(rotList,stepIndex)])

posList and rotList hold a sequence of positions and rotations for the bench/rope prim that define the arc through which it swings.

(speed, btw, is controlled by inserting llSleep0.01 at appropriate places.

Thanks,

G

Share this post


Link to post
Share on other sites
32 minutes ago, GManB said:

animats,

I am moving the child prim (which is the swing bench and ropes) with

llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POS_LOCAL,llList2Vector(posList,stepIndex), PRIM_ROT_LOCAL,llList2Rot(rotList,stepIndex)])

Ah. As someone mentioned above, you're moving the child prim, not the root prim. Sitters are always tied to the root prim.

Unlike everything else in 3D graphics, SL does not have a proper hierarchy. There are root prims and child prims, but no children of child prims. Philip Rosedale has said that was his biggest design mistake.

Share this post


Link to post
Share on other sites
25 minutes ago, animats said:

Ah. As someone mentioned above, you're moving the child prim, not the root prim. Sitters are always tied to the root prim.

Unlike everything else in 3D graphics, SL does not have a proper hierarchy. There are root prims and child prims, but no children of child prims. Philip Rosedale has said that was his biggest design mistake.

I have experimented with this:

http://wiki.secondlife.com/wiki/Hierarchics

I don't think it would be of help with my current problem unless I could compute pos/rot for the avs sitting on the swing and move them in sync with the swing...

G

Share this post


Link to post
Share on other sites
7 minutes ago, GManB said:

I have experimented with this:

http://wiki.secondlife.com/wiki/Hierarchics

I don't think it would be of help with my current problem unless I could compute pos/rot for the avs sitting on the swing and move them in sync with the swing...

It's not that hard. Make the swing seat, the ropes, and the bearing at the top of the swing set one object. Have the bearing be the root prim, so the center of the object is the center of rotation. Like this:

shipswing.thumb.jpg.58aebe59688918e5155710ade5fdac98.jpg

Really big swing. Makes it clear that the swing is really part of a wheel.

This ride is in The Unknown Theme Park on Heterocera. Great rides, there for years, nobody goes there.

See the little swing set at the lower right? There's an ordinary swing, and it works. Same principle.

Share this post


Link to post
Share on other sites

Thanks animats. I check them out. I see two things about the little swing. 1. it is not linked to the frame, 2. it was a transparent prim at the top of the ropes around which the rotation occurs.

In my experimentation with my swing I was easily able to get it to swing around a prim at the top of the ropes when it was unlinked. Once I linked it to the frame all sorts of weird rotations occurred. This is why I ended up with the code I have.

 

Now, I am assuming that if I want to offer this swing for sale on the MP all the pieces should be linked otherwise it would be a nightmare for the owner to move around. But, should I reconsider this assumption and let the owner move two pieces into place once they rez them? Seems a bit too much.

I all goes back to the issue of no hierarchy and that avs are considered a child prim and move only with the root prim...

 

sighs...

 

G

Share this post


Link to post
Share on other sites
2 hours ago, GManB said:

Now, I am assuming that if I want to offer this swing for sale on the MP all the pieces should be linked otherwise it would be a nightmare for the owner to move around. But, should I reconsider this assumption and let the owner move two pieces into place once they rez them? Seems a bit too much.

You can hold Shift to select multiple objects, and move them at the same time while keeping them exactly relative to each other.

I don't think that's "a nightmare," but...

Share this post


Link to post
Share on other sites

To have a saleable product, you'll have to automate the assembly process after the user moves the object. It's do-able, but complicated. You have to send messages to the moving part telling it where to go. Usually the fixed part rezzes the moving parts for such things.

The sequence for this is something like:

  1. Fixed object rezzes moving object at desired position and rotation.
  2. Moving object, upon being rezzed, starts listening on a channel for messages.
  3. If fixed object is moved via editing, it sends a message to the moving object to tell it where it should go. Or just sends it a message to die, and rezzes a fresh copy.

I do this in my escalators. The steps are a separate object from the frame. Move the frame, and the steps will be left behind, but will be deleted and re-rezzed the next time the escalator is touched.

There's some additional work required to allow the customer to duplicate the object via editing without causing confusion over which fixed object owns which movable object. Random IDs or serial numbers are necessary. There's also the fact that rezzes take time; if you rez something, it may not be listening for a few seconds after the rez. A recent sim side change affected that, and broke some projectile weapons.

Share this post


Link to post
Share on other sites
28 minutes ago, animats said:
  1. Fixed object rezzes moving object at desired position and rotation.
  2. Moving object, upon being rezzed, starts listening on a channel for messages.
  3. If fixed object is moved via editing, it sends a message to the moving object to tell it where it should go. Or just sends it a message to die, and rezzes a fresh copy.

Thanks animats!

I have some investigation to do to figure out to accomplish these three steps. Then re-code the swing. Since the swing will be it's own object I can use the..KeyFrame.. call.

Thanks,
G

Share this post


Link to post
Share on other sites

You need only 2 objects - base and swing.
It's easy to select both and move/rotate them as a unit - but of course SL is full of building noobs 😎

For adjusting things I'd do the following things:

- On touch/menu function/automatic (after it was moved) the base broadcasts a message.
- The Swing answers
- in case there are multiple swings around the base will pick the nearest (thats easy to find out)
  alternatively every base swing requires a number - but who numbers them?
- The base will send their position and rotation to the swing (llRegionSayTo)
- The swing will add it's offset and relocate/rotate itself and snap into position

Sounds complicated and the 1st time you script that there are some details to find out.

Share this post


Link to post
Share on other sites
6 hours ago, Nova Convair said:

You need only 2 objects - base and swing.
It's easy to select both and move/rotate them as a unit - but of course SL is full of building noobs 😎

For adjusting things I'd do the following things:

- On touch/menu function/automatic (after it was moved) the base broadcasts a message.
- The Swing answers
- in case there are multiple swings around the base will pick the nearest (thats easy to find out)
  alternatively every base swing requires a number - but who numbers them?
- The base will send their position and rotation to the swing (llRegionSayTo)
- The swing will add it's offset and relocate/rotate itself and snap into position

Sounds complicated and the 1st time you script that there are some details to find out.

I see I have my work cut out for me.... but, that's the fun!

Thanks... Will do a little investigation today.

G

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...