getTileObj() makes runtime error (attempt to perform arithmetic on local 'arg1')

Hey,

This line of code (810):

local tileimage = G.mte.getTileObj({locX = G.player.sprite.locX, locY = G.player.sprite.locY, layer = G.player.sprite.layer - 1})

… brings up this error:

Runtime error

…/MTE/mte.lua:845: attempt to perform arithmetic on local ‘arg1’ (a table value)

stack traceback:

    [C]: ?

    …/MTE/mte.lua:845: in function ‘convert’

    …/MTE/mte.lua:2797: in function ‘getTileObj’

    …/main.lua:810: in function ‘entersNewTile’

    …/main.lua:837: in function <…/main.lua:831>

    ?: in function <?:218>

I’m trying to get the tile’s information like image used. 

Hello steve67,

The correct syntax for getTileObj is getTileObj(locX, locY, layer). It does not take a table. So you would call G.mte.getTileObj(G.player.sprite.locX, G.player.sprite.locY, G.player.sprite.layer - 1). 

Thanks Dyson. 

Hello steve67,

The correct syntax for getTileObj is getTileObj(locX, locY, layer). It does not take a table. So you would call G.mte.getTileObj(G.player.sprite.locX, G.player.sprite.locY, G.player.sprite.layer - 1). 

Thanks Dyson.