Jump to content

Is it possible to read an inventory object's description


GloriaGlitter
 Share

You are about to reply to a thread that has been inactive for 668 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am making a vendor that my group members can use to sell their own creations. With the vendor set to group share, the members can drop their object into the vendor's inventory and apply their texture to the vendor.  The script uses the object name and the object owner's name but I would like to know if there is also a way to read the inventory object's description as that is ideally where I'd like my users to write the price of their creation which can then be read by the script rather than editing the script to set a price variable.

Link to comment
Share on other sites

Thanks Rolig - its  not so much that I want to edit the inventory item, just want to read its description.  Since I can read the inventory item name with my script, was hoping I could read the description as well.  I could get round this by using a notecard but it would have been more elegant and simpler to be able to read the description. But if it can't be done then I'll find another way.

Link to comment
Share on other sites

Sorry.  I read the bit about wanting to read the Description field and mistakenly assumed that you wanted to be able to write into it as well.  Still, neither one is possible. As you said, you can always put the pricing information on a notecard, but that is a bit clunky.  If I were you, I might consider creating a menu-driven script that would allow people who are adding their objects to the vendor to update the prices of their own objects by simply typing them into a textbox. You should be able to compare llDetectedKey with llGetInventoryCreator to tell whether they are the same person, and therefore should be allowed to change its price.  That function has its limits, of course -- if your object includes components created by more than one person, llGetInventoryCreator will return NULL_KEY -- but for some classes of merchandise it ought to work.

Link to comment
Share on other sites

My first thought would be to add a notecard along with the boxed object, and have the notecard's first line used as the price (That would require a bit of careful logic in the script to either read and store the price in a 2-strided list when the notecard is added, or re-direct the logic from the asyncronous note-card read back to whatever interaction is needing the price of the item)

Link to comment
Share on other sites

4 hours ago, GloriaGlitter said:

I'd like my users to write the price of their creation which can then be read by the script rather than editing the script to set a price variable.

a way is to have the user/creator include the price in the name. Is a number of ways to do this. One way goes something like:

string name = "My For Sale Thing. L$50"
integer price = 1 + llSubStringIndex(llToUpper(name), "L$");
if (price)
{  // "L$" found
   price = (integer)llGetSubString(name, 1 + price, -1);
}

if (price > 0)  
{  // price is set (greater than 0)
   ... do something with name and price
}

else
{  // price is not set
   ... error (give the name thing back to the seller with message)
}

 

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 668 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...