# Questions about making buildings in json

**URL:** https://discourse.cataclysmdda.org/t/questions-about-making-buildings-in-json/17952
**Category:** The Toolbox
**Created:** [December 16, 2018, 7:00am UTC](https://discourse.cataclysmdda.org/t/questions-about-making-buildings-in-json/17952 "2018-12-16T07:00:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)
#### Post date: [December 16, 2018, 7:00am UTC](https://discourse.cataclysmdda.org/t/questions-about-making-buildings-in-json/17952/1 "2018-12-16T07:00:29Z")

</div>

I’m rather confused about the x and y coordinates in the json. I’m probably just being stupid, but I keep having issues with figuring out how exactly it works. More to the point: _Where is the point of origin on those 24x24 grids you make in the json?_  
I’m using fire\_station.json as a reference and certain items are obviously meant to spawn in certain places:  
_{  
“item”: “fireman\_gear”,  
“x”: [20, 20],  
“y”: [21, 21],  
“chance”: 70  
}_  
So there is a 70% chance that an item with the flag ‘fireman\_gear’ will spawn at the coordinates for x: [20,20] y: [21,21], correct?  
I understand that inside the [] each number defines a range of where something will be. So if it was [10, 20] then something could be between the coordinate 10 and the coordinate 20. Check.

## Now I just need to make it so stuff will spawn _inside_ of lockers, which means that I need make specify that with the ‘x’ and ‘y’ coordinates.

Secondly, there is this weird thing happening with _one_ of the mechanical winches.  
 ![Fire%20station1](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/5/5e794268b44303b407dceb4a7fc3a2bb0c26c4b1.png)  
 ![Fire%20Station2](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/a/ae3a4c7c1790ed2f03d3f60432923474b97745a7.png)  
When I 'a’ctivate the winch to close the ‘garage’ doors (after opening them in the first place) it will spawn these three extra ones. When I activate it again to open the garage, they go away.

Does it have to do with the wall I added? It isn’t necessary but I’d like if I could keep it.

---

<div class="post-metadata">

### Author: ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)
#### Post date: [December 16, 2018, 1:15pm UTC](https://discourse.cataclysmdda.org/t/questions-about-making-buildings-in-json/17952/2 "2018-12-16T13:15:37Z")

</div>

In general in CDDA, [0,0] is the upper left hand corner of the screen, and the X axis increases to the right and the Y axis increases toward the bottom of the screen.

---

<div class="post-metadata">

### Author: ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)
#### Post date: [December 16, 2018, 1:17pm UTC](https://discourse.cataclysmdda.org/t/questions-about-making-buildings-in-json/17952/3 "2018-12-16T13:17:54Z")

</div>

I don’t know what I’m looking at in your screenshot because I don’t use that tileset. However, I do know that winches are finicky. There’s a post . . . Bah, couldn’t find it.

The ones I’ve used (t\_gates\_mech\_control) requires that you place it next to a t\_wall or it doesn’t work. And that t\_wall has to be attached to the locked metal door. My guess is that they’re all pretty sensitive and I wouldn’t mess with them unless you’re patient and good at puzzling things out. Best I can say is to look at the default layout and work backwards, but you probably know that.

EDIT:  
And yes, if a coordinate is represented by multiple numbers the object will spawn in one of those locations. So, an item at coordinate x: [21, 23], y: [7, 7] has a chance to spawn at 21,7 22,7 or 23, 7.

Also, y: [7, 7] is the same as y: 7. It’s written both ways throughout the game files and although the brackets make it look nicer I don’t think that’s a hard rule.
