ID:1991165
 

Let say something is placed on the map with a verb.
obj/apple
verb/eatapple()


So lets say a mob controlled by a client comes along and the obj has a variable attached to it:

obj/apple/var/owner = mob //mob references the player


So I want the verb mentioned above to be seen when the owner right clicks the object and goes to the apple object. Thats easy to do. However say if someone comes along and they are not apple.owner, then I don't want the verb to show at all for them.

I've tried using the set src in oview() but that appears for everyone that has the object in view. What I want to do is for when the object is in view, the person who is defined as owner to be able to right click it and see it but anyone else, I don't want them to see it.
You can manually add the verb to owner's verbs list as needed.
Even if it is attached to a object?
You can define the verb as a proc and add it to the owner's verb list.
obj/apple
var/mob/owner

proc/eat()

PickedUp(mob/PickerUpper)
if(PickerUpper == owner)
PickerUpper.verbs += /obj/apple/proc/eat

// or even
new /obj/apple/proc/eat (PickerUpper)

// etc.
When would I run PickedUp then? When the usr gets the item in the inventory?

EDIT: I am creating the PickedUp proc and what do I put it under cause otherwise I get a undefined proc error.
It's times like this when I wish we could modify list type predefined procedures ;~; (Add, Remove)
Can't we?

/list
Add()
stuff
if (something)
..()

Nopers, /list is one of those not-a-datum things.
Non-datums currently in the language are: /client, /list, /savefile, and /world. You can define vars and procs under world and client, but they're still not strictly datums. But /list and /savefile don't allow proc definitions at this time.

At some point I'd love to at least address this for /list.
In response to Lummox JR
Lummox JR wrote:
You can define vars and procs under world and client, but they're still not strictly datums.

You can't currently define new vars under /world. Try it, and you will get an error: "variable declaration not allowed here". That's to be expected, since it doesn't have a vars list.
Ah, that's right. But you can add procs.
Aren't global variables basically the same as world/var tho?