ID:155191
 
I don't understand why this doesn't work. It works with verbs or other procs that I define but it won't work for the built in proc Click(). I set the oview(1) but I can click on anything within my view range and I pick the object up or open the door. >.>

obj/items

// *****Get and Drop*****
Click()
set src in oview(1)
if(usr.item_count >= 2)
usr << "You are holding to many things!"
else
loc = usr
usr.item_count ++

obj/items/verb
drop()
set src in usr
set category = "Object"
loc = usr.loc
usr.item_count --


obj/door

Click()
set src in oview(1)
if(state == 1)
icon_state = icon_open
density = 0
opacity = 0
state = 2
else
icon_state = icon_close
density = 1
opacity = 1
state = 1


Where do I need to look? Any tips?
The set...in... works only for verbs, not procs. You would need to use an if() statement before everything else:
Click()
if(get_dist(usr, src) > 1) return
// OR if(!(usr in oview(1, src)) return

... do everything else...


If the person is more than one tile away, the Click() will stop (via return).
Click is a proc, not a verb. So, the regular verb settings do not apply.
Click is going to be called regardless of how far away the mob is.
You'll have to do a check in Click then decide whether to take action.
obj/items
Click()
if (src in oview(1))
//Do things
Thanks for the info guys. Sorry I have so many questions each day, it just very difficult for me to learn by reading the guide and references. I have to either be shown an example of my ideas or see someone else's source. :/

Thanks!