Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005927opensim[REGION] Script Functionspublic2012-03-11 10:222014-07-29 13:40
Assigned Tojustincc 
PlatformOperating SystemOperating System Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0005927: [PATCH] osGetInventoryDesc
DescriptionThere does not seem to be a function in lsl to get the description from an object in the inventory of a prim.

This could be userfull to get the hypergrid description from landmarks stored in the inventory of a prim.

I hope the patch is correct, I could not find the wiki doc on how to create a patch.
TagsNo tags attached.
Git Revision or version numberdev
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
Script Engine
EnvironmentMono / Linux64
Mono Version2.10
Attached Filespatch file icon osGetInventoryDesc.patch [^] (3,321 bytes) 2012-03-11 10:22 [Show Content]
patch file icon osGetInventoryDesc_item.patch [^] (2,967 bytes) 2012-03-12 18:33 [Show Content]

- Relationships

-  Notes
GuduleLapointe (reporter)
2012-03-12 17:44
edited on: 2012-03-12 17:45

Using (int type, int number) like in llGetInventoryName() forces an duplicate search.

It means that the script will make twice the same research if you need to get other information (the name, for instance). And they are chance most will need more than the desc alone.

This lookup should be made only once (with llGetInventoryName) to get the object(s) of a certain type, and even in some case, doesn't need to be done at all (when you know the name of the object).

After that, you should use the name or the key you get from name for other queries, like in
    llGetInventoryKey(string name)
    llGetInventoryPermMask(string item, int mask)
    llGetInventoryCreator(string item)
    llGetInventoryType(string name)

I am testing now another patch following this model. I will update here.

GuduleLapointe (reporter)
2012-03-12 18:36

I uploaded an alternative patch, using string item as argument.


Code is smaller, it avoids a second similar search inside the function, and simplifies the code in the script. I think this is the way the function should be implemented, following equivalent llGetInventory* functions design.
MarcelEdward (reporter)
2012-03-13 01:07

Thanks for the refactoring.
justincc (administrator)
2012-03-16 21:06

Applied as git master 4a57112. Thanks guys!

On a side note, would it make sense to have something like osGetInventoryItemDetails() analagous to llGetObjectDetails()? Not that I object to individual functions since pulling apart return values from a list is messy, but it might make for a more extensible function. I don't know for sure - I haven't done a lot of LSL scripting.

- Issue History
Date Modified Username Field Change
2012-03-11 10:22 MarcelEdward New Issue
2012-03-11 10:22 MarcelEdward File Added: osGetInventoryDesc.patch
2012-03-12 10:47 justincc Status new => patch included
2012-03-12 17:44 GuduleLapointe Note Added: 0021084
2012-03-12 17:45 GuduleLapointe Note Edited: 0021084 View Revisions
2012-03-12 18:33 GuduleLapointe File Added: osGetInventoryDesc_item.patch
2012-03-12 18:36 GuduleLapointe Note Added: 0021085
2012-03-13 01:07 MarcelEdward Note Added: 0021086
2012-03-16 21:06 justincc Note Added: 0021124
2012-03-16 21:06 justincc Status patch included => resolved
2012-03-16 21:06 justincc Resolution open => fixed
2012-03-16 21:06 justincc Assigned To => justincc
2014-07-29 13:40 chi11ken Status resolved => closed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker