Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Hardcoded Attachment Points for Objects to be worn

Zeera Xi
Real Join Date: Mid '05
Join date: 21 Sep 2006
Posts: 54
10-24-2006 12:56
Inspired by [/13/a6/145233/1.html

It would be great if we could have multiple attachment choices for when a user clicks "wear" on an object, for example a pistol, a dialog would pop up with the multiple attachment points the designer of the object created for the object than the usual single attachment point. For example a pistol would be able to be held into a certain rotation and position in the left hand or could be holstered into the proper rotation and position on the right leg.
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
10-24-2006 19:27
From: Zeera Xi
For example a pistol would be able to be held into a certain rotation and position in the left hand or could be holstered into the proper rotation and position on the right leg.

This can be already done with simple script
CODE

list attach_locations = [ ATTACH_RHAND, ATTACH_RHIP ];
list attach_offsets = [ <1,0,0>, <0,0,1> ];

default {

attach( key Contact ) {

if( Contact != NULL_KEY ) {
// check attachment point
integer idx = llListFindList( attach_locations, [ llGetAttached() ] );
if( idx != -1 ) { llSetPos( llList2Vector( attach_offsets, idx ) ); }
else { llSetPos( ZERO_VECTOR ); }
}
}
}

this causes the object to have custom offsets when attached toright hand or right hip, and default position when attached anywhere else. It should be expanded so it doesn't overwrite user preferences, but the basic functionality is there...
Ratus Waydelich
Registered User
Join date: 7 Mar 2007
Posts: 14
09-14-2007 00:45
Hi.

I just opened a new thread to discuss methods how to optain the local rotation of the root object:
/54/07/210449/1.html#post1676079