Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetMass() and attachments - BUG.

Krashnburn Hillquit
Registered User
Join date: 14 Feb 2006
Posts: 15
03-19-2006 17:07
If you save a script in to an atachment, any calls to llGetMass() will return the mass of the object.

after a rez, it will return a far different mass, I assume the mass of the Av?

any way, if you use your mass in any calculations this will obviously throw you drastically off... just finished "Perfectly tweaked" attachments magicaly breaking when you teleport, log or just change clothes and back.
Nexus Nash
Undercover Linden
Join date: 18 Dec 2002
Posts: 1,084
03-19-2006 18:59
Consider attachements your avatar. Yes it's a combined mass.

btw, mass is usless in SL :) (I really hate it ;) )
_____________________
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
03-19-2006 21:02
The way it used to work (I haven't tested in a while) was

a) Attachments had no mass.

and

b) if you asked an attachment its mass, it would return the mass of the avatar.

Now, if you have an attachment that is attached and while it is attached, it sometimes returns its own mass and sometimes returns the mass of the avatar, then that's a bug and you should report it.

But it's always been the case that a prim would return its own mass when unattached and the mass of the avatar when attached.

It even says this in the wiki

CODE
When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Nexus Nash
Undercover Linden
Join date: 18 Dec 2002
Posts: 1,084
03-19-2006 21:16
Am I thinking of simply being linked to a prim then?

probably...
_____________________
Krashnburn Hillquit
Registered User
Join date: 14 Feb 2006
Posts: 15
03-20-2006 09:46
From: Shack Dougall
The way it used to work (I haven't tested in a while) was

a) Attachments had no mass.

and

b) if you asked an attachment its mass, it would return the mass of the avatar.

Now, if you have an attachment that is attached and while it is attached, it sometimes returns its own mass and sometimes returns the mass of the avatar, then that's a bug and you should report it.

But it's always been the case that a prim would return its own mass when unattached and the mass of the avatar when attached.

It even says this in the wiki



I know how it SHOULD work, I presented a bug where it does not work that way.

Its easy to test,

just edit an attachment, make a new script and put
llOwnerSay((string)llGetMass());
in state entry... it will return the mass of the Object.

Remove and re-wear the attachment, Or lot/teleport whatever
and reset the script (not recompile) and it will give the mass of the avatar,
then recompile the script and it will give the mass of the object again.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
03-20-2006 10:15
I've seen this bug exactly as you described it, and I've reported a reproducible case in a bug report. You may want to do the same, since my report was before 1.9, and it seems the bug is still around.