Dropping and picking up items

Post » Fri Jan 01, 2010 11:04 pm

Hi,

I'm working on an MWSE script that works with item references. At the beginning of the script I port the player to a dummy cell and drop all of his items, and at the end I need to pick all of them back up. All of this needs to happen in the same frame, and I can't use AddItem/RemoveItem because I need to preserve condition and charge values. Will looping through the refs and doing ItemRef->Activate,Player make the player pick all of the items up in the same frame?

Thanks
User avatar
katsomaya Sanchez
 
Posts: 3368
Joined: Tue Jun 13, 2006 5:03 am

Post » Fri Jan 01, 2010 10:58 pm

To handle this, you want to send all the items to a container and then bring them back. You can easily and safely loop through the player's inventory or a container's inventory, so moving things back and forth is much simpler and safer (and better for FPS) than dropping them. :)
User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Sat Jan 02, 2010 3:07 am

To handle this, you want to send all the items to a container and then bring them back. You can easily and safely loop through the player's inventory or a container's inventory, so moving things back and forth is much simpler and safer (and better for FPS) than dropping them. :)

The script I'm working on has to do with recharging enchanted items. I can only get/set the charge on an item reference, and you can't get references for items in containers.

It doesn't look like you can make the player pick up items with Activate. It's not working at all in a global script and it doesn't seem to work in a targeted script unless the player has manually activated the item. This means I won't be able to show the current charge when I'm listing enchanted items and after the recharge is done I'll have to shove the item in the player's face and make them pick it up manually.
User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am


Return to III - Morrowind