Can i read files from lua?

Hey. Just started using nakama and i was wondering if its possible to access external files using lua? I need to store data about the tilemap to validate collisions. Is it possible? :slight_smile:

Hey @gruset welcome :wave:

Yes you can read files with the Nakama module in the Lua runtime. The function is called file_read(somepath) and can be imported into your module as part of the Nakama framework. i.e.

local nk = require('nakama')

-- somewhere in your code
nk.file_read('some/path/to/file.ext')

The path specified will always be relative to the --runtime.path directory.

Hope this helps.