Difference between revisions of "User:Candlemaster/Item Sorter"
Jump to navigation
Jump to search
no edit summary
imported>Candlemaster (New page: =Item Sorter= This is a wanted script, I have not yet begun working on it. The goal of this script is to search the player's inventory for certain items, and place them into a special co...) |
imported>Candlemaster |
||
Line 1: | Line 1: | ||
=Item Sorter= | =Item Sorter= | ||
The goal of this script is to search the player's inventory for certain items, and place them into a special container. This has been accomplished in a number of oblivion mods (see COBL's alchemy sorter), so it should not be too difficult to find reference scripts. | The goal of this script is to search the player's inventory for certain items, and place them into a special container. This has been accomplished in a number of oblivion mods (see COBL's alchemy sorter), so it should not be too difficult to find reference scripts. | ||
Line 10: | Line 8: | ||
All that I want to do with this script has been done in COBL's alchemy sorter script, so most likely I'll copy the backbone of said script. If you have any advice or tips for this endeavor, please post them here. | All that I want to do with this script has been done in COBL's alchemy sorter script, so most likely I'll copy the backbone of said script. If you have any advice or tips for this endeavor, please post them here. | ||
==First Attempt== | |||
<pre>scn HVHGTSorterScriptIngredients | |||
long InvPos | |||
long Quantity | |||
ref pInvObj | |||
ref pCont | |||
Begin OnActivate | |||
if ( HVHGTOBSE.HasObse == 1 ) | |||
set pCont to PlayerRef | |||
set InvPos to 0 | |||
Label | |||
set pInvObj to (pCont.GetInventoryObject InvPos) | |||
if pInvObj | |||
if ( pInvObj.GetObjectType == 25 ) ;if the item is an ingredient | |||
if ( pInvObj.IsQuestItem == 0 ) ;don't do anything to a quest item | |||
set Quantity to pCont.GetItemCount pInvObj | |||
pCont.RemoveItemNS pInvObj Quantity | |||
AddItemNS pInvObj Quantity | |||
endif | |||
endif | |||
set InvPos to (InvPos + 1) | |||
Goto | |||
endif | |||
endif | |||
End</pre> | |||
This is my first rendition of an OBSE-using ingredient sorter. Notice "GetObjectType == 25" which checks if the object is, in fact, an ingredient. For more codes like this, see [GetObjectType]. Useful codes (For this purpose) seem to be: | |||
<pre>19 Apparatus | |||
20 Armor | |||
21 Book | |||
22 Clothing | |||
25 Ingredient | |||
26 Light ;Including Torches? | |||
27 Misc | |||
33 Weapon | |||
34 Ammo | |||
38 Soul Gem | |||
39 Key | |||
40 Alchemy Item ;I'm pretty sure this means Potion | |||
42 Sigil Stone</pre> |