ID:272998
 
I'm trying to deal with some irregular verb accessability settings. Basically, I'm looking for a fairly easy way to transfer verbs from a datum to a player, ideally by using verb accessability, not by creating a proc to do so.

Using "set src in usr" would be an option, though I would rather use something a little different, like "set src in usr.client.screen" or "set src in usr.group". Both of these are actually legitimate src settings and work, but not for datums. (Incidentially, I learned by experimenting with this that the group list doesn't count for garbage collection, something in usr.group can still get garbage collected...)
I suppose the first thing I should ask is if I can find a complete list of legitimate src settings. The one in BYOND ref is far from complete, listing only the most common ones.

This is the code that I've been working with (not that it's anything too exciting)
#define DEBUG
world
New()
..()
log = file("Bug.txt")
mob
var/v //So v isn't garbage collected
Login()
..()
v = new/VerbObj()
group += v
// src += v
// client.screen += v
VerbObj
// parent_type = /mob
verb
GROUP()
set src in usr.group
SCREEN()
set src in usr.client.screen
INVENTORY()
set src in usr

Does anyone know of any lists that can be used for accessability that allow datums? (Or any way to circumvent the datum problem, such as a list?) I really would prefer not to turn the datums into atoms, I'm expecting to use many of these, and I don't want the extra resource drag of atoms.

I suppose I could create a proc to transfer the verbs, but if a cleaner solution is possible, I'd take it.
set src in world is one setting which you missed, and reveals a rather important flaw here: the src setting is a client-side operation. Therefore, if the client doesn't know about it, the verb cannot be accessed. So, set src in world doesn't work because src won't be in range for the client to be informed of it.

Anyway, src settings are rather rooted in the concept of visibility, because of this. A datum, which is not part of the map, cannot be used with the src settings very well. An obj is your best choice here, really.
In response to Garthor (#1)
Garthor wrote:
Anyway, src settings are rather rooted in the concept of visibility, because of this.

Of course, not all of them. Some src settings are completely unrelated to visibility, so using them the atom doesn't have to be in the map (or have a location at all) for the verb to be available. The other things you said were accurate, though. A client has to be aware of an obj for the verb to be available*, and there are essentially no src settings (that I'm aware of, at least, since indeed not all are documented) that can be used with datums (set src in world would never work for a datum anyway since datums are never in world.contents). You can use some with an off-map atom, though.

*: As this is supposed to be normally handled by BYOND, you could say it's a bug that 'set src in world' doesn't always work by itself without a little extra help - BYOND already by nature automatically alerts the client to changes in objects involved in most of the other src settings, so it should probably go out of its way take care of this one as well.