Difference between revisions of "GetInventoryObject"
Jump to navigation
Jump to search
imported>DragoonWraith m (GetInventoryItemType moved to GetInventoryObject) |
imported>DragoonWraith (renamed) |
||
Line 2: | Line 2: | ||
'''Syntax:''' | '''Syntax:''' | ||
GetInventoryObject index | |||
Must be called on a reference. Returns the ''index''th item in the container's inventory. | Must be called on a reference. Returns the ''index''th item in the container's inventory. | ||
Line 9: | Line 9: | ||
ref itemType | ref itemType | ||
set itemType to ( player. | set itemType to ( player.GetInventoryObject 0 ) | ||
container.additem itemType 1 | container.additem itemType 1 | ||
Line 16: | Line 16: | ||
==Notes== | ==Notes== | ||
*Objects are listed in the order they were first picked up. If you pick up a sword, a bow, and a shield, | *Objects are listed in the order they were first picked up. If you pick up a sword, a bow, and a shield, GetInventoryObject 0 will return the sword, 1 will return the bow, and 2 the shield. | ||
*Items remember what order they were in, so if you dropped the bow and picked it up again, it will still be returned by | *Items remember what order they were in, so if you dropped the bow and picked it up again, it will still be returned by GetInventoryObject 1, and the shield will still be 2. | ||
*Like [[GetNumItems]], this works with ''unique items'' - if your 4th item was an arrow, and you have ten of them, GetInventoryItemType 3 (it starts with 0, 3 is the fourth value) will return Iron Arrow, and GetInventoryItemType 4 will return whatever is next, ''not'' another Iron Arrow. | *Like [[GetNumItems]], this works with ''unique items'' - if your 4th item was an arrow, and you have ten of them, GetInventoryItemType 3 (it starts with 0, 3 is the fourth value) will return Iron Arrow, and GetInventoryItemType 4 will return whatever is next, ''not'' another Iron Arrow. | ||
*Prior to OBSE v0006, this function was known as '''GetInventoryItemType'''. | |||
[[Category: OBSE Functions]] | [[Category: OBSE Functions]] | ||
[[Category: OBSE Inventory Functions]] | [[Category: OBSE Inventory Functions]] | ||
[[Category: OBSE Reference Functions]] | [[Category: OBSE Reference Functions]] |
Revision as of 10:31, 19 August 2006
A command for Oblivion Script Extender
Syntax:
GetInventoryObject index
Must be called on a reference. Returns the indexth item in the container's inventory.
Example
ref itemType set itemType to ( player.GetInventoryObject 0 ) container.additem itemType 1
Finds the first item in the player's inventory, and adds an object of the same type to a container.
Notes
- Objects are listed in the order they were first picked up. If you pick up a sword, a bow, and a shield, GetInventoryObject 0 will return the sword, 1 will return the bow, and 2 the shield.
- Items remember what order they were in, so if you dropped the bow and picked it up again, it will still be returned by GetInventoryObject 1, and the shield will still be 2.
- Like GetNumItems, this works with unique items - if your 4th item was an arrow, and you have ten of them, GetInventoryItemType 3 (it starts with 0, 3 is the fourth value) will return Iron Arrow, and GetInventoryItemType 4 will return whatever is next, not another Iron Arrow.
- Prior to OBSE v0006, this function was known as GetInventoryItemType.