wiki.sine.space | sinespace

Difference between revisions of "Scripting/SInventoryItem"

From wiki.sine.space
Jump to: navigation, search
(Defined and added simple example to SInventoryItem .Use() .Delete())
Line 2: Line 2:
  
 
==Members==
 
==Members==
 +
{{ScriptFunction|bool|StoreCustomData|(string data);|Updates the inventory items custom data, and requests a synchronisation with the inventory server. It may not update on the server immediately, but all local calls will reflect the new data. Note: this request can be rate limited and should only be called from a user initiated action (such as clicking a button). Updates to custom data must not be initiated on a timer or regular automatic event. '''Access to this function can be blacklisted to specific creators if abused'''.}}
 +
 +
{{ScriptFunction|void|Use|();|Player will 'Use' this item.|5=
 +
<pre>Items = Space.Inventory.Items
 +
Items[1].Use() </pre>}}
 +
 +
{{ScriptFunction|void|Delete|();|Player will 'Delete' this item.|5=
 +
<pre>Items = Space.Inventory.Items
 +
Items[1].Delete()</pre>}}
 +
 +
==Properties==
 
{{ScriptFunction|long|MasterID|{ get; }|The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists}}
 
{{ScriptFunction|long|MasterID|{ get; }|The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists}}
 
{{ScriptFunction|long|PlayerItemID|{ get; }|The instance ID for this item - this is guaranteed to be unique per inventory item}}
 
{{ScriptFunction|long|PlayerItemID|{ get; }|The instance ID for this item - this is guaranteed to be unique per inventory item}}
Line 8: Line 19:
 
{{ScriptFunction|string|Brand|{ get; }|Returns brand information about the item}}
 
{{ScriptFunction|string|Brand|{ get; }|Returns brand information about the item}}
 
{{ScriptFunction|string|CustomData|{ get; }|Returns any custom data associated with this item, typically used for 'game' items}}
 
{{ScriptFunction|string|CustomData|{ get; }|Returns any custom data associated with this item, typically used for 'game' items}}
{{ScriptFunction|bool|StoreCustomData|(string data);|Updates the inventory items custom data, and requests a synchronisation with the inventory server. It may not update on the server immediately, but all local calls will reflect the new data. Note: this request can be rate limited and should only be called from a user initiated action (such as clicking a button). Updates to custom data must not be initiated on a timer or regular automatic event. '''Access to this function can be blacklisted to specific creators if abused'''.}}
+
 
  
  
 
{{Scripting Navbox}}
 
{{Scripting Navbox}}

Revision as of 11:36, 12 December 2020

Each SInventoryItem refers to a single item in the users inventory. See also Scripting/SInventory for master inventory access.

Members

StoreCustomData

bool StoreCustomData (string data);

Updates the inventory items custom data, and requests a synchronisation with the inventory server. It may not update on the server immediately, but all local calls will reflect the new data. Note: this request can be rate limited and should only be called from a user initiated action (such as clicking a button). Updates to custom data must not be initiated on a timer or regular automatic event. Access to this function can be blacklisted to specific creators if abused.

No example provided yet


Use

void Use ();

Player will 'Use' this item.

Items = Space.Inventory.Items
Items[1].Use() 


Delete

void Delete ();

Player will 'Delete' this item.

Items = Space.Inventory.Items
Items[1].Delete()


Properties

MasterID

long MasterID { get; }

The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists

No example provided yet


PlayerItemID

long PlayerItemID { get; }

The instance ID for this item - this is guaranteed to be unique per inventory item

No example provided yet


Name

string Name { get; }

Returns the name of the inventory item

No example provided yet


Description

string Description { get; }

Returns the registered description of the inventory item in the users locale

No example provided yet


Brand

string Brand { get; }

Returns brand information about the item

No example provided yet


CustomData

string CustomData { get; }

Returns any custom data associated with this item, typically used for 'game' items

No example provided yet