Page 1 of 1

LuaEntity API error

Posted: Tue May 19, 2015 11:56 pm
by Turtle
Hi all,

I've been using the Russian Logistics mod and it's been fine until recently. I'm randomly getting this error:

Code: Select all

Error while running the event handler:
__RussianLogistics__/control.lua:105: LuaEntity API call when LuaEntity was invalid.
Line: 105

Code: Select all

game.createentity{name = "item-on-ground", position = possiblePos, stack = {name = item.stack.name, count = item.stack.count}}
I removed a lot of the stuff because I only use two belts so I thought it was something I did. I put back the unchanged version and I'm still getting this error. Let me know if you need to see the whole function. Any help would be greatly appreciated!

Re: LuaEntity API error

Posted: Wed May 20, 2015 12:08 am
by L0771
https://forums.factorio.com/forum/vie ... =14&t=7970
Links don't work.

- possiblePos is invalid.
- item.stack doesn't exists

Re: LuaEntity API error

Posted: Wed May 20, 2015 12:46 am
by Turtle
L0771 wrote:https://forums.factorio.com/forum/vie ... =14&t=7970
Links don't work.

- possiblePos is invalid.
- item.stack doesn't exists
Thanks for the reply. PossiblePos is valid:

Code: Select all

local possiblePos = game.findnoncollidingposition("item-on-ground", newPos, 0.01, 0.01)
I'll just post the whole function. The original code was game.tick, but it was taking up way too many resources so I delayed it a bit:
function