# Diagonal Foundation breaks Wall generation

**URL:** <https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708>\
**Category:** Bug Reports\
**Tags:** building, a20r701\
**Created:** [February 15, 2017, 4:39pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708 "2017-02-15T16:39:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Banane9](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/banane9/32/53172_2.png) [@Banane9](https://discourse.stonehearth.net/u/Banane9)\
**Post date:** [February 15, 2017, 4:39pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/1 "2017-02-15T16:39:40Z")

</div>

**Summary:** A diagonal edge of a foundation will break the wall geneation script and also prevent you from removing the building afterwards.

**Steps to reproduce:**

1. Start designing a custom building
2. Have a foundation with a diagonal edge
3. Try to have it automatically place a wall
4. Enjoy the error console coming up
5. Also: hope it didn’t save after you did that, because you can’t remove the walls _or_ the building.

**Expected Results:** Poles on the ends of the diagonal edge and the normal wall pattern in between; being able to undo the wall placement.

**Actual Results:** Walls on half of the house, no way to remove them or even remove the building.

**Notes:**

- The foundation: 

- Broken Wall Placement: 

- Errors: First comes when trying to place the walls, second when trying to remove the building.

```auto
release-701 (x64)
stonehearth/components/wall/wall_component.lua:372: attempt to index a nil value
stack traceback:
	[C]: ?
	stonehearth/components/wall/wall_component.lua:372: in function 'connect_to_columns'
	stonehearth/services/server/build/build_service.lua:1264: in function 'init_fn'
	stonehearth/services/server/build/build_service.lua:529: in function '_create_blueprint'
	stonehearth/services/server/build/build_service.lua:1262: in function '_create_wall'
	stonehearth/services/server/build/build_service.lua:1249: in function '_add_wall_span'
	stonehearth/services/server/build/build_service.lua:1078: in function 'visitor_fn'
	stonehearth/lib/build_util.lua:819: in function 'grow_walls_around'
	stonehearth/services/server/build/build_service.lua:1077: in function 'grow_walls'
	stonehearth/services/server/build/build_service.lua:1049: in function 'cb'
	stonehearth/services/server/build/build_service.lua:1582: in function 'do_command'
	stonehearth/services/server/build/build_service.lua:1048: in function <stonehearth/services/server/build/build_service.lua:1046>
	
release-701 (x64)
stonehearth/services/server/build/build_undo_manager.lua:415: assertion failed!
stack traceback:
	[C]: ?
	[C]: in function 'assert'
	...ehearth/services/server/build/build_undo_manager.lua:415: in function 'clear'
	stonehearth/services/server/build/build_service.lua:111: in function 'set_teardown'
	stonehearth/call_handlers/build_call_handler.lua:25: in function <stonehearth/call_handlers/build_call_handler.lua:23>

```

**Version Number and Mods in use:** release-701 x64, no mods

**System Information:** Windows 10 64-bit

---

<div class="post-metadata">

**Author:** ![Genex](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Genex](https://discourse.stonehearth.net/u/Genex)\
**Post date:** [February 16, 2017, 12:19am UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/2 "2017-02-16T00:19:32Z")

</div>

@Banane9  
The problem you have here is the wall floor plan. Columns can only have two walls attached to them, or can only extend in two directions. The block that forms the point of the wall cannot connect to anything, and the block behind it can only extend in two directions, but the plan calls for three. If you remove that end block, you should fix the problem.

---

<div class="post-metadata">

**Author:** ![Kitkat\_Matt](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kitkat_matt/32/68332_2.png) [@Kitkat\_Matt](https://discourse.stonehearth.net/u/Kitkat_Matt)\
**Post date:** [February 16, 2017, 5:31am UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/3 "2017-02-16T05:31:28Z")

</div>

OR just make the point a pillar of individual blocks rather than make it a “wall” since that would ALSO work lol. i mean if he’s using nothing but walls to build this out that is in of itself going to look odd when looking at it form the side because it’ll be all corner pillars anyway so just design the diagonal part of the wall out block by block rather than by using walls to generate the shape that way you can decide what color and material it’ll be made out of.

---

<div class="post-metadata">

**Author:** ![Banane9](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/banane9/32/53172_2.png) [@Banane9](https://discourse.stonehearth.net/u/Banane9)\
**Post date:** [February 16, 2017, 2:11pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/4 "2017-02-16T14:11:18Z")

</div>

Well, duh; but obviously that doesn’t change the fact that the game shouldn’t be preventing me from undoing the wall generation or even removing the building design.

---

<div class="post-metadata">

**Author:** ![Banane9](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/banane9/32/53172_2.png) [@Banane9](https://discourse.stonehearth.net/u/Banane9)\
**Post date:** [February 16, 2017, 5:43pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/5 "2017-02-16T17:43:45Z")

</div>

And arguably the fix would be to add support for diagonal walls, where there’s only pillars at the begininning/end of the diagonal and then wall parts on the diagonal blocks between them.

---

<div class="post-metadata">

**Author:** ![Kitkat\_Matt](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kitkat_matt/32/68332_2.png) [@Kitkat\_Matt](https://discourse.stonehearth.net/u/Kitkat_Matt)\
**Post date:** [February 17, 2017, 3:45pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/6 "2017-02-17T15:45:30Z")

</div>

well there IS support for diagonal walls yours is just so narrow and small that the point is causing an issue. the point has a single block then 2 and then 3 when it SHOULD be 1, 2, and then 2 with a space between them. that 3 row is probably causing the issue for you because a single wall end can only support 1 other wall to be attached to it. there’s a limitation as someone above had already pointed out.

---

<div class="post-metadata">

**Author:** ![MoonSight](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/moonsight/32/55148_2.png) [@MoonSight](https://discourse.stonehearth.net/u/MoonSight)\
**Post date:** [February 17, 2017, 5:44pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/7 "2017-02-17T17:44:14Z")

</div>

Well the game doesn’t actually do diagonal walls, it zig-zags it, and it makes sense and, well, it’s efficient, and considering this exact problem probably existed since a few years ago when custom buildings first got available, you were the first to actually make a building that causes it in my two year or so activity in the forums

It is a bug, i won’t deny it, but i feel like it is a lower priority fix, after-all the teams has linited time and building focused development just passed a few alphas ago, so i bet we’ll have to wait until future,… pushes? Focus shifts back to building, i think this was the third run on it

For now though, well, we’ll have to live with one less block, i mean, it’s not that bad

Also, i assume you can’t remove the building either?, if so, perhaps try using console commands, click on the building plan and in the console (ctrl+c) type “Destroy” and it should get rid of it, if it doesn’t, well, we’ll need a different plan

---

<div class="post-metadata">

**Author:** ![Banane9](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/banane9/32/53172_2.png) [@Banane9](https://discourse.stonehearth.net/u/Banane9)\
**Post date:** [February 17, 2017, 9:41pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/8 "2017-02-17T21:41:25Z")

</div>

It’s all foundation blocks, your “fix” doesn’t make any sense.

---

<div class="post-metadata">

**Author:** ![Banane9](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/banane9/32/53172_2.png) [@Banane9](https://discourse.stonehearth.net/u/Banane9)\
**Post date:** [February 18, 2017, 8:07pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/9 "2017-02-18T20:07:49Z")

</div>

Removing it using the console worked, thankfully.

---

<div class="post-metadata">

**Author:** ![Sirth7](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sirth7](https://discourse.stonehearth.net/u/Sirth7)\
**Post date:** [December 2, 2016, 9:40pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/10 "2016-12-02T21:40:08Z")

</div>

I was trying to build a tower to connect the bottom/starting gound to the top of a flat mountain top, about 4 or 5 floors. The final level I wanted half walled in and the other half open to use as the path to the mountain top.

release-687 (x64)  
stonehearth/components/wall/wall\_component.lua:372: attempt to index a nil value  
stack traceback:  
[C]: ?  
stonehearth/components/wall/wall\_component.lua:372: in function 'connect\_to\_columns’  
stonehearth/services/server/build/build\_service.lua:1264: in function 'init\_fn’  
stonehearth/services/server/build/build\_service.lua:529: in function '\_create\_blueprint’  
stonehearth/services/server/build/build\_service.lua:1262: in function '\_create\_wall’  
stonehearth/services/server/build/build\_service.lua:1249: in function '\_add\_wall\_span’  
stonehearth/services/server/build/build\_service.lua:1078: in function 'visitor\_fn’  
stonehearth/lib/build\_util.lua:819: in function 'grow\_walls\_around’  
stonehearth/services/server/build/build\_service.lua:1077: in function 'grow\_walls’  
stonehearth/services/server/build/build\_service.lua:1049: in function 'cb’  
stonehearth/services/server/build/build\_service.lua:1582: in function 'do\_command’  
stonehearth/services/server/build/build\_service.lua:1048: in function \<stonehearth/services/server/build/build\_service.lua:1046\>

release-687 (x64)  
c++ exception: lua runtime error  
stack traceback:  
release-687 (x64)  
…ehearth/services/server/build/build\_undo\_manager.lua:46: assertion failed!  
stack traceback:  
[C]: ?  
[C]: in function ‘assert’  
…ehearth/services/server/build/build\_undo\_manager.lua:46: in function 'begin\_transaction’  
stonehearth/services/server/build/build\_service.lua:1579: in function 'do\_command’  
stonehearth/services/server/build/build\_service.lua:142: in function \<stonehearth/services/server/build/build\_service.lua:140\>  
release-687 (x64)  
…ehearth/services/server/build/build\_undo\_manager.lua:415: assertion failed!  
stack traceback:  
[C]: ?  
[C]: in function ‘assert’  
…ehearth/services/server/build/build\_undo\_manager.lua:415: in function 'clear’  
stonehearth/services/server/build/build\_service.lua:86: in function 'clear\_undo\_stack’  
stonehearth/services/server/build/build\_service.lua:91: in function 'set\_active’  
stonehearth/call\_handlers/build\_call\_handler.lua:19: in function \<stonehearth/call\_handlers/build\_call\_handler.lua:18\>

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [December 3, 2016, 2:13pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/11 "2016-12-03T14:13:08Z")

</div>

Welcome to the forum, @Sirth7 🙂

Could you upload the savefile where that error is happening?

---

<div class="post-metadata">

**Author:** ![Birdwing](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Birdwing](https://discourse.stonehearth.net/u/Birdwing)\
**Post date:** [December 31, 2016, 2:37pm UTC](https://discourse.stonehearth.net/t/diagonal-foundation-breaks-wall-generation/28708/12 "2016-12-31T14:37:50Z")

</div>

I had a similar problem i was designing a cathedral with 2 Towers and when trying to make 2 floorplans with walls that were touching i got an error message

release-687 (x64)  
stonehearth/components/wall/wall\_component.lua:369: attempt to index a nil value  
stack traceback:  
[C]: ?  
stonehearth/components/wall/wall\_component.lua:369: in function 'connect\_to\_columns’  
stonehearth/services/server/build/build\_service.lua:1264: in function 'init\_fn’  
stonehearth/services/server/build/build\_service.lua:529: in function '\_create\_blueprint’  
stonehearth/services/server/build/build\_service.lua:1262: in function '\_create\_wall’  
stonehearth/services/server/build/build\_service.lua:1249: in function '\_add\_wall\_span’  
stonehearth/services/server/build/build\_service.lua:1078: in function 'visitor\_fn’  
stonehearth/lib/build\_util.lua:819: in function 'grow\_walls\_around’  
stonehearth/services/server/build/build\_service.lua:1077: in function 'grow\_walls’  
stonehearth/services/server/build/build\_service.lua:1049: in function 'cb’  
stonehearth/services/server/build/build\_service.lua:1582: in function 'do\_command’  
stonehearth/services/server/build/build\_service.lua:1048: in function \<stonehearth/services/server/build/build\_service.lua:1046\> **strong text**
