ID:266582
 
How do I define one of it's variables?
Thief jack wrote:
How do I define one of it's variables?
var/obj/Car/c = new(src.loc)
c.variable = "something"


That's the easiest way. Or you could get fancy and add more arguments to the New() proc:
obj/Car/New(loc, newvalue)
. = ..()
if (newvalue)
src.variable = newvalue

// later on where you create the new car...
var/obj/Car/c = new(src.loc, "something")


The second method might be handy if you'll be creating a lot of cars and don't want to type an extra line to set the variable each time.