ID:270525
 
How do I add these variables into a turf? I dont want to build each part of my tree, it would take WAY too long, since the tree takes up 19 tiles >_>;

I tried this, but it doesnt work
turf
icon = 'Turf.dmi'
Grass
Tree01
icon_state = "0,0"
pixel_x = -32
Tree02
icon_state = "1,0"
overlays+=/turf/Tree01
Tree03
icon_state = "2,0"
Tree04
icon_state = "3,0"
Tree05
icon_state = "0,1"
Tree06
icon_state = "1,1"
Tree07
icon_state = "2,1"
Tree08
icon_state = "3,1"
Tree09
icon_state = "0,2"
Tree1
icon_state = "1,2"
Tree11
icon_state = "2,2"
Tree12
icon_state = "3,2"
Tree13
icon_state = "0,3"
Tree14
icon_state = "1,3"
Tree15
icon_state = "2,3"
Tree16
icon_state = "3,3"
Tree17
icon_state = "0,4"
Tree18
icon_state = "1,4"
Tree19
icon_state = "2,4"
What do you want pixel_x and pixel_y to be for each one? If you just want pixel_x=-32 for all of them like you have for the first, you could just copy/paste it into all of them, or better yet collect them all into a parent type just for them and set it just for that. Otherwise, if there's a pattern to what you want, you could write a function to handle it for you.

And another thing, overlays+=something shouldn't work there at compile-time like that. It will probably give you an error.
You could always auto-build it. Put one piece on the map, and then on New() have it build the rest of the pieces. Just be sure not to make the simple accident of having one piece build the same piece, or you'll end up in an infinite loop!

obj
tree
tree1
New()
..()
new/obj/tree/tree2(locate(x+1,y,z)) // Build an /obj/tree/tree2 one space to the right.
new/obj/tree/tree3(locate(x,y+1,z)) // Build an /obj/tree/tree3 one space up.
tree2
tree3


Note that these trees are /objs, and not /turfs. More than likely, your trees should be /objs anyways. With this setup, you only need to set an /obj/tree/tree1 wherever you want to start a tree, and the tree will build itself. Of course, you don't want to go crazy with the trees(think of your poor little processor), but a reasonable number should be fine. :)

[Edit]
Also, this has nothing to do with pixel_x or pixel_y. Those variables are nothing but graphical offsets.
[/Edit]

Hiead