# Aid with structures

**URL:** https://discourse.cataclysmdda.org/t/aid-with-structures/21666
**Category:** The Toolbox
**Created:** [October 12, 2019, 9:38pm UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666 "2019-10-12T21:38:13Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 12, 2019, 9:38pm UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/1 "2019-10-12T21:38:13Z")

</div>

Hello. I’m working on expanding factions, but I have experienced some code error. I could use some help with this.

> [  
> {  
> “type”: “mapgen”,  
> “method”: “json”,  
> “om\_terrain”: [“survivor\_campsite”],  
> “weight”: 500,  
> “object”: {  
> “rows”: [  
> “…”,  
> “…”,  
> “…”,  
> “…”,  
> “.mm.mm…##########…”,  
> “.mm.mm…#33’‘’‘’'#…”,  
> “.mm.mm…#33’‘’‘’'#…”,  
> “.mm.mm…#‘’‘’‘’‘’#…”,  
> “.mm.mm…#‘’‘’‘’‘’#2…”,  
> “.mm.mm…#‘’‘’‘’‘’#O…”,  
> “.mm.mm…#‘’‘’‘’‘’#=…”,  
> “.mm.mm…#‘’‘’‘’‘’#U…”,  
> “…#####++###…”,  
> “…”,  
> “…”,  
> “…-r-…”,  
> “…-r-…”,  
> “…”,  
> “…-r-…t…t…”,  
> “…-r-…t…”,  
> “…”,  
> “…”,  
> “…”,  
> “…”  
> ],  
> “terrain”: {  
> “m”: “t\_dirtmound”,  
> “'”: “t\_grass”,  
> “+”: “t\_grass”,  
> “-”: “t\_dirt”,  
> “.”: [“t\_grass”, “t\_grass”, “t\_grass”, “t\_grass”, “t\_grass”, “t\_dirt”],  
> “b”: “t\_dirt”,  
> “d”: “t\_dirt”,  
> “r”: “t\_dirt”,  
> “t”: “t\_tree”  
> },  
> “furniture”: {  
> “#”: “f\_canvas\_wall”,  
> “'”: “f\_groundsheet”,  
> “+”: “f\_canvas\_door”,  
> “-”: “f\_camp\_chair”,  
> “b”: “f\_firering”,  
> “r”: “f\_tourist\_table”,  
> “U”: “f\_kiln\_empty”,  
> “=”: “f\_smoking\_rack”,  
> “O”: “f\_fvat\_empty”,  
> “2”: “f\_butcher\_rack”,  
> “3”: “f\_bed”  
> },  
> “place\_items”: [  
> { “item”: “cannedfood”, “x”: [12, 4], “y”: [21, 7], “chance”: 75 },  
> { “item”: “cannedfood”, “x”: [16, 4], “y”: [21, 7], “chance”: 75 },  
> { “item”: “pasta”, “x”: [16, 4], “y”: [21, 7], “chance”: 75 },  
> { “item”: “camping”, “x”: [10, 8], “y”: [15, 13], “chance”: 75 }  
> ]

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 12, 2019, 9:41pm UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/2 "2019-10-12T21:41:39Z")

</div>

Well, your rows all need to have the same number of characters (and it has to be a multiple of 24).  
But it’s impossible to help if you don’t give the errors you’re getting.

---

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 12, 2019, 9:46pm UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/3 "2019-10-12T21:46:08Z")

</div>

src/main\_menu.cpp:735 [bool main\_menu::new\_character\_tab()] Error: data/mods//Expanded Factions/survivor\_campsite.json: EOF: expecting string but found ‘:’

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 12, 2019, 9:48pm UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/4 "2019-10-12T21:48:37Z")

</div>

You need to close the object and array there too, add `} ]` (spaced correctly) to the end of the file.

---

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 13, 2019, 1:27am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/5 "2019-10-13T01:27:33Z")

</div>

What do you mean by “close the object and array”?

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 13, 2019, 1:30am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/6 "2019-10-13T01:30:48Z")

</div>

In JSON, `{}` specifies and object, and `[]` an array.  
Every object or array that is opened (has an opening `{`/`[`) must be closed (have a corresponding `}`/`]`).  
At the start of that, you open an array, and an object, but do not close them.

---

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 13, 2019, 1:40am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/7 "2019-10-13T01:40:48Z")

</div>

I have also received errors that state: src/main\_menu.cpp:735 [bool main\_menu::new\_character\_tab()] Error: data/mods//Expanded Factions/survivor\_campsite.json: line 33:10: expecting string but found ‘[’

```
    "........................",

    "........................"

  ], [
     ^
       {

```

## 10 “terrain”: 10 “m”:“t\_dirtmound”, 10 21:39:10.527 : Log shutdown.

What is the meaning of “string”?

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 13, 2019, 1:43am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/8 "2019-10-13T01:43:57Z")

</div>

A string is generally text, but it’s just anything enclosed in quotes.  
These are all strings:  
`"cats"`  
`" "`  
`""`  
`".........................."`

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 13, 2019, 1:49am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/9 "2019-10-13T01:49:25Z")

</div>

I’d suggest you look at [how other mapgen is done](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/data/json/mapgen), and try to format your files like that.

---

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 13, 2019, 2:30am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/10 "2019-10-13T02:30:22Z")

</div>

Okay, I do appreciate all of your aid with this project.

---

<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: [October 13, 2019, 2:58am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/11 "2019-10-13T02:58:03Z")

</div>

Also consider reading the [Guide for 1st time contributors](https://github.com/CleverRaven/Cataclysm-DDA/wiki/Guide-to-adding-new-content-to-CDDA-for-first-time-contributors) which includes a brief introduction to JSON and mapgen.

---

<div class="post-metadata">

### Author: ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)
#### Post date: [October 13, 2019, 4:05am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/12 "2019-10-13T04:05:02Z")

</div>

Oh, you’re using the incorrect quotation mark characters, which the JSON reader doesn’t recognize.  
`“` and `”` instead of `"`. What are you using to edit this?  
Here’s a corrected version

```auto
[
  {
    "type": "mapgen",
    "method": "json",
    "om_terrain": ["survivor_campsite"],
    "weight": 500,
    "object": {
      "rows": [
        "…",
        "…",
        "…",
        "…",
        ".mm.mm…##########…",
        ".mm.mm…#33’’’’’’#…",
        ".mm.mm…#33’’’’’’#…",
        ".mm.mm…#’’’’’’’’#…",
        ".mm.mm…#’’’’’’’’#2…",
        ".mm.mm…#’’’’’’’’#O…",
        ".mm.mm…#’’’’’’’’#=…",
        ".mm.mm…#’’’’’’’’#U…",
        "…#####++###…",
        "…",
        "…",
        "…-r-…",
        "…-r-…",
        "…",
        "…-r-…t…t…",
        "…-r-…t…",
        "…",
        "…",
        "…",
        "…"
      ],
      "terrain": {
        "m": "t_dirtmound",
        "’": "t_grass",
        "+": "t_grass",
        "-": "t_dirt",
        ".": "t_grass",
        "b": "t_dirt",
        "d": "t_dirt",
        "r": "t_dirt",
        "t": "t_tree"
      },
      "furniture": {
        "#": "f_canvas_wall",
        "’": "f_groundsheet",
        "+": "f_canvas_door",
        "-": "f_camp_chair",
        "b": "f_firering",
        "r": "f_tourist_table",
        "U": "f_kiln_empty",
        "=": "f_smoking_rack",
        "O": "f_fvat_empty",
        "2": "f_butcher_rack",
        "3": "f_bed"
      }
    }
  }
]

```

---

<div class="post-metadata">

### Author: ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)
#### Post date: [October 14, 2019, 1:04am UTC](https://discourse.cataclysmdda.org/t/aid-with-structures/21666/13 "2019-10-14T01:04:39Z")

</div>

Thank you!

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
