[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "Walking Through Inventory Items"
Jump to navigation
Jump to search
Walking Through Inventory Items (edit)
Revision as of 12:40, 19 February 2008
, 12:40, 19 February 2008Moved suggestions to the bottom of the page
imported>Haama (Created) |
imported>Haama (Moved suggestions to the bottom of the page) |
||
Line 15: | Line 15: | ||
set pInvObj to (pCont.GetInventoryObject InvPos) | set pInvObj to (pCont.GetInventoryObject InvPos) | ||
;Do whatever you want to do | ;Do whatever you want to do | ||
Goto | Goto | ||
endif</pre> | endif</pre> | ||
Line 33: | Line 30: | ||
set InvPos to (InvPos + 1) | set InvPos to (InvPos + 1) | ||
;Do whatever you want to do | ;Do whatever you want to do | ||
Goto | Goto | ||
endif</pre> | endif</pre> | ||
Line 42: | Line 36: | ||
*[[GetInventoryObject]] returns the base object FormID. It can't be used when a reference should be used. The information returned about it (i.e., using [[GetSoulLevel]]) will be about the base object and not necessarily each object in the player's inventory. That is, if the player has 2 petty soul gems, one filled and the other empty and you use [[GetSoulLevel]] it will return the same for both (empty). | *[[GetInventoryObject]] returns the base object FormID. It can't be used when a reference should be used. The information returned about it (i.e., using [[GetSoulLevel]]) will be about the base object and not necessarily each object in the player's inventory. That is, if the player has 2 petty soul gems, one filled and the other empty and you use [[GetSoulLevel]] it will return the same for both (empty). | ||
*Can be used for both [[Container|containers]] and [[:Category:Actors|actors]]. | *Can be used for both [[Container|containers]] and [[:Category:Actors|actors]]. | ||
<ul> | |||
<li>Some common things to do with the item</li> | |||
*Run tests such as | |||
if (IsQuestItem pInvObj) | |||
if (pInvObj == Apple) | |||
*Find out how many the player has | |||
set InvObjCount to (pCont.GetItemCount pInvObj) | |||
</ul> | |||
[[Category:Useful Code]] | [[Category:Useful Code]] | ||
[[Category:Standardized Tutorial Snippets]] | [[Category:Standardized Tutorial Snippets]] |