You're not doing that correctly. With what you have there, you've assigned usr.contents, which is a list, to a regular variable (which you shouldn't do anyway) then tried to move src into it.
Adding items to your contents is easily done like this:
obj verb Pick_Up() set src in oview(1) src.loc = usr //move src, the obj, into usr, which automatically adds it to the usr's contents.
This is a very simple way to move an existing objects into the usr's contents.
#2 Apr 4 2011, 11:33 am (Edited on Apr 4 2011, 11:43 am)
Don't delete src. That gets rid of it. When you change the loc to usr, it automatically moves the whole obj into the contents list. It won't be on the ground anymore. You may also want to check and make sure that you can't pick up an item you already have.
X.contents is a list which, by definition, contains all the objects which are located within X. However, it is not LITERALLY X, and therefore an invalid target to relocate something to.
Instead of (essentially) src.Move(usr.contents), you need to do src.Move(usr).
src.loc = usr would also get the job done, but using Move() will add some helpful utility, like calling Enter() and Entered() and such.
Also: don't delete src after moving it. Otherwise you... delete it after moving it. And so it's gone.
Adding items to your contents is easily done like this:
This is a very simple way to move an existing objects into the usr's contents.