David Brasher Posted March 19, 2012 Share Posted March 19, 2012 (edited) The Wiki is woefully vague on how to use this command. On the face of it, the wiki appears to be wrong and to give out bad information. But there is probably some way to get the results the person who wrote the wiki page can. I want to have a Papyrus fragment attached to a quest stage. It removes all the items from a chest and adds them to the player's inventory. But for now I just want to even get the sample script from the wiki working: ChestProperty.RemoveAllItems()(Where ChestProperty is set as the property of the chest added by my mod.) Source of this sample script: Creation Kit, RemoveAllItems - ObjectReference The script will not compile. I get the asinine error message, "RemoveAllItems is not a function or does not exist." Why did they bother to write a wiki page about it if it does not exist? Edited March 19, 2012 by David Brasher Link to comment Share on other sites More sharing options...
janicke80 Posted March 19, 2012 Share Posted March 19, 2012 Hm should work but I get the same error you can get the same effect with the normal if you dont get it to work bit more work but not much ObjectReference Property M AutoFormList Property Mlist Auto m.RemoveItem(Mlist,100,true,akOtherContainer= Game.GetPlayer()) works only if you know what is in the chest or you make a giant list:) Link to comment Share on other sites More sharing options...
Astymma Posted March 19, 2012 Share Posted March 19, 2012 I'm guessing it has to do with it being a script fragment and that quests don't inherit from ObjectReference. Have you tried "Import ObjectReference"? Link to comment Share on other sites More sharing options...
tunaisafish Posted March 20, 2012 Share Posted March 20, 2012 If ChestProperty is an ObjectReference, then it should work. (like the M property in janicke80's post) BTW, Import only imports global functions, so calling that on ObjectReference would do nothing as it only has member functions. Link to comment Share on other sites More sharing options...
fg109 Posted March 20, 2012 Share Posted March 20, 2012 Don't try to use a Container property. They don't inherit from ObjectReference. Link to comment Share on other sites More sharing options...
Korodic Posted March 20, 2012 Share Posted March 20, 2012 when code does not work when you think it should, the first thing to rule out would be variable types ;) Link to comment Share on other sites More sharing options...
Astymma Posted March 20, 2012 Share Posted March 20, 2012 If ChestProperty is an ObjectReference, then it should work. (like the M property in janicke80's post) BTW, Import only imports global functions, so calling that on ObjectReference would do nothing as it only has member functions. Hah the worst part is I'm aware of those distinctions. Teach me not to post unless I'm actually alert. Thanks for being more alert and correcting me, tunaisafish. Link to comment Share on other sites More sharing options...
tunaisafish Posted March 21, 2012 Share Posted March 21, 2012 lol, I know that feeling.I can't teach you to do that though, it's something I've yet to master myself. Link to comment Share on other sites More sharing options...
DeadlyCobraXXX Posted March 21, 2012 Share Posted March 21, 2012 For a quest, if you go to Scripts Tab at the end. Look for the actual quest script. (If there isnt one already, go to Stages and click any stage for now and type in Utility.Wait(0.1) and compile. Close Quest and reEnter. Now you have one.) Once in scripts tab, open up the script's source. Put the RemoveAllItems function at the very bottom of the list, past all other material. Save. Go to your quest Papyrus. If it's in a dialgue, you'll need to edit dialogue source script and add the ObjectReference property for the chest. If it's in a stage, you can add the property to the same Script in the Script tab used above. ChestProperty.RemoveAllItems(Game.Getplayer(), true, true) there you go. PM me if u have any questions. Link to comment Share on other sites More sharing options...
andrewcoop Posted February 5, 2015 Share Posted February 5, 2015 CurrentContainer.RemoveAllItems(NewContainer) Found this on another topic http://forums.nexusmods.com/index.php?/topic/1482423-removeallitems-how-do-you-use-this-function/ Link to comment Share on other sites More sharing options...
Recommended Posts