[Solved][0.15.5] LuaEntity doesn't contain key x

Place to get help with not working mods / modding interface.
User avatar
Fumelfo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Jan 31, 2017 11:53 am
Contact:

[Solved][0.15.5] LuaEntity doesn't contain key x

Post by Fumelfo »

Hi !
This is my first post, and please don't be rude if there's already a post on the topic, but I did some research with no result.

Let me show you a simple picture describing my problem :
Image

!!! I get an error on lines 10 and 11 if the previous ones are commented !!! Is this some bug with player_armor ?

The code used is the one from https://wiki.factorio.com/User:Gangsir/moddingTutorial . I'm a bit angry (at myself/ at code ?) because I looked over the API and found no reason for my code not to work.
Any body has suggestion ? (Ps : I get the same error without checking for character, but Apparently, defines.inventory can be nil if the player has no character, but that shouldn't be an issue for a simple item mod)

Thank you for your help !
Fumelgo
Last edited by Fumelfo on Mon May 01, 2017 5:30 pm, edited 1 time in total.
User avatar
Fumelfo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Jan 31, 2017 11:53 am
Contact:

Re: [0.15.5] LuaEntity doesn't contain key x

Post by Fumelfo »

Ok, so I must have had a different error at the beginning, but this time, the error is : print is not defined for player.get_inventory(defines.inventory.player_armor). I used a little tostring() and it was printed (function pos in ram), and mod loads fine with base code from tutorial.
Can't remember initial error wich made me try to print it. Anyways, case closed. That was strange. Guess it's a kind of "reboot computer and strangely it works".

I hate why it doesn't work and I don't know why.
I hate it also when it works and I don't know why.

Have a good day.
Post Reply

Return to “Modding help”