Save build template error

Summary:
Working on a fort and every time I open the building editor & try to save it as a template etc I get the following error:

release-859 (x64)[M]
…hearth/services/server/building/building_service.lua:113: no data for bid 1932
stack traceback:
[C]: ?
[C]: in function ‘assert’
…hearth/services/server/building/building_service.lua:113: in function ‘get_data’
stonehearth/lib/building/building_data.lua:74: in function ‘get_world_origin’
stonehearth/lib/building/building_data.lua:84: in function ‘get_world_shape’
stonehearth/components/building2/building.lua:320: in function ‘is_sunk’
stonehearth/lib/building/template_utils.lua:296: in function ‘get_template_save_data’
…hearth/services/server/building/building_service.lua:347: in function <…hearth/services/server/building/building_service.lua:344>

& another:

release-859 (x64)[M]
stonehearth/lib/building/template_utils.lua:28: table index is nil
stack traceback:
[C]: ?
stonehearth/lib/building/template_utils.lua:28: in function ‘_clean_bid’
stonehearth/lib/building/template_utils.lua:72: in function ‘BuildingData_FromJson’
stonehearth/lib/building/template_utils.lua:166: in function ‘WallData_FromJson’
stonehearth/lib/building/template_utils.lua:333: in function ‘_json_to_data’
stonehearth/lib/building/template_utils.lua:415: in function ‘load_template_as_temp’
…services/client/building/building_client_service.lua:895: in function ‘?’
…services/client/building/building_client_service.lua:948: in function <…services/client/building/building_client_service.lua:941>

This prevents me from finishing the structure, or saving it as a template. The “ib” command also fails to work.

Random (untested) theory: The game doesn’t like holes in roofing, including flat castle ones.

Steps to reproduce:

  1. Open building editor
  2. Attempt to save fortified building template

Attachments: 1528753130346.rar (5.3 MB)
Saved game for testing purposes.

Version Number and Mods in use: 0.24.0 (release 859) x64

1 Like

We’re working on it. Thanks for reporting.

Edit: Ok, this should be fixed for the next build.

1 Like

I recently came back playing the game and made some good looking buildings, but one i’ve done is not working. i saved it in my template section, but when i try to spawn it, it does not appear. instead I get this window :

release-859 (x64)
stonehearth/lib/building/template_utils.lua:28: table index is nil
stack traceback:
[C]: ?
stonehearth/lib/building/template_utils.lua:28: in function ‘_clean_bid’
stonehearth/lib/building/template_utils.lua:72: in function ‘BuildingData_FromJson’
stonehearth/lib/building/template_utils.lua:204: in function ‘RoomData_FromJson’
stonehearth/lib/building/template_utils.lua:326: in function ‘_json_to_data’
stonehearth/lib/building/template_utils.lua:415: in function ‘load_template_as_temp’
…services/client/building/building_client_service.lua:895: in function ‘?’
…services/client/building/building_client_service.lua:948: in function <…services/client/building/building_client_service.lua:941>

What should i do to ?

20180611203311_120180611203305_120180611203256_120180611203300_1

Add images

20180611203256_1
20180611203300_1
20180611203305_1
20180611203311_1

Bumping because I still can’t save the template, and get the error below when trying to.

= + =

release-862 (x64)[M]
…hearth/services/server/building/building_service.lua:113: no data for bid 1932
stack traceback:
[C]: ?
[C]: in function ‘assert’
…hearth/services/server/building/building_service.lua:113: in function ‘get_data’
stonehearth/lib/building/building_data.lua:74: in function ‘get_world_origin’
stonehearth/lib/building/building_data.lua:84: in function ‘get_world_shape’
stonehearth/components/building2/building.lua:320: in function ‘is_sunk’
stonehearth/lib/building/template_utils.lua:296: in function ‘get_template_save_data’
…hearth/services/server/building/building_service.lua:347: in function <…hearth/services/server/building/building_service.lua:344>

= + =

Build: 0.24.0 (release 862) x64 build

1529079028760.rar (5.6 MB)

1 Like

Yep, seems like only one of the errors went away.
Thanks for the savefile.

Hi, I’m getting what seems to be the same error:

release-860 (x64)[M]
...hearth/services/server/building/building_service.lua:113: no data for bid 1879
stack traceback:
	[C]: ?
	[C]: in function 'assert'
	...hearth/services/server/building/building_service.lua:113: in function 'get_data'
	stonehearth/lib/building/building_data.lua:74: in function 'get_world_origin'
	stonehearth/lib/building/building_data.lua:84: in function 'get_world_shape'
	stonehearth/components/building2/building.lua:320: in function 'is_sunk'
	stonehearth/lib/building/template_utils.lua:296: in function 'get_template_save_data'
	...hearth/services/server/building/building_service.lua:347: in function <...hearth/services/server/building/building_service.lua:344>

A similar message occurred in one of my earlier saves while I was modifying the building in a different location. I tried to see what happened when I put a pre-built template in the first location after moving my custom building and the building template wouldn’t snap into that area (similar to a bug in earlier topic that would occur after trying to build in an area that had a recently demolished building.)

I’m a new user so I can’t upload my save file here. Could you let me know where to send it?

Bumping again - same save, 0.24.0 release 868 x64:

release-868 (x64)[M] ...hearth/services/server/building/building_service.lua:126: no data for bid 1932 stack traceback: [C]: ? [C]: in function 'assert' ...hearth/services/server/building/building_service.lua:126: in function 'get_data' stonehearth/lib/building/building_data.lua:74: in function 'get_world_origin' stonehearth/lib/building/building_data.lua:84: in function 'get_world_shape' stonehearth/components/building2/building.lua:328: in function 'is_sunk' stonehearth/lib/building/template_utils.lua:300: in function 'get_template_save_data' ...hearth/services/server/building/building_service.lua:393: in function <...hearth/services/server/building/building_service.lua:390>

@denus, you should be able to upload files now.

Could you share the template that wouldn’t snap into that area?