Page 1 of 1

Error when placing coins in smart check on "tight spot"

Posted: Fri Apr 15, 2016 7:58 pm
by FurbyFubar
Placing a stack of coins in the smart chest on the campaign mission "Tight Spot" and pressing "Start" to run the factory gives the following error message:

"Error while running the event handler:
...ta/Roaming/Factorio/temp/currently-playering/tightspot.lua:196: Item stack count has to be a positive number."

The game is then exited to main menu without saving.

Save file where you should just have to press start to replicate the bug: https://www.dropbox.com/s/uk6qhli3nomtr ... e.zip?dl=0

In case it somehow matters: I'm running the game through Steam on Windows 10.

Re: Error when placing coins in smart check on "tight spot"

Posted: Fri Apr 15, 2016 8:42 pm
by daniel34
This seems to be a generic issue where LuaEntity.remove_item(items) gives an error when the count is 0.
Can also be produced in freeplay:

Code: Select all

/c game.local_player.remove_item{name = "iron-plate", count = 0}
Cannot execute command. Error: [string "game.local_player.remove_item{name = "iron-pl..."]:1: Item stack count has to a be positive number
(also note the has to a be positive number in the message, grammatical error)

I think this should do nothing with a count of 0 (instead of throwing an error), but return an error when the count is negative.

"Tight Spot" Campaign error when all Money is used

Posted: Mon Apr 18, 2016 10:05 pm
by NitrousWolf
This is the same console error observed by thisviewtopic.php?f=7&t=23731&hilit=tight+spot but with more serious repercussion since it can arise from just regular play trying to complete the level

I managed to get so close finishing on level 3 of the Tight Spot Campaign but I ran out of money. I spent the last 35 coins exactly on a smart inserter then moved a lot of the factory around a bit and hit Start to test it. But lo an error kills the level and returns me to the main menu.

Version:
0.12.29 (Build 17931, win64, steam)

Repro steps:
1. Begin any of the Tight Spot Campain levels
2. Open the marketplace to buy things
3. Spend every last bit of money you have. (e.g. Shift+leftClick the burner drill)
4. Press the Start button

Result:
an error message appears, which will return the user to the main menu when confirmed
"
Notice
Error while running the event handler:
..ta/Roaming/Factorio/temp/currently-playing/tightpost.lua:196: Item stack count has to be positive number
"

Expected Result:
Completion of level should be possible with zero money remaining

Re: "Tight Spot" Campaign error when all Money is used

Posted: Mon Apr 18, 2016 10:24 pm
by Loewchen
viewtopic.php?f=7&t=23731
As this post is more detailed, a mod might want to fuse them.

Re: Error when placing coins in smart check on "tight spot"

Posted: Tue Apr 19, 2016 5:20 am
by Koub
[Koub] Topics merged

Re: Error when placing coins in smart check on "tight spot"

Posted: Thu Apr 21, 2016 4:24 pm
by Klonan
Thanks for the report

Can confirm it and reproduce it
(I might even fix this myself)