Clear Inventory

Laraqua
23 Mar 2018, 01:27

Is there a way to clear everything from the player's inventory without doing it Object by Object?


Dcoder
23 Mar 2018, 01:46

Type "drop all"


XanMag
23 Mar 2018, 02:17

If you mean that you want to run a script that removes all object from the player inventory, then this should work.

foreach (obj, ScopeInventory()) {
  obj.parent = remove all objects from player room
}

You'll need to type that in the code view for the script because I'm not sure you can do it through the GUI? Maybe?
If you want to move all of the objects and port them to a different location, say "The Library", just place the name of the room you want to move them to after the object.parent =

Copy-paste copy below into new game if you want to see it.

  <object name="remove all objects from player room">
    <inherit name="editor_room" />
    <object name="ball1">
      <inherit name="editor_object" />
      <alias>ball</alias>
      <take />
    </object>
    <object name="ball2">
      <inherit name="editor_object" />
      <alias>ball</alias>
      <take />
    </object>
    <object name="ball3">
      <inherit name="editor_object" />
      <alias>ball</alias>
      <take />
    </object>
    <object name="dot">
      <inherit name="editor_object" />
      <push type="script">
        foreach (obj, ScopeInventory()) {
          obj.parent = remove all objects from player room
        }
      </push>
    </object>

Got questions, let us know.


Laraqua
23 Mar 2018, 04:45

That works, thanks!