Attempt to index a nil value - in function 'convert_point_for_edge_loop'

Hello, I have just started with this game and it looks like it is going to be fun. I have many designs in my head already. That being said I am having trouble creating them. This is not due to user error or issues but a bug with placing walls that constantly pops an engine error and disallows deconstruction of the offending wall as soon as it is placed, and pops the error any time the building is being dealt with. Admitedly there is a solution, and it would require I pay more attention to my design as I go, but it is easy to make this error and it is for ease of use.

Steps to reproduce:

  1. make a building foundation
  2. add walls with the wall tool
  3. turn building mode so that walls become see through (not completely gone, just the side currently being looked at)
  4. add a free standing wall to the building
  5. place the wall on the outermost place allowed on the side you are looking at
    You should notice it allows you to place the first section of wall on the outermost floor piece. There is already a wall here, but you can’t see it at the present time.
  6. drag the other end of the wall to any available square in the building that will allow you to place it
  7. place wall
  8. Receive design destroying error.

Expected Results:
Game allows for free standing wall to breach a structural wall (2 walls are better than none, and gives more support).
Game disallows free standing wall to be placed on outermost tile and instead corrects the positioning to be on the next tile either before or after clicking to place. Resulting in the walls not overlapping by the 1 square.

Actual Results:
Game receives Engine error

There are several different solutions, and ways of working around the issue, being new and not used to the finicky nature of early access alphas (I tend to stay away from them) I have difficulty remembering this issue is occurring and it has cost me dearly (3 level tavern of … oh wait, restart).


This is the error when attempting to place a saved design with this error (in an effort to correct the issue I assumed I could save it and then delete the offending wall piece.

release-519 (x64)
stonehearth/lib/build_util.lua:708: attempt to index a nil value
stack traceback:
	[C]: ?
	stonehearth/lib/build_util.lua:708: in function 'convert_point_for_edge_loop'
	stonehearth/lib/build_util.lua:747: in function 'create_edge_loop_for_wall'
	stonehearth/lib/build_util.lua:758: in function 'create_edge_loop_for_wall'
	stonehearth/lib/build_util.lua:858: in function 'calculate_roof_shape_around_walls' in function '_compute_roof_region' in function 'fn'
	...ces/client/selection/entity_or_location_selector.lua:202: in function '_get_selected_entity'
	...ces/client/selection/entity_or_location_selector.lua:238: in function '_on_mouse_event'
	...nehearth/services/client/selection/selector_base.lua:115: in function '_mouse_cb'
	stonehearth/services/client/input/input_capture.lua:49: in function '_dispatch'
	stonehearth/services/client/input/input_service.lua:55: in function '_dispatch_input'
	stonehearth/services/client/input/input_service.lua:12: in function <stonehearth/services/client/input/input_service.lua:11>

Version Number and Mods in use:
No Mods:
Should be: Alpha 14
game says: release-519 (x64)

System Information:

AMD FX 6300
-6 cores

MSI Nvidia GTX 750Ti 2GB DDR5

16GB DDR3 Ram

Hey there @HearthLord, welcome to the Discourse!

Thanks for the very detailed report. The custom building editor is indeed finicky at this point of development, but the devs have acknowledged it is in need of some work. Hopefully your detailed findings will help them in the overhaul!

Thanks, I’m actually studying to be a programmer so I know details help. As an update I set it up for the latest branch, and now when I try to add freestanding walls before adding the roof I get an error when clicking the roof tool. Only happened a couple of times, need to test more to verify will have more on that on Tuesday most likely

1 Like