Difference between revisions of "LlRequestInventoryData"

From Second Life Wiki
Jump to navigation Jump to search
m
m (added example=, also=)
Line 7: Line 7:
|func_footnote
|func_footnote
|func_desc=Requests data from objects inventory object. When data is available the [[dataserver]] event will be raised.
|func_desc=Requests data from objects inventory object. When data is available the [[dataserver]] event will be raised.
|return_text=that is used to identify the [[dataserver]] event when it is raise.
|return_text=that is used to identify the [[dataserver]] event when it is raised.
|spec
|spec
|caveats
|caveats
Line 19: Line 19:
{{LSL Constants/llRequestInventoryData}}
{{LSL Constants/llRequestInventoryData}}
{{!}}}
{{!}}}
|examples
|examples=
<pre>//-- Open map for owner to 1st landmark in object inventory on touch
key vgKeyOwner;
 
default
{
  touch_start( integer vIntNull )
  {
    if (llDetectedKey( 0 ) == vgKeyOwner)
    {
      integer vIntLMcount = llGetInventoryNumber( INVENTORY_LANDMARK );
      //-- make sure we have a landmark in invetory
      if (vIntLMcount)
      {
        llRequestInventoryData( llGetInventoryName( INVENTORY_LANDMARK, 0 ) );
      }
    }
  }
 
  dataserver( key vKeyNull, string vStrData )
  {
    //-- because we don't know who touched us in this event, this
    //-- only works for the owner when called from the dataserver
    llMapDestination( "", (vector)vStrData, ZERO_VECTOR );
  }
 
  on_rez( integer vIntNull )
  {
    vgKeyOwner = llGetOwner();
  }
}</pre>
|helpers
|helpers
|also_functions
|also_functions=
{{LSL DefineRow||[[llMapDestination]]|}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 02:33, 12 November 2007

Summary

Function: key llRequestInventoryData( string name );

Requests data from objects inventory object. When data is available the dataserver event will be raised.
Returns a key that is used to identify the dataserver event when it is raised.

• string name an item in the inventory of the prim this script is in

name Type dataserver Description
Landmark (vector) The vector data received by dataserver is a global position as an offset from the current region's origin (<0,0,0>). To obtain the absolute global position of a landmark, add llGetRegionCorner() to the vector.

Caveats

  • This function causes the script to sleep for 1.0 seconds.
  • If name is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
All Issues ~ Search JIRA for related Bugs

Examples

//-- Open map for owner to 1st landmark in object inventory on touch
key vgKeyOwner;

default
{
  touch_start( integer vIntNull )
  {
    if (llDetectedKey( 0 ) == vgKeyOwner)
    {
      integer vIntLMcount = llGetInventoryNumber( INVENTORY_LANDMARK );
       //-- make sure we have a landmark in invetory
      if (vIntLMcount)
      {
        llRequestInventoryData( llGetInventoryName( INVENTORY_LANDMARK, 0 ) );
      }
    }
  }

  dataserver( key vKeyNull, string vStrData )
  {
     //-- because we don't know who touched us in this event, this
     //-- only works for the owner when called from the dataserver
    llMapDestination( "", (vector)vStrData, ZERO_VECTOR );
  }

  on_rez( integer vIntNull )
  {
    vgKeyOwner = llGetOwner();
  }
}

See Also

Functions

•  llMapDestination

Deep Notes

Search JIRA for related Issues

Signature

function key llRequestInventoryData( string name );