mob/var/building = 0
mob/var/tmp/turf/buildselection
client/North()
if(usr.building)
var/turf/A=new usr.buildselection(locate(usr.x,usr.y,usr.z))
A.owner=usr.name
player_turfs+=A
mob.Input_move(NORTH)
This is the code that happends, when you click on a turf, that'll appear in a seperate tab.
obj/build
Click() if(usr.buildon)
builtobjects+=1
if(savetype=="/turf/build/Roof1")
var/turf/A=new/turf/build/Roof1(locate(usr.x,usr.y,usr.z))
A.owner=usr.key
player_turfs+=A
usr.buildselection = A
usr.building = 1
Problem description:
Basically, I've been trying to do various things with my code, just like seen in Dragon Universe or various Custom Games. I've been trying to make it so, the code places the directory of a turf or etc. when clicked on , in a variable. Then when you move, and if a certain Variable == 1, You place a block depending on the directory that was stored in the variable. Please look above for further things.
Does anyone know how to make this work ?
When you say "directory of a turf" you probably mean "type". An example of a type is /turf/build/Roof1. An instance would be new /turf/build/Roof1. They're very different and you can't treat them the same way.
So, what you probably want is something like this: