ID:178904
 
Ok, Someone should just make a demo for Building verbs! I mean, Everyone is asking! =D Even ME! Please help me on this:
if("Carpet")
new/obj/Carpet in usr.loc

How would I go'sabout doing that?

Next, FireEmblem Guy, someone ELSE in my neighborhood on BYOND, just bought my second key(He didnt know his e-mail so he couldn't get the confirmation #!) He made a game called Kung Fu Ru, some might have played it. Anywoo, He made a guy(I made a guy) Called Kung Fu Dude, So DO NOT come into my 'Enjoy Life' game saying I ripped the icon from KFR! Thank you!
FireEmblem wrote:
Ok, Someone should just make a demo for Building verbs! I mean, Everyone is asking! =D Even ME! Please help me on this:
if("Carpet")
new/obj/Carpet in usr.loc

How would I go'sabout doing that?

You're pretty close there. I'd try this:
turf/buildable
var/list/types=list("carpet"=/turf/carpet,
"ice"=/turf/ice,
"stone"=/turf/stone)

verb/Build()
set src in oview(0)
thing=input("What do you want to build here?","Build") as null|text in types
if(!thing) return
var/buildtype=types[thing]
new buildtype(usr.loc)

That gives you an associative list with items to choose from. It's a big time/space saver because then you don't need a massive switch() statement.

The syntax you used for new won't work, because the "in" operator does something different. Whenever you want to create a new object, use something more like this:
new /obj/bubble(the_turf)

Lummox JR