@detachthis has two unrelated forms that share a name: a folder lock (=n/=y) and a force command (=force). Both act on folders chosen relative to worn items.
@detachthis=force takes off the contents of the shared folder(s) that contain a worn item (by default, the issuing object itself).
@detachthis[:<target>]=force
spine): the folders of everything worn on that point;shirt): the folders of every worn wearable of that type;#RLV count. If an item lives in a folded folder (.(spine), .(nostrip)), the folder's parent is used. A shared-folder path is not accepted here, and any other option fails with an option error.All RLVa force-wear commands share one handler (RLV_CMD_FORCEWEAR). They differ only in three flags taken from the dictionary entry:
| Command | Action | Scope | Option selects |
|---|---|---|---|
| attach | replace | folder only | #RLV path |
| attachall | replace | folder + subfolders | #RLV path |
| attachover | add | folder only | #RLV path |
| attachallover | add | folder + subfolders | #RLV path |
| attachthis | replace | folder only | worn item (self, point, layer, UUID) |
| attachallthis | replace | folder + subfolders | worn item (self, point, layer, UUID) |
| attachthisover | add | folder only | worn item (self, point, layer, UUID) |
| attachallthisover | add | folder + subfolders | worn item (self, point, layer, UUID) |
| detachall | remove | folder + subfolders | #RLV path |
| detachthis | remove | folder only | worn item (self, point, layer, UUID) |
| detachallthis | remove | folder + subfolders | worn item (self, point, layer, UUID) |
| detach | remove | folder (node) | path, attachment point, point group, UUID or none |
nostrip, or that sit in a folder whose name contains nostrip, are skipped. So are body parts, locked attachments and wearables (@detach, @remattach, @remoutfit, @detachthis), and Firestorm's LSL bridge..(attachpt) and .(nostrip)) and the contents of folder links inside it. Other subfolders are ignored.@addoutfit, @remoutfit, @addattach, @remattach, @detach) in the same message is processed first.#RLV, nothing happens and the command still succeeds. A UUID that isn't one of your attachments fails with an option error.// Act on the folder this object lives in
llOwnerSay("@detachthis=force");
// Act on the folder(s) of whatever is worn on the spine
llOwnerSay("@detachthis:spine=force");
As a restriction, @detachthis=n stops worn items in the locked folder (that folder only, plus its folded .(…) subfolders) being taken off. That covers manual detach, force-detach commands and @remoutfit, and a locked attachment that comes off anyway is reattached by the lock watchdog. It's an RLV_LOCK_REMOVE folder lock with PERM_DENY.
@detachthis[:<target>]=<n|add|y|rem>
The target selects the folder(s) to lock:
#RLV.#RLV (resolved with partial matching, like the force form). It must exist when the command is issued, or the command fails.A UUID is not accepted, and anything that isn't one of the above fails with an option error. The option is parsed in the order layer, attachment point, UUID, folder, so a single-component path that's also a layer or point name is taken as that layer or point.
#RLV sits in a locked folder. Temporary attachments are exempt.// Lock the folder this collar lives in so it can't be taken off,
// and make the "restraints" folder unwearable
llOwnerSay("@detachallthis=n,attachallthis:restraints=n");
RlvBehaviourInfo("detachthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, FORCEWEAR_WEAR_REMOVE | FORCEWEAR_NODE | FORCEWEAR_CONTEXT_OBJECT) (rlvhelper.cpp:266). There is no processor class, so the legacy switch in RlvHandler::processForceCommand() handles it (rlvhandler.cpp:2883-2900).FORCEWEAR_CONTEXT_OBJECT: the option goes through RlvCommandOptionGetPath (rlvhelper.cpp:1025-1075), whose items are mapped to folders by RlvInventory::getPath() (rlvinventory.cpp:214-237, folded folders map to their parent). Delayed resolution uses RlvCommandOptionGetPathCallback with a 30-second expiry (rlvhelper.cpp:982-1022) and RlvHandler::onForceWearCallback() (rlvhandler.cpp:3235-3247).RlvHandler::onForceWear() (rlvhandler.cpp:3221-3233) checks isSharedFolder() and maps the flags to ACTION_REMOVE. RlvForceWear::forceFolder() (rlvhelper.cpp:1275-1398) and RlvWearableItemCollector (rlvinventory.cpp:687-849) choose the items. The batch is committed by RlvForceWear::done() (rlvhelper.cpp:1731+), called at llviewermessage.cpp:3203-3204.RlvInventory::getSharedFolder(), with partial matching on by default (rlvinventory.cpp:267-308, rlvinventory.h:62).RlvBehaviourInfo(…, RLV_BHVR_DETACHTHIS, RLV_TYPE_ADDREM, FORCEWEAR_NODE|SUBTREE) (rlvhelper.cpp:104-105). It's handled by RlvHandler::onAddRemFolderLock() (rlvhandler.cpp:1988-2030), which creates a RlvFolderLocks entry with PERM_DENY, RLV_LOCK_REMOVE and SCOPE_NODE or SCOPE_SUBTREE taken from the flags.getLockedFolders() (rlvlocks.cpp:982-1046) and isLockedFolder() (rlvlocks.cpp:1149-1214), which walks up from the folded parent. Locked worn items come from getLockedItems() and refreshLockedLookups() (rlvlocks.cpp:1050-1110, 1224-1284) and feed isLockedAttachment() (rlvlocks.h:470-484).isLockedFolder() tests pLockDescr->eLockType & eSourceTypeMask, where you'd expect the lock's source type (rlvlocks.cpp:1180-1184). Every caller in this tree passes a mask that includes bits 0x01 and 0x02, so this has no visible effect.getLockedFolders() for an empty option registers the issuing item's direct parent, but isLockedFolder() starts its walk at the folded parent. A node-scope lock from an attachment that lives in a .(point) folded folder may therefore never match.This command works differently from RLV's @detachthis; see the comparison.