Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Possible? Any way two held objects can tell if they collide?

InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
10-29-2008 19:28
I am stuck a bit, and before I spend hours trying to figure out if it is even possible, I want to know.
It is possible to have an avatar hold an object in a hand, have an animation move that hand close to an invisible object, have that object detect a collision with the specific invisible object, and cause the object in hand to turn invisible when it detects a hit on the invisible object on a table, turning that object visible. Simulating placing the hand held object down on a table??

I want to place a visible ladle in my right hand, bend forward, making my hand with ladle move to the area where an invisible ladle sit, causing a collision between the visible ladle and the invisible ladle, making them swap visibility.

Hope someone understood what I mean. Some way I can get a collision detect of sorts to tell me if the collision was between two objects called ladle.
Any way at all??

Thanks for your time, InuYasha Meiji..
_____________________
__________________________________
InuYasha Meiji sama
犬夜叉 明治さま

Owner of InuYasha's Experimental Builds, IEB, selling Asian Furnishings and Historical items. Come see the tourist attraction, Shuri Castle Seiden, in Butler sim. Nightly Fireworks, ridable horses, trails into woods, animals to see, 7 seas fishing, and dancing in the throne room to jpop and anime music.
Zhenya Vlodovic
Registered User
Join date: 23 Sep 2008
Posts: 40
10-29-2008 22:25
First, I don't know if attached objects detect collision at all, but even if they do...

Movement due to animation isn't really movement as far as the sim is concerned. The sim doesn't keep track of where your limbs are, or even where your body is relative to where it was at the start of the animation. That's done client-side, while collision (physics stuff) is done server-side.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-30-2008 00:46
short answer: no
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
10-30-2008 13:43
you can fake it tho i dont know exactly what you want but you could put an anim in the table so when clicked it plays and swaps them at the right time
_____________________
L$ is the root of all evil
videos work! thanks SL :)
bobbyb30 Swashbuckler
Registered User
Join date: 8 Sep 2008
Posts: 46
10-30-2008 15:01
short answer:no

long answer: you could
you could by checking the bounding box and constantly calculating if they collide. Also you could rez a prim in between to check when they collide.
_____________________
Large supporter and contributer of LSL Editor available at lsleditor.org
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
10-30-2008 21:37
Have the object whisper its pos coordinates to a channel the surface is listening to. When its within a designated range relative to the surface do the swap.
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
10-30-2008 22:35
From: Soen Eber
Have the object whisper its pos coordinates to a channel the surface is listening to. When its within a designated range relative to the surface do the swap.


Won't work. The position does not change with animation.
_____________________
The Vengeance Studio Gadget Store is closed!

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-31-2008 04:57
From: bobbyb30 Swashbuckler
short answer:no

long answer: you could
you could by checking the bounding box and constantly calculating if they collide. Also you could rez a prim in between to check when they collide.

eh not really since the bounding box won't move with the animation
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
10-31-2008 06:22
Depending on what you're trying to do with the effect, I would have thought that having the two spoons somehow communicate with each other is the way to do it.

For example, if you know your first animation takes 5 seconds to run from attaching the first spoon to appearing to hit the table, start a timer (or sleep the script) when the animation starts and then, after the five seconds have elapsed, turn the first spoon invisible and whisper to the second spoon that it's time to show itself.

If you wanted to be really fancy you could, I suppose, have the first spoon also whisper its coordinates as part of the message, so the second spoon could work out if it's supposed to have been hit, but that might be complicating things too much.
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
10-31-2008 06:56
From: Innula Zenovka
If you wanted to be really fancy you could, I suppose, have the first spoon also whisper its coordinates as part of the message, so the second spoon could work out if it's supposed to have been hit, but that might be complicating things too much.


It won't work. See several of the above replies. You can not get the position of an attachment. It will report the position of the avatar, which as far as the sim is concerned does not move during an animation.
_____________________
The Vengeance Studio Gadget Store is closed!

Scott Savira
Not Scott Saliva
Join date: 10 Aug 2008
Posts: 357
10-31-2008 07:13
Still unsure what you are exactly trying to accomplish. There might be a better way to do what you want. There are multiple ways to do most things and you can fake all kinds of actions with outside the box thinking.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-31-2008 08:30
you might be able to get away with an action... not a perfect solution, as you'd still need to be in the correct position (perhaps a variation on the move to hugger scripts would help) then have the action play the animation, and afterwards chat a command that triggers your visibility in both the attached object and the stationary one...

I've seen a similar set up used by a friend, however it's never quite perfect... but it's closer than anything else
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
10-31-2008 08:35
From: Anya Ristow
It won't work. See several of the above replies. You can not get the position of an attachment. It will report the position of the avatar, which as far as the sim is concerned does not move during an animation.

Yes, I know it will report the position of the avatar. This might be useful to know if you also know that, for your illusion that the avatar is leaning forwards and hitting the table to appear convincing, the avatar needs to be standing within a certain distance of the second spoon and facing in the right direction.

Obviously it's not going to be dead on, since avatars come in so many different shapes and sizes, but it might help avoid appearing to miss the table by a mile and still seeming to trigger the effect.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
10-31-2008 19:32
The other reason this isn't feasible, even if you used a client to track the objects during animation, is that animations don't play in perfect sync between different clients, particularly the first time they play.
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
10-31-2008 22:26
From: Tyken Hightower
The other reason this isn't feasible, even if you used a client to track the objects during animation, is that animations don't play in perfect sync between different clients, particularly the first time they play.

If you assume that the animation is short enough (and not looped) that most of the time all people witnessing the event are there when the animation is started and their clients all take APPROXIMATELY the same time to load the animation, you can then use your knowledge of the specific animation being played to make it work with reasonable smoothness (as mentioned above).

I don't think it is productive to be TOO down on this idea. Sure, it may not work perfectly and it is good to warn the OP about that to keep expectations from being too high, but I wouldn't say it is completely infeasible or assume that the implementation will not be worth it.
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
Disapoiotment in SL. But Thanks for all the help.
11-07-2008 17:05
I should have been more involved in the entire conversation, but I thank you all for saving me hours of trial and error. Especially the error part.

I am a bit more disappointed in SL and it lack of functions. We need more help in LSL and Mono to allow Characters to both interact with each other as well as the objects in world.

Thanks again.
InuYasha Meiji.
_____________________
__________________________________
InuYasha Meiji sama
犬夜叉 明治さま

Owner of InuYasha's Experimental Builds, IEB, selling Asian Furnishings and Historical items. Come see the tourist attraction, Shuri Castle Seiden, in Butler sim. Nightly Fireworks, ridable horses, trails into woods, animals to see, 7 seas fishing, and dancing in the throne room to jpop and anime music.