ID:143037
 
Code:
mob/verb
Get(var/obj/o in view(1))
if(src.am>=src.maxam)
src<<"Your Backpack is full."
return
o.Move(src.contents)
src.am++
Drop(var/obj/o in src.contents)
o.Move(src.loc)
src.am--


Problem description:
It looks like the code should work, but it doesn't. It won't pick up the objects. And drop displays drop on all the items in view, when I only want it to display it on things in your inventory.
Evidence wrote:
o.Move(src.contents)

src.contents is not a location; it's a list. That should be o.Move(src) instead.

Lummox JR
In response to Lummox JR
Thanks man. Do you know why Drop is listed as a command on everythin in the view instead of just in the inventory?
In response to Evidence
this might help you

obj
Sword
icon = 'Sword.dmi'
icon_state = "Sword"
verb
Get()
set src in oview(0)
src.Move(usr)
Drop()
set src in usr
src.Move(usr.loc)


it works how you want it to, at least for the parts you say arent working.
In response to Superbike32
Yea, but I want Drop and Get to be a mob verb.

Oh well, I will just go with an obj verb. Thanks.
In response to Evidence
Evidence wrote:
Yea, but I want Drop and Get to be a mob verb.

Oh well, I will just go with an obj verb. Thanks.

well, with a mob verb they cant be built to go to only certain objects most of the time, so why are you trying to do a mob one instead?

anyways, if you wnated a list of things they can drop to come up, thats easy, or an on-screen inventory, but if u have statpanels still, then i dont know how you could do it like that so once you right click you can only use it on certain ones with a mob verb.
In response to Evidence
You're going to have to change src.contents to usr.contents. src is not something known to the client and therefore it seems to throw a fit when attempting to filter it.