ID:178753
 
Would someone please explain to me why my Get() and Drop() verb is allowing me to get Mobs?

I dont want the Get() verb nor Drop() verb to allow the Mobs to be able to pick one another up as I just tested it out now and I accidentally picked up a player.

Here is my Get() and Drop() verb:

mob/verb
Get()
set category = ("Commands")
set src in oview(2)
if(src.Move(usr))
oview() << "[usr] gets [src]."
usr << "You get [src]."
usr.Wei += src.Wei
else
usr << "You can't get [src]."

Drop()
set category = ("Commands")
set src in usr
if(src.Move(usr.loc))
oview() << "[usr] drops [src]."
usr << "You drop [src]."
usr.Wei -= src.Wei
else
usr << "You can't drop [src]."


Could someone please help?

Lee
When you use set src in something it's telling it to it to pick up mobs because it's setting src which in this case is a mob.

obj
verb
Get()
set src in oview(1)
...


Should help you.
Mellifluous wrote:
Would someone please explain to me why my Get() and Drop() verb is allowing me to get Mobs?

I dont want the Get() verb nor Drop() verb to allow the Mobs to be able to pick one another up as I just tested it out now and I accidentally picked up a player.

The problem is you assigned your Get() and Drop() verbs to mob, then coded them as if you'd assigned them to obj.

There are two ways to do a Get() verb:

Object-oriented method:
obj
verb/Get()
Move(usr)

Player-oriented method:
mob
verb/Get(obj/O as obj in oview(1))
O.Move(usr)

You basically mixed and matched. Hence your error. The verbs should be defined under obj, not mob. Preferably you should assign them under obj/item or some subtype so other objs you can't pick up won't be taken.

Lummox JR
In response to Nadrew
Nadrew wrote:
When you use set src in something it's telling it to it to pick up mobs because it's setting src which in this case is a mob.

> obj
> verb
> Get()
> set src in oview(1)
> ...
>
>

Should help you.

Thanks, time to get to work again :)

Lee
In response to Lummox JR
Lummox JR wrote:
Mellifluous wrote:
Would someone please explain to me why my Get() and Drop() verb is allowing me to get Mobs?

I dont want the Get() verb nor Drop() verb to allow the Mobs to be able to pick one another up as I just tested it out now and I accidentally picked up a player.

The problem is you assigned your Get() and Drop() verbs to mob, then coded them as if you'd assigned them to obj.

There are two ways to do a Get() verb:

Object-oriented method:
obj
> verb/Get()
> Move(usr)

Player-oriented method:
mob
> verb/Get(obj/O as obj in oview(1))
> O.Move(usr)

You basically mixed and matched. Hence your error. The verbs should be defined under obj, not mob. Preferably you should assign them under obj/item or some subtype so other objs you can't pick up won't be taken.

Lummox JR

Ok, thank you so much you guys :)

Lee