Mantis Bug Tracker

View Revisions: Issue #6688 All Revisions ] Back to Issue ]
Summary 0006688: suggestion for improved osAttach* and osForceAttach* functions
Revision 2013-06-24 08:47 by Starflower
Description The current llAttach* and osForceAttach* functions here listed do not in every circumstance allow you to attach an item from prim inventory on a temporary basis, i.e. a copy will always be made in the avatar's inventory, unlike llAttachToAvatarTemp. I find my avatar inventory filling up with copies, as a result! There are two possible approaches to filling in all the gaps in the use cases, either by creating the suggested functions or, which would seem much less unwieldy, modifying how the functions work and deprecating the current ones:

Current: llAttachToAvatar, llAttachToAvatarTemp, osForceAttachToAvatar, osForceAttachToAvatarFromInventory, osForceAttachToOtherAvatarFromInventory

Suggested: osAttachToAvatarFromInventoryTemp, osForceAttachToAvatarFromInventoryTemp, osAttachToOtherAvatarFromInventoryTemp, osForceAttachToOtherAvatarFromInventoryTemp, osForceAttachToAvatarTemp

Alternatively you could use optional parameters to reduce the required number of functions:

void osAttachToAvatar(integer attachmentPoint, {integer temporary})
void osForceAttachToAvatar(integer attachmentPoint, {integer temporary})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
[temporary = TRUE, FALSE]

Another approach would be to add a second optional parameter and avoid repeating all the osForce* duplicates (this would simply be ignored if the script has not got permission to use high threat level functions, in which case it would ask for permission in the normal way. You could, if you liked, choose for the script to report an error if force == TRUE and threat level exceeds that allowed, but for no error to be reported if force == FALSE or if the second optional parameter is omitted.

void osAttachToAvatar(integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary}, {integer force})
[temporary = TRUE, FALSE; force = TRUE, FALSE]

I think it's useful, however, to retain these last three as separate without adding further optional parameters for other avatar name if any, or name of asset in inventory if any, as this would massively over-complicate the functions! :-)

Note you might also want to follow the same pattern here, for consistency:

osDropAttachment{{integer force})
osDropAttachmentAt(Vector3 pos, Quaternion rot, {integer force})
Revision 2013-06-24 08:46 by Starflower
Description The current llAttach* and osForceAttach* functions here listed do not always allow you to attach an item from prim inventory on a temporary basis, i.e. a copy will always be made in the avatar's inventory, unlike llAttachToAvatarTemp. I find my avatar inventory filling up with copies, as a result! There are two possible approaches to filling in all the gaps in the use cases, either by creating the suggested functions or, which would seem much less unwieldy, modifying how the functions work and deprecating the current ones:

Current: llAttachToAvatar, llAttachToAvatarTemp, osForceAttachToAvatar, osForceAttachToAvatarFromInventory, osForceAttachToOtherAvatarFromInventory

Suggested: osAttachToAvatarFromInventoryTemp, osForceAttachToAvatarFromInventoryTemp, osAttachToOtherAvatarFromInventoryTemp, osForceAttachToOtherAvatarFromInventoryTemp, osForceAttachToAvatarTemp

Alternatively you could use optional parameters to reduce the required number of functions:

void osAttachToAvatar(integer attachmentPoint, {integer temporary})
void osForceAttachToAvatar(integer attachmentPoint, {integer temporary})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
[temporary = TRUE, FALSE]

Another approach would be to add a second optional parameter and avoid repeating all the osForce* duplicates (this would simply be ignored if the script has not got permission to use high threat level functions, in which case it would ask for permission in the normal way. You could, if you liked, choose for the script to report an error if force == TRUE and threat level exceeds that allowed, but for no error to be reported if force == FALSE or if the second optional parameter is omitted.

void osAttachToAvatar(integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary}, {integer force})
[temporary = TRUE, FALSE; force = TRUE, FALSE]

I think it's useful, however, to retain these last three as separate without adding further optional parameters for other avatar name if any, or name of asset in inventory if any, as this would massively over-complicate the functions! :-)

Note you might also want to follow the same pattern here, for consistency:

osDropAttachment{{integer force})
osDropAttachmentAt(Vector3 pos, Quaternion rot, {integer force})
Revision 2013-06-24 08:45 by Starflower
Description The current llAttach* and osForceAttach* functions here listed do not allow you to attach an item from prim inventory on a temporary basis, i.e. a copy will always be made in the avatar's inventory, unlike llAttachToAvatarTemp. I find my avatar inventory filling up with copies, as a result! There are two possible approaches to filling in all the gaps in the use cases, either by creating the suggested functions or, which would seem much less unwieldy, modifying how the functions work and deprecating the current ones:

Current: llAttachToAvatar, llAttachToAvatarTemp, osForceAttachToAvatar, osForceAttachToAvatarFromInventory, osForceAttachToOtherAvatarFromInventory

Suggested: osAttachToAvatarFromInventoryTemp, osForceAttachToAvatarFromInventoryTemp, osAttachToOtherAvatarFromInventoryTemp, osForceAttachToOtherAvatarFromInventoryTemp, osForceAttachToAvatarTemp

Alternatively you could use optional parameters to reduce the required number of functions:

void osAttachToAvatar(integer attachmentPoint, {integer temporary})
void osForceAttachToAvatar(integer attachmentPoint, {integer temporary})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary})
[temporary = TRUE, FALSE]

Another approach would be to add a second optional parameter and avoid repeating all the osForce* duplicates (this would simply be ignored if the script has not got permission to use high threat level functions, in which case it would ask for permission in the normal way. You could, if you liked, choose for the script to report an error if force == TRUE and threat level exceeds that allowed, but for no error to be reported if force == FALSE or if the second optional parameter is omitted.

void osAttachToAvatar(integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToAvatarFromInventory(string itemName, integer attachmentPoint, {integer temporary}, {integer force})
void osAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, integer attachmentPoint, {integer temporary}, {integer force})
[temporary = TRUE, FALSE; force = TRUE, FALSE]

I think it's useful, however, to retain these last three as separate without adding further optional parameters for other avatar name if any, or name of asset in inventory if any, as this would massively over-complicate the functions! :-)

Note you might also want to follow the same pattern here, for consistency:

osDropAttachment{{integer force})
osDropAttachmentAt(Vector3 pos, Quaternion rot, {integer force})


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker