Engine error - attempt to index field ai - when selling items

After a bit of gameplay I ran into this bug attempting to sell something, seeing that the code shows the attempt, there is not much more to add other then “attempting to sell” if you need more devs, I have the save and can look into it or send it.

=============================================

release-472 (x64)
…/components/entity_forms/entity_forms_component.luac:178: attempt to index field ‘ai’ (a nil value)
stack traceback:
[C]: ?
…/components/entity_forms/entity_forms_component.luac:178: in function ‘_reconsider_entity’
…/components/entity_forms/entity_forms_component.luac:126: in function ‘_cleanup_item_placement’
…/components/entity_forms/entity_forms_component.luac:23: in function <…/components/entity_forms/entity_forms_component.luac:17>

Hey there @xnode, thanks for your first bug report!

First, do you remember what you were trying to sell (which item specifically)? Sometimes an individual item can cause issues (versus the entire trading system).

Second, have you encountered this bug again?

Third, with your save game, can you repeat the issue consistently?

Title:
Lots of Errors Popping Up

Summary:
Not sure what this is. Might be tied into some idle worker issues I’m having.

Steps to reproduce:
Honestly, I have no idea what is going on. These errors just keep coming.

Expected Results:

Actual Results:

Notes:

These error messages pop up together.

FIRST:
release-483 (x64)
…/components/entity_forms/entity_forms_component.luac:178: attempt to index field ‘ai’ (a nil value)
stack traceback:
[C]: ?
…/components/entity_forms/entity_forms_component.luac:178: in function ‘_reconsider_entity’
…/components/entity_forms/entity_forms_component.luac:126: in function ‘_cleanup_item_placement’
…/components/entity_forms/entity_forms_component.luac:23: in function <…/components/entity_forms/entity_forms_component.luac:17>

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

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

Attachments:

Versions and Mods:
No mods. Most recent version.

System Information:
Windows 7 Home Premium
Intel® Core™ i5-3570k CPU @ 3.40 GHz 3.40 GHz
8.00 GB Ram
64-bit OS

I got the same error when trying to “sell all” the first time the trader came around after starting up a new game. Never triggered the bug later in game.

Hey there @exitheone, welcome to the Discourse! Do you happen to remember what version of the game you were playing when you encountered the bug?

@jomaxro release-489 from steam

1 Like

Title:
error when selling and when hitting F5

Summary:
error when selling to a Merchant and when hitting F5

Steps to reproduce:

  1. A Merchant came, sold some beds, error pops-up
  2. or hitting F5 (not before Merchant came)

Expected Results:
No error while selling or hitting F5
Items were still sold to the Merchant
Ever time hitting F5

Actual Results:

Error1
release-489 (x64)
…/components/entity_forms/entity_forms_component.luac:178: attempt to index field ‘ai’ (a nil value)
stack traceback:
[C]: ?
…/components/entity_forms/entity_forms_component.luac:178: in function ‘_reconsider_entity’
…/components/entity_forms/entity_forms_component.luac:126: in function ‘_cleanup_item_placement’
…/components/entity_forms/entity_forms_component.luac:23: in function <…/components/entity_forms/entity_forms_component.luac:17>

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

Notes:
People are doing:
-mining at a higher place
-building a House
-hunting
Attachments:

Version Number and Mods in use:
release-489 (x64)
System Information:
Windows 10
Gigabyte motherboard and Intel Processor
Nvidia Geforce 770

Hey there @Dragonfuri, welcome to the Discourse! Thanks for the report. It looked the same as this one here, so I went ahead and merged them. Just for your information, pressing F5 resets the UI, and unless you have closed the error permanently, it will likely come up every time.

Thanks @jomaxro for merging the tickets, I had clicked the Close permanently, but when hitting F5 the error still come up every time. I have begun a new game. no issue so far selling stuff.

just additional systeminformation:
Windows 10 Pro 64-bit
Intel Core 2 Quad Q9550 @ 2.83GHz
Gigabyte Technology Co. Ltd. EP45-UD3LR (Socket 775)
4095MB NVIDIA GeForce GTX 770 (MSI)

Can confirm this error in Alpha 14, dev-2795.
index_field_ai.zip (5.6 MB)

@jomaxro
Is there anything special I need to do with the save?
I fixed on error in it that was on load, but it wasn’t the “attempt o index field ai” error.
I waited until the merchant came and then sold all my stuff. it seemed to be okay … Maybe fixing that initial error fixed the other stuff too.
Thanks
-Yang

@yang:
Certainly possible the first fix got both…in my case I actually got this error when buying items. Forgot to read the title, just saw a matching engine error. I received the error after the UI crashed from the Tooltipster’s error, it popped up when I hit F5.

Sorry
-Josh

Just got this again, but I accidentally clicked Close Permanently instead of Copy to Clipboard. Going to re-request an Are you sure? dialog!
No useful save at the moment, as the error will not appear again…will keep trying! dev-2807, by the way.