Scripting - Drop inventory items to world?

Post » Sun Jun 17, 2012 9:53 pm

Hey,

I know the CK came out today but I was wondering if anyone somehow knows the scripting method to get things to drop from an inventory to the world. I assumed RemoveAllItems() with no arguments would do the trick but it just deletes all the items in the inventory rather than drop them.

Thanks
User avatar
Tiffany Carter
 
Posts: 3454
Joined: Wed Jul 19, 2006 4:05 am

Post » Sun Jun 17, 2012 2:18 pm

Try http://www.creationkit.com/DropObject_-_ObjectReference.
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Sun Jun 17, 2012 7:34 pm

Yes but there's no way to get items from the inventory is there? Drop will just drop any item code you give it rather than what the player / NPC actually has on them won't it?
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Sun Jun 17, 2012 5:30 pm

Yes but there's no way to get items from the inventory is there? Drop will just drop any item code you give it rather than what the player / NPC actually has on them won't it?

You can make it drop all the items from the inventory if you make i'm pretty sure '*' will use all the codes, not sure thought.
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Sun Jun 17, 2012 7:58 pm

The script needs to first check to see if the character has the item. If so, it needs to remove the item. Then it needs to place the item at the player's location.

Unless they have changed the way objects are handled through scripting, the item doesn't get moved from an inventory to the world. it is removed and then placed. When you pick an item up it is removed from the world and added to the inventory. For all practical purposes it is moving from one to the other. But literally it is being deleted from one and added to the other. Like I said though, things may be handled differently this time around...
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Sun Jun 17, 2012 4:20 pm

You can make it drop all the items from the inventory if you make i'm pretty sure '*' will use all the codes, not sure thought.

Unfortunately that causes a compile error and it expects a right paren


The script needs to first check to see if the character has the item. If so, it needs to remove the item. Then it needs to place the item at the player's location.

Unless they have changed the way objects are handled through scripting, the item doesn't get moved from an inventory to the world. it is removed and then placed. When you pick an item up it is removed from the world and added to the inventory. For all practical purposes it is moving from one to the other. But literally it is being deleted from one and added to the other. Like I said though, things may be handled differently this time around...

There doesn't seem to be a method to check what is in their inventory / a way to loop through every possible item
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Sun Jun 17, 2012 7:50 pm

Unfortunately that causes a compile error and it expects a right paren




There doesn't seem to be a method to check what is in their inventory / a way to loop through every possible item

You don't need to check all items, just check an id of the specific object you want to drop. This is an issue if you want it to be something random though.. There's probably a solution, but I'm a beginner scripter so it's out of my league.
User avatar
Brooke Turner
 
Posts: 3319
Joined: Wed Nov 01, 2006 11:13 am

Post » Sun Jun 17, 2012 2:40 pm

You don't need to check all items, just check an id of the specific object you want to drop. This is an issue if you want it to be something random though.. There's probably a solution, but I'm a beginner scripter so it's out of my league.

Right well (no offense) please read the thread, I want to drop what they have in their inventory (not a specific item, not a random item, I can't seem to find out what they do have in their inventory, etc). From what I can gather Drop can drop any item, even if it isn't in their inventory.
User avatar
Shelby Huffman
 
Posts: 3454
Joined: Wed Aug 08, 2007 11:06 am


Return to V - Skyrim