Corrade implements getattachments
to retrieve a list of attachment points to attachment names, attach
to attach a list of attachments and detach
to detach attachments. Provided you are a master of the bot, you can also give Corrade items by drag and dropping them into the IM session or directly onto the avatar.
To attach items, you use the attach
command:
llInstantMessage(CORRADE, wasKeyValueEncode( [ "command", "attach", "group", GROUP, "password", PASSWORD, "callback", URL, "attachments", wasListToCSV( [ "Skull", "hellobox", "Mouth", "Bottle", "Nose", "606679e2-fed0-412a-ac36-e1140c2dfff6" ] ) ]) );
where attachments
is a list of attachment points followed by primitive names or UUID
s. The example above will attach an item called hellobox
in Corrade's inventory to its skull, an item named Bottle
to the mouth attachment point and an item with UUID 606679e2-fed0-412a-ac36-e1140c2dfff6
to its nose. Corrade will always replace any previous item on the attachment point.
Thus, the parameter passed to the attachments
property is a list of comma-separated values where attachment names or UUID
s are preceded by attachment points. Corrade implements libomv
's list of attachment points (from the documentation):
Member | Description |
---|---|
Default | Right hand if object was not previously attached |
Chest | Chest |
Skull | Skull |
LeftShoulder | Left shoulder |
RightShoulder | Right shoulder |
LeftHand | Left hand |
RightHand | Right hand |
LeftFoot | Left foot |
RightFoot | Right foot |
Spine | Spine |
Pelvis | Pelvis |
Mouth | Mouth |
Chin | Chin |
LeftEar | Left ear |
RightEar | Right ear |
LeftEyeball | Left eyeball |
RightEyeball | Right eyeball |
Nose | Nose |
RightUpperArm | Right upper arm |
RightForearm | Right forearm |
LeftUpperArm | Left upper arm |
LeftForearm | Left forearm |
RightHip | Right hip |
RightUpperLeg | Right upper leg |
RightLowerLeg | Right lower leg |
LeftHip | Left hip |
LeftUpperLeg | Left upper leg |
LeftLowerLeg | Left lower leg |
Stomach | Stomach |
LeftPec | Left pectoral |
RightPec | Right pectoral |
HUDCenter2 | HUD Center position 2 |
HUDTopRight | HUD Top-right |
HUDTop | HUD Top |
HUDTopLeft | HUD Top-left |
HUDCenter | HUD Center |
HUDBottomLeft | HUD Bottom-left |
HUDBottom | HUD Bottom |
HUDBottomRight | HUD Bottom-right |
Neck | Neck |
Root | Avatar Center |
Detaching is much easier because you do not have to specify the attachment point from which you want to detach an item. Instead, you just supply a list of names or UUID
s to the attachments
parameter of Corrade.
Detaching objects can be performed with the detach command. In order to do this, we issue:
llInstantMessage(CORRADE, wasKeyValueEncode( [ "command", "detach", "group", GROUP, "password", PASSWORD, "callback", URL, "type", "path", "attachments", wasListToCSV( [ "/My Inventory/Cool Stuff/Helmet", "/My Inventory/Cool Stuff/Milk Bottle" ] ) ]) );
Depending on the type
parameter, there are several ways of detaching items from Corrade.