# Templates not shown

**URL:** <https://discourse.stonehearth.net/t/templates-not-shown/28527>\
**Category:** Bug Reports\
**Tags:** ui, building, a20r701\
**Created:** [February 7, 2017, 11:07pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527 "2017-02-07T23:07:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kodi4444](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kodi4444/32/68781_2.png) [@Kodi4444](https://discourse.stonehearth.net/u/Kodi4444)\
**Post date:** [February 7, 2017, 11:07pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/1 "2017-02-07T23:07:22Z")

</div>

**Summary:**  
templates not shown and an error message.  
upon further investigation, I found that one of my templates I made was causing the problem. once I removed it from the templates folder my templates are back to normal.

release-701 (x64)  
stonehearth/lib/build\_util.lua:612: attempt to index local ‘template’ (a nil value)  
stack traceback:  
[C]: ?  
stonehearth/lib/build\_util.lua:612: in function ‘get\_custom\_templates’  
stonehearth/call\_handlers/build\_call\_handler.lua:44: in function \<stonehearth/call\_handlers/build\_call\_handler.lua:43\>

release-701 (x64)  
c++ exception: lua runtime error  
stack traceback:

**Steps to reproduce:**

1. put my template that I made in the building templates folder
2. load game attempt to build the template I made that isn’t working.
3. once you click on place a building you will get the error message.

**Expected Results:**  
templates to be there  
**Actual Results:**  
templates are not there  
**Notes:**

**Attachments:**  
[template that doesnt work.zip](https://discourse.stonehearth.net/uploads/short-url/jf2m0jV2HYYpmxdoIjqIohnrFrd.zip) (68.6 KB)

**Version Number and Mods in use:**  
R-701  
**System Information:**

---

<div class="post-metadata">

**Author:** ![8BitCrab](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/8bitcrab/32/48512_2.png) [@8BitCrab](https://discourse.stonehearth.net/u/8BitCrab)\
**Post date:** [February 12, 2017, 4:56am UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/2 "2017-02-12T04:56:22Z")

</div>

hey there @Kodi4444,

> [@Kodi4444](#):
>
> I cant figure out how to upload my building template that isn’t working

to upload the template simply go to the templates folder, put the buggy template in a `.zip` and then drag and drop that .zip into the reply box and it’ll auto-upload.

hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![Kodi4444](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kodi4444/32/68781_2.png) [@Kodi4444](https://discourse.stonehearth.net/u/Kodi4444)\
**Post date:** [February 12, 2017, 10:39pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/3 "2017-02-12T22:39:12Z")

</div>

it wont let me it says:  
Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif, txt, csv, log, obj, qmo, doc, docx, pdf, xml, evtx, qcp, qcm, qb, lua, zip, dmp, 7z, bmp, rar, mp4).

---

<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:** [February 18, 2017, 7:27pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/4 "2017-02-18T19:27:04Z")

</div>

@Kodi4444, that’s why @8BitCrab said to compress it into a .zip. Get the template json file (and the related image, which is a png file), right-click on them, click on Send To…-\>Compressed folder (zip), and then try to upload it here.

---

<div class="post-metadata">

**Author:** ![Kodi4444](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kodi4444/32/68781_2.png) [@Kodi4444](https://discourse.stonehearth.net/u/Kodi4444)\
**Post date:** [February 21, 2017, 7:03am UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/5 "2017-02-21T07:03:43Z")

</div>

I feel silly, I forgot to put it in a zip folder.

---

<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:** [February 21, 2017, 2:32pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/6 "2017-02-21T14:32:29Z")

</div>

The template json file is empty, no wonder why it’s throwing an error.  
The image looks fine, I wonder why it managed to save the image but not the data. 😕

Is the image correct, @Kodi4444? The corners without roofs, and only 3 floors?

---

<div class="post-metadata">

**Author:** ![Kodi4444](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kodi4444/32/68781_2.png) [@Kodi4444](https://discourse.stonehearth.net/u/Kodi4444)\
**Post date:** [February 22, 2017, 7:00am UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/7 "2017-02-22T07:00:30Z")

</div>

yes, the image is correct. its a modular design i am able to add more buildings on top like more beds when i need them.

---

<div class="post-metadata">

**Author:** ![Jabberwockie](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/jabberwockie/32/53925_2.png) [@Jabberwockie](https://discourse.stonehearth.net/u/Jabberwockie)\
**Post date:** [February 22, 2017, 1:09pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/8 "2017-02-22T13:09:33Z")

</div>

**Summary:**  
Tried to make a template (big one) and when I attempted to save it, it broke. When accessing build menu the error will repeat itself occasionally and templates will not save.

**Steps to reproduce:**

1. Create Template
2. 
3. 

**Expected Results:**  
Template is created  
**Actual Results:**  
Error when accessing creations  
**Notes:**

**Attachments:**

**Version Number and Mods in use:**  
release-701 (x64)  
**System Information:**  
release-701 (x64)  
stonehearth/lib/build\_util.lua:612: attempt to index local ‘template’ (a nil value)  
stack traceback:  
[C]: ?  
stonehearth/lib/build\_util.lua:612: in function 'get\_custom\_templates’  
stonehearth/call\_handlers/build\_call\_handler.lua:44: in function \<stonehearth/call\_handlers/build\_call\_handler.lua:43\>

and

release-701 (x64)  
c++ exception: lua runtime error  
stack traceback:

---

<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:** [February 22, 2017, 1:11pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/9 "2017-02-22T13:11:49Z")

</div>

I wonder if it’s an issue with really big templates. You’ll have to delete that template, @Jabberwockie, or you’ll keep getting the error. It should be inside: `C:\Program Files (x86)\Steam\steamapps\common\Stonehearth\saved_objects\stonehearth\building_templates`

(Probably the json file is empty, like in @Kodi4444’s case).

---

<div class="post-metadata">

**Author:** ![Jabberwockie](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/jabberwockie/32/53925_2.png) [@Jabberwockie](https://discourse.stonehearth.net/u/Jabberwockie)\
**Post date:** [February 22, 2017, 1:12pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/10 "2017-02-22T13:12:31Z")

</div>

will do thankies much!

---

<div class="post-metadata">

**Author:** ![Jabberwockie](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/jabberwockie/32/53925_2.png) [@Jabberwockie](https://discourse.stonehearth.net/u/Jabberwockie)\
**Post date:** [February 22, 2017, 1:37pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/11 "2017-02-22T13:37:31Z")

</div>

Am now getting this error when I put roofs on things, and the building wont go into build mode

release-701 (x64)  
…onehearth/components/building/building\_component.lua:399: attempt to index local ‘entity’ (a nil value)  
stack traceback:  
[C]: ?  
…onehearth/components/building/building\_component.lua:399: in function 'get\_building\_envelope’  
stonehearth/components/roof/roof\_component.lua:245: in function ‘clip\_overlapping\_structures’  
…onehearth/components/building/building\_component.lua:827: in function 'layout\_roof’  
stonehearth/services/server/build/build\_service.lua:1180: in function 'grow\_roof’  
stonehearth/services/server/build/build\_service.lua:1128: in function 'cb’  
stonehearth/services/server/build/build\_service.lua:1582: in function 'do\_command’  
stonehearth/services/server/build/build\_service.lua:1127: in function \<stonehearth/services/server/build/build\_service.lua:1125\>

---

<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:** [February 22, 2017, 1:59pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/12 "2017-02-22T13:59:04Z")

</div>

Upload that savefile, @Jabberwockie. Sounds like a different bug. To upload a save, locate the folder in  
`C:\Program Files (x86)\Steam\steamapps\common\Stonehearth\saved_games` (assuming a default Steam install), zip the individual save’s folder (not the entire `saved_games` folder), and upload it. If the `*.zip` is less than 10 MB, feel free to upload it directly to the Discourse. If larger, please upload it to a cloud storage site like Dropbox, Google Drive, File Dropper, etc. and post the sharing link here.

---

<div class="post-metadata">

**Author:** ![Kodi4444](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kodi4444/32/68781_2.png) [@Kodi4444](https://discourse.stonehearth.net/u/Kodi4444)\
**Post date:** [February 22, 2017, 4:37pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/13 "2017-02-22T16:37:25Z")

</div>

I was able to recreate this design and it worked. But I’m not sure if did something different this time.

---

<div class="post-metadata">

**Author:** ![Jabberwockie](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/jabberwockie/32/53925_2.png) [@Jabberwockie](https://discourse.stonehearth.net/u/Jabberwockie)\
**Post date:** [February 22, 2017, 9:47pm UTC](https://discourse.stonehearth.net/t/templates-not-shown/28527/14 "2017-02-22T21:47:42Z")

</div>

[1487770026615.rar](https://discourse.stonehearth.net/uploads/short-url/AtDxFGO7aaQ84QU1zkWwuSs2Z62.rar) (5.6 MB)

Here is the save file, the error pops right after you add a roof to the build by the fields. If you figure out where the bug is could you let me know? I’d rather not have to start all over lol. If not I understand!
