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
llInstantMessage(CORRADE, wasKeyValueEncode( [ "command", "attach", "group", GROUP, "password", PASSWORD, "callback", URL, "attachments", wasListToCSV( [ "Skull", "hellobox", "Mouth", "Bottle", "Nose", "606679e2-fed0-412a-ac36-e1140c2dfff6" ] ) ]) );
attachments is a list of attachment points followed by primitive names or
UUIDs. 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
UUIDs are preceded by attachment points. Corrade implements
libomv's list of attachment points (from the documentation):
|Right hand if object was not previously attached|
|Right upper arm|
|Left upper arm|
|Right upper leg|
|Right lower leg|
|Left upper leg|
|Left lower leg|
|HUD Center position 2|
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
UUIDs 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.