[Scripting] How can I remove a specific non-unique item?

Post » Sun Jun 14, 2015 2:31 pm

Is there any way to remove a specific, but non-unique, item from the players inventory? Calling the RemoveItem function will always require you to fix an ID, but if you have multiple items of the same ID it might not remove the one you wanted. Functions that can be called from a local script without a fix like setDelete don't seem to work for inventory items though, so I'm not sure how to go about doing this.

Is there an obvious way that I'm missing?

User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Sun Jun 14, 2015 8:46 pm

Using dialogue this is straight forward and I have done it many times - you select Item - and then the non unique item say crab meat with a >= the number you wish removed - so in a quest I check if they have collected 10 items and then check in dialogue they have 10 or more then in results box have player->removeitem "standard item" 10

It should work the same way in a script if you are having the person enter a room just check if they have the item using GetItemCount then do a removeitem

User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Sun Jun 14, 2015 9:09 pm

The problem is I have multiple of the same item all with the same script, but those script's variables are all different. If I just remove one it may not be the one that has the right variables... Just removing "item ID" won't be specific enough for my needs.

User avatar
Alex [AK]
 
Posts: 3436
Joined: Fri Jun 15, 2007 10:01 pm

Post » Sun Jun 14, 2015 11:37 am

Forgive me - I didn't understand your question correctly

User avatar
BethanyRhain
 
Posts: 3434
Joined: Wed Oct 11, 2006 9:50 am


Return to III - Morrowind