How can i make a npc put items in inventory?

Post » Thu Apr 29, 2010 1:43 pm

I want to make a NPC to store items in a specific inventory, at a specific time every day.
Items will be ingredients that he will have to his inventory. The ingredient kind and number will not be the same every time.
I used a package to make him gather ingradients every day for 3 hours and I want him to store them in container at the end of the package.
I cant make it at any way :( Plz help
User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Thu Apr 29, 2010 9:04 am

Could you make him activate a container, and run a check on the Actor? Something like...

Ref TargetShort ItemCountBegin OnActivate Set Target to GetActionRef Set ItemCount to ( Target.GetItemCount [Item] )  Target.RemoveItem [Item] ItemCount  AddItem [Item] ItemCountEnd


Something like that attached to the container, to automatically remove the items when used?
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Thu Apr 29, 2010 9:05 am

You mean that i have to:

1) Put NPC Activate the LootChest
2) OnActivate: Lootchest will "Remove" the items from NPC and "Add" them to itself.

Problem is that i want NPC store only ingredients (no weapon, armor etc) and the number of those ingredients will not be the same everytime he activates.
How i will call the spesific type of items (Ingradients)

I found [ GetObjectType ] but i dont know how to use it.

OMG so dizzy...
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Thu Apr 29, 2010 3:29 pm

You've basically got it :)

I assume you SET which Ingredients it is looking for? If so, then you just use the Ingredient's name. You can add multiple lines to check for multiple items and counts :)

The Script I wrote above is rough, but should count how many of the specified item the NPC has in their inventory, and then remove that amount-- It should be possible to script in all the possibilities, unless you are doing loads of Ingredients.
User avatar
Benjamin Holz
 
Posts: 3408
Joined: Fri Oct 19, 2007 9:34 pm


Return to IV - Oblivion