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?
Hey @gruset welcome
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.
1 Like