Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Holding 'physical' objects?

Arkloyd Faulkner
Registered User
Join date: 4 Dec 2005
Posts: 12
12-04-2005 05:51
I'm building a flail, which I want to have a realistic 'swing' when moving or animating the avatar.

It'll have:
handle (4 prim: hand grip / shaft / tip collar / first chain link)
3 'loose' chain links
Head with fixed link.

(If anyone wants a picture of it, I was saving finishing the modle until I could keep it attached, but if requested, I'll put a pic into this thread.)

I want to keep the number of 'free' bits down (I might be able to just have one link between the head and the shaft) because I know the Sim can't quite support a lot of computation and I really don't want to crash it.

I run into a problem trying to get the item attached to the Avatar.
It keeps falling.

Is their a way to attach a physical object to your avatar in a mobile part, such as the hand?
I'm guessing it would require, if it was possible, some heavy scripting. (Any help with that would be appreciated)

Is this possible, instead, with 'Jonts'?
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
12-04-2005 07:00
Sadly you cant attach jointed objects.

Nor can you attach physical objects... or rather, they dont act as if physical once you do.

llSetLinkAlpha to turn bits on and off or llTargetOmega to spin.

L8r,
UU
_____________________
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-04-2005 07:13
Hi Arkloyd. Welcome to SL. :)

As Upshaw has mentioned, what you're asking is not really possible. When you attach an object to an avatar, the object becomes non-physical. There's no way to change that.

Also, joints don't work the way you think they do. They really should be avoided.

Further, even if the object could remain physical while held, it wouldn't be a good idea anyway. The collision lattice for objects in SL is not on the surface of the object, but about a centimeter outside it. For complex objects like toruses, tubes, and anything hollow, this presents a problem. Place 2 such objects so that they interlock like chain links, and the physics engine has to work really, really hard to to keep them seperated. Often if the links are too small, which for something like a flail they undoubtedly would be, this can cause a deep think error, which can actually cause an entire sim to crash.

The best solution for creating a realistic looking flail is to animate it. Have multiple copies of the chain, each in a key position of the animation sequence. In other words, frames. Then set each "frame" to turn visible/invisible in sequence so that the whole thing appears to be one chain moving from position to position. Basically what you're doing here is stop motion animation.

You're not going to be able to get the chain to collide with other objects with this method, but it's about the best you can do for a realistic looking flailing action.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Arkloyd Faulkner
Registered User
Join date: 4 Dec 2005
Posts: 12
12-04-2005 08:27
Hmm, Is the 'stop motion' something intuitive, or will it require me to dig deep for information? I would like to try that.

I guess it would require me to learn animation in all it's lovely and wonderful glory. :)
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
12-04-2005 08:42
Well, I wouldn't really say it's intuitive, no. It will require specific knowledge of certain LSL functions, which I'm sorry to say is knowledge I do not possess. I'm kind of a one trick pony. If you want detailed help with making something look good, I'm all over it, but when it comes to scripting it so it actually does something, the best I can do is speak conceptually. Programmer, I am not.

I don't know what your strengths are so I can't tell you which parts of the process would be easy for you and which would be challenging. For someone like me, building the actual components would be easy, very intuitive, but writing the script to turn them on and off in sequence would not. For those who are more script savvy but not as artisitc, I would imagine the opposite is true.

So, if you want advice about making the object itself, I can certainly provide, but for the script you'll have to ask someone else. Sorry I don't have a better answer.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Cottonteil Muromachi
Abominable
Join date: 2 Mar 2005
Posts: 1,071
12-04-2005 21:50
Okay. Heres my stupid idea of a flail.
Build the handle of the flail separate from the 'ball' end.

To make the 'chain' you can use particles that originate from the ball and end at the handle as a target. These are also doable and has been done to death.

The ball end is harder.
I'm sure you have seen one of those scripts that follow avatars around. Put one of these in the ball. It should allow it to be physical. To control it, position it correctly and cause it to fling out, you need some scripting knowledge, which I don't have. But I'm sure it can be made such that a directional force is applied whenever you click the mouse button to cause the ball to flail outwards and then come back, just like a yo-yo.

This method even allows you to make a flail an actual weapon that you can beat up avatars with since the ball is just like any other bullet.

The rest are just animations that you tie in with the flailing.
Arkloyd Faulkner
Registered User
Join date: 4 Dec 2005
Posts: 12
that would be cool. :)
12-06-2005 13:48
I'll have to look into that, especially if I can contrain it to a certain distance from the handle. Any scripters ther able to help?
Draephon Harbinger
Registered User
Join date: 15 Oct 2005
Posts: 7
12-07-2005 12:00
my suggestion is to pose that question in the scripters forum ^.~