TheNorthStar Posted October 31, 2011 Share Posted October 31, 2011 Hello, I am wonderuing if there is a GECK function to make NPCs pick up items off the floor? I have scoured the documentation and cannot find anything of the sort. Secondly I am wondering about NPCs looting corpses. I am thinking they could just loop for near by actors and then removealltypeditems with a type set, but what about just looting ONE item, not all of a type? Also I am not sure if this is the proper place to ask this, I did not see a GECK or scripting subforum, so I went for this one. If this is wrong please let me know and move it to the proper location. Thanks! Link to comment Share on other sites More sharing options...
Korodic Posted October 31, 2011 Share Posted October 31, 2011 This would be an amazing feature on a companion. But would require good AI. Link to comment Share on other sites More sharing options...
TheNorthStar Posted October 31, 2011 Author Share Posted October 31, 2011 (edited) This would be an amazing feature on a companion. But would require good AI. That is exactly what I am trying to do. Scavenger/Collector companion who will collect parts (probably with a bit of kleptomania) and help you build stuff. I haven't found a good way to do this yet though. Edited October 31, 2011 by TheNorthStar Link to comment Share on other sites More sharing options...
shittakaburi Posted November 1, 2011 Share Posted November 1, 2011 I haven't done any scripting to this effect so take this with a grain of salt. Companions and NPCs will pick weapons up off the ground after they have been disarmed. NPCs will grab beer bottles and other ingestables occasionally. I suggest looking around the GECK for the scripts that control this behavior and see if you find anything interesting. Link to comment Share on other sites More sharing options...
TheNorthStar Posted November 1, 2011 Author Share Posted November 1, 2011 I actually have tried looking into this behavior, and as far as I can tell it is some sort of hard coded behavior. I haven't found any scripts that control this. :confused: Link to comment Share on other sites More sharing options...
shittakaburi Posted November 1, 2011 Share Posted November 1, 2011 (edited) I actually have tried looking into this behavior, and as far as I can tell it is some sort of hard coded behavior. I haven't found any scripts that control this. :confused: Interesting, if true. As for looping through a list and getting one item out of that list, the only way to do that is through the NVSE. The specific commands is ListGetNthForm. Edited November 1, 2011 by shittakaburi Link to comment Share on other sites More sharing options...
llamaRCA Posted November 1, 2011 Share Posted November 1, 2011 I actually have tried looking into this behavior, and as far as I can tell it is some sort of hard coded behavior. I haven't found any scripts that control this. :confused: Interesting, if true. As for looping through a list and getting one item out of that list, the only way to do that is through the NVSE. The specific commands is ListGetNthForm. He's right, there is no scripting available to us that controls that behavior. NPCs do it when they are in combat and another weapon that is attractive to them and has ammo is available to them. They don't take weapons when they aren't in combat. The food they take they are using under the control of AI packages. @TheNorthStar - You can have a companion look for one item with a package and some scripting very successfully. However, if they are looking for an item and they never find it there are other issues. You might want to script a timer to control the duration of the looking (take them off of the find package) so they don't look forever. But a find package that looks for one item will do what you want. Edit - No, I just reread what you wrote; I only got part of it the first time through. This won't do what you want. It will only get you one kind of thing at a time. I'm not sure how you can do the whole variety of things. Find packages should work with a list, but if you try it with a NPC they kind of get confused and just stand there and don't do anything. One thing is great and they go right out and get it, but get confuzzled by more. Link to comment Share on other sites More sharing options...
rickerhk Posted November 1, 2011 Share Posted November 1, 2011 The best you could do is have a script running (using NVSE) that searches the cell's containers and have the NPC do the 'looting' animation once in awhile to fake it. In the meantime, your script is doing the looting. Actually, you don't have to search the containers, just search for containers (the NVSE part), and use a combination of RemoveAllTypedItems, GetItemCount, and formlists to vacuum up particular items. Like caps ;) Link to comment Share on other sites More sharing options...
llamaRCA Posted November 1, 2011 Share Posted November 1, 2011 The best you could do is have a script running (using NVSE) that searches the cell's containers and have the NPC do the 'looting' animation once in awhile to fake it. In the meantime, your script is doing the looting. Actually, you don't have to search the containers, just search for containers (the NVSE part), and use a combination of RemoveAllTypedItems, GetItemCount, and formlists to vacuum up particular items. Like caps ;) Hi, I was waiting for you to see the NVSE way to do it :) Link to comment Share on other sites More sharing options...
TheNorthStar Posted November 2, 2011 Author Share Posted November 2, 2011 (edited) The best you could do is have a script running (using NVSE) that searches the cell's containers and have the NPC do the 'looting' animation once in awhile to fake it. In the meantime, your script is doing the looting. Actually, you don't have to search the containers, just search for containers (the NVSE part), and use a combination of RemoveAllTypedItems, GetItemCount, and formlists to vacuum up particular items. Like caps ;) Could you possibly explain this to me? I thought RemoveAllTypedItems only worked with specific item type IDs, like "Armor, Clothing, AlchemyItems, etc" How do you use a custom list for it? EDIT: Oh, maybe I misunderstood you, are you talking about the exemption formList? So each time I wanted to run the loot script I would have to loop the container and add the items that I DON'T want to a list, and check it against that, correct? What about items from other mods, how would I prevent those from being taken as well? EDIT 2: Oh wait, I'm a dummy, I guess I could just check targetItem == MyItemType, and if not add to the list. Herp Derp, I'm a noob. ;) EDIT 3: And thanks for the help everyone! :) Appreciate all the responses! Edited November 2, 2011 by TheNorthStar Link to comment Share on other sites More sharing options...
Recommended Posts