Jump to content

RemoveAllItems Command


David Brasher

Recommended Posts

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 by David Brasher
Link to comment
Share on other sites

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 Auto

FormList 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

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

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

  • 2 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...