var/turf/build_turfs = list("floor" = /turf/floor, "wall" = /turf/wall)
turf
icon = 'turfs.dmi'
floor
icon_state = "floor"
wall
icon_state = "wall"
density = 1
mob
verb
build_turf()
//There is a whole bunch of code here that asks what type of turf
//and where you want to create it, basically in the end we have
//x, y, z and turf type.
var/x_pos = 1
var/y_pos = 1
var/z_pos = 1
var/turf_type = "floor"
var/area/new_area = locate(x_pos, y_pos, z_pos)
var/turf/new_turf_type = build_turfs[turf_type]
var/turf/new_turf = new new_turf_type.type
new_area.contents += new_turf
Problem description:
My goal is to have a list of turfs that the player is allowed build, which is the build_turfs var but when ever the player uses that verb nothing happens. No turf is created and no errors are outputted.
Any ideas?
You're not actually creating a new turf, you're making the turf at that position change into the turf you're "creating", as there's only ever really one turf on a tile at any given time.