inventory - getting all items

Post » Tue Jun 19, 2012 4:44 am

I may have missed this in the CK Wiki, but is there a way to "walk through" all items of an actor - specifically, the player?
User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm

Post » Tue Jun 19, 2012 3:50 am

Unfortunately, no. Pretty much all of the Papyrus functions currently available that deal with inventories require that you know beforehand what type of item (or types, if you use a FormList) you're looking for. No inventory walking loops or similar.

Cipscis
User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm

Post » Mon Jun 18, 2012 9:45 pm

Thanks, Cipscis. I didn't think there was. Just wanted to make sure.

Am trying to convert my Encumbering loot armour and weapons Oblivion mod to Skyrim.
In that mod, the player is given an invisible inventory object/token (can we still do this?) that is used as a weight penalty to the player.
Any armour or weapon that is not equipped have their weight added to that token's weight.

I'm currently trying to add a script to an Aliased player but it doesn't seem to work:

1. I created a quest with the PlayerRef as an Alias: PlayerRefAlias
2. I attach a script to that Alias.
Scriptname kuELAAWPlayerS extends ReferenceAliasEvent OnItemAdded (Form baseRef, Int count, ObjectReference itemRef, ObjectReference fromRef)	Debug.Notification ("!kuELAAWPlayerS.OnItemAdded " + baseRef + ", " + count + ", " + itemRef + ", " + fromRef)EndEventEvent OnItemRemoved (Form baseRef, Int count, ObjectReference itemRef, ObjectReference toRef)	Debug.Notification ("!kuELAAWPlayerS.OnItemRemoved " + baseRef + ", " + count + ", " + itemRef + ", " + toRef)EndEvent
3. The script compiles.
4. But the Notifications do not seem to fire.
5. As I understand it, any changes to the player's inventory should go through these 2 Events.

Do you see anything? Maybe onItemAdded / OnItemRemoved does not trigger on the Player.
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am


Return to V - Skyrim