ARGH! Buildings.jsons

I have the following code taken from warehouse.json

"furniture": { "1" : "f_crate_c", "2" : "f_sink", "5" : "f_counter", "6" : "f_chair", "7" : "f_desk", "8" : "f_bookcase", "9" : "f_sofa", "@": "f_trashcan" }, "toilets" : { "4" : { } },

WHERE IN THE HECK ARE THOSE ITEMS PLACED?

The initial terrain image at the top has its definitions right below it. At the bottom of the .json you have trees/etc. individually set. (though I’m not sure why? Wouldn’t that be in the picture, above? There’s no chance/etc.) - and you have items placed, with a chance of those items. But I cannot figure out for the life of me where the furnature in the above code is placed, or why SOME terrain items are ‘set’ below and some are depicted in the picture.

My -theory- for this, looking at other .json, is that in the terrain definition, where an ASCII symbol appears under both ‘terrain’ and ‘furniture’ then the particular furniture is placed at the terrain. And that would make sense and be fairly straightforward. But if thats the case, I’m still not sure why some trees are individually placed via the ‘set’ command and some are not. Is there a really well commented file somewhere that explains these?

There might be a particular thing one or the other approach works around, but mostly they’re just two different ways to do the same thing.

This works right here.

And yeah, it’s most likely just two different ways to do the same thing.

Mapgen layout:

            [
                "....S.SSSSSSSSSSSS......",
                "zzzzSzSSSSSSSSSSSSzzzzzz",
                ".---3-MMMMMMMMMMMM-----.",
                ".|11 6            w111|.",
                ".|11               1 1|.",
                ".|1  1               1|.",
                ".|11                11|.",
                ".|1                 11|.",
                ".|111                1|.",
                ".|1 1              1  |.",
                ".|1111               @|.",
                ".|1111                |.",
                ".|111               1 |.",
                ".|111                 |.",
                ".|11   1            61|.",
                ".|--3---            11|.",
                ".|55   |@        1  11|.",
                ".|4    |1          111|.",
                ".O2   9|1 11  111  111|.",
                ".|5 6 9|1 111  611 111|.",
                "z|5@788|11111111111111|z",
                "z---O------------------z",
                "z^^zzzz^^zz^^zz^^zzzz^^z",
                "zzzz..zzzzzzzzzzzz..zzzz"
            ],

This section binds characters in the mapgen layout to terrain, furniture, and certain special map features (toilets, vending machines, etc)

            "terrain": {
                "." : "t_grass",
                "-": "t_wall",
                "|": "t_wall",
                "S" : "t_sidewalk",
                "M": "t_door_metal_locked",
                "O": "t_window",
                "w": "t_gates_mech_control",
                "z": "t_shrub",
                "^": "t_tree_pine",
                " ": "t_floor",
                "1": "t_floor",
                "2": "t_floor",
                "3": "t_door_locked",
                "4": "t_floor",
                "5": "t_floor",
                "6": "t_floor",
                "7": "t_floor",
                "8": "t_floor",
                "9": "t_floor",
                "@": "t_floor"
            },
            "furniture": {
                "1" : "f_crate_c",
                "2" : "f_sink",
                "5" : "f_counter",
                "6" : "f_chair",
                "7" : "f_desk",
                "8" : "f_bookcase",
                "9" : "f_sofa",
                "@": "f_trashcan"
            },
            "toilets" : {
                "4" : { }
            },

This section is used for more complicated placements, usually for ones requiring a random chance to spawn or repeated chances over an area.

            "set": [
                { "point": "terrain", "id": "t_dirt",      "x": 23,        "y": [ 0,23 ], "repeat": [ 5,10 ] },
                { "point": "terrain", "id": "t_dirt",      "x": [ 0,23 ],  "y": 23,       "repeat": [ 5,8 ] },
                { "point": "terrain", "id": "t_tree_pine", "x": [ 0,5 ],   "y": 0,        "repeat": [ 0,1 ] },
                { "point": "terrain", "id": "t_tree_pine", "x": [ 18,23 ], "y": 0,        "repeat": [ 0,1 ] },
                { "point": "terrain", "id": "t_shrub", "x": 0,             "y": [ 2,19 ], "repeat": [ 1,4 ] },
                { "point": "terrain", "id": "t_shrub", "x": 23,            "y": [ 2,19 ], "repeat": [ 1,4 ] },
                { "point": "terrain", "id": "t_tree_pine", "x": 0,         "y": [ 2,19 ], "repeat": [ 0,2 ] },
                { "point": "terrain", "id": "t_tree_pine", "x": 23,        "y": [ 2,19 ], "repeat": [ 0,2 ] }
            ],

This line will place t_dirt 5-10 times across (y:[0,23]) the lowest row (x:23).

{ "point": "terrain", "id": "t_dirt",      "x": 23,        "y": [ 0,23 ], "repeat": [ 5,10 ] },

This line will place t_dirt 5-8 times up and down (x:[0,23]) the last column (y:23).

{ "point": "terrain", "id": "t_dirt",      "x": [ 0,23 ],  "y": 23,       "repeat": [ 5,8 ] },

I’m not sure exactly what the chance to place is. Maybe there’s some default 50% chance, so whoever contributed this structure didn’t bother specifying. Either way, random placement and random placement over an area is how this section is meant to be used.