ID:965173
 
Keywords: object, path, store, var
(See the best response by DarkCampainger.)
Problem description:

Hello,

Is there a way to store a objects path in a var?
Not explicitly, no. But you can do this, if I'm not mistaken.

obj
Sword
var/color = "Blue"
var/power = 22
var
obj/Sword/myObject = new

mob
verb
GetStats()
src << "Color: [myObject.color]"
src << "Power: [myObject.power]"
Best response
Can you describe what you want to do?

All datums (the base type for all reference data types) have a type variable you can access that holds the type path. You can store a type path in a variable like any other value:
var/myVar = /obj/my/custom/object
var/myOtherVar = src.type


You can also create paths from text using text2path()
var/myVar = text2path("/obj/item/[selected]")


<edit>
Corrected "path" to "type"
Albro1 wrote:
I believe you mean type, correct?

Ah, yes. Whoops--fixed!