littlepinkpie Posted December 16, 2017 Share Posted December 16, 2017 Hello, I made a little script which attaches an object (located inside a #RLV folder) on the avatar. My question is this, before attaching, is it possible to change the attach point (example right leg or left leg) and then when attached to change the object's rotation? Thank you. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted December 16, 2017 Share Posted December 16, 2017 When you attach something from a shared folder using RLV, the viewer takes the attachment point from the name of the object (or the folder it's in, if it's a no mod object). See the RLV API. So one way to do it would be to ensure there are two items in the folder, one for the right leg and one for the left leg, and have the script that issues the @attach command decide, at run-time, which one to use. Once it's attached, a script in the attachment can move it round using llSetPos and llSetLocalRot (or llSetLinkPrimitiveParamsFast or whatever) in the normal way, but I don't think there's any way to change the attachment point once it's worn. Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted December 16, 2017 Share Posted December 16, 2017 As Innula said, the viewer uses the name of the object, or the folder it's in, to determine the attachment point. That being said, I would go with the folder method. That way, you can make a link to the item, and put it in different folders named for the attachment points you want to use. Then in a script inside the object, you want a script with a list of local rotations, and possibly local positions as well as the attachment point constants. On attach, you'll want to use llGetAttached, find that resulting point in your list, and have it apply the rotation and position from the list Link to comment Share on other sites More sharing options...
littlepinkpie Posted December 16, 2017 Author Share Posted December 16, 2017 Ok I get it, need some copies of the same object for setting different points. About setting the position and rotation, how can I manipulate them using the same script which does the attach? I mean how to tell "set the rotation of the object1", "set the rotation of the object 2" etc? Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted December 16, 2017 Share Posted December 16, 2017 4 minutes ago, littlepinkpie said: Ok I get it, need some copies of the same object for setting different points. About setting the position and rotation, how can I manipulate them using the same script which does the attach? I mean how to tell "set the rotation of the object1", "set the rotation of the object 2" etc? The rotation would need to be done in a script in the attachment itself. If the object is copy-able, instead of using a script to handle the rotation, making a copy of the attachment and placing each one in the named folder. Then go through and attach, move/rotate it how you want, and detach. As long as it uses the same attachment point next time, it retains the same position and rotation Link to comment Share on other sites More sharing options...
littlepinkpie Posted December 16, 2017 Author Share Posted December 16, 2017 I will have 2 copies, one for left leg and another on for the right. What will always change will be the position and rotation, and I guess there will be many different, so what about adding a listener in each copy and send the position/rotation from the attaching object? Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted December 16, 2017 Share Posted December 16, 2017 Ah ok, so it won't always have the same position/rotation for each attachment point? In that case, yes, I would use a listener to tell it how to position itself after attaching. Link to comment Share on other sites More sharing options...
littlepinkpie Posted December 16, 2017 Author Share Posted December 16, 2017 Thank you both! Link to comment Share on other sites More sharing options...
Klytyna Posted December 23, 2017 Share Posted December 23, 2017 On 16 December 2017 at 6:32 PM, Innula Zenovka said: When you attach something from a shared folder using RLV, the viewer takes the attachment point from the name of the object (or the folder it's in, if it's a no mod object). Just so you know... There has been NO need to either rename objects to include the attachment point name on brackets at the end, or place 'no mod' objects in attachment point named sub folders for several years (5 or more?). The rlv api wiki is basically... Out of date. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now