Hi all,
I am testing using .lua files vs .json files to hold settings for my apps.
I found that every time I modify a .json file locally, the changes are reflected in the app after I relaunch the player.
However for .lua files, I need to clear the temporary files (at $TMPDIR) so that the changes are reflected in the app.
It has become cumbersome.
I am not 100% affirmative that this is what happens because I have no idea how things work, but sometimes when I refresh the player the changes are not applied it seems.
So to clear any doubt, my questions would be :
- Is there a way to prevent the app from caching those *.lua files (during development)?
- Or maybe a way to clear that cache everytime the player is launched?
SIDE NOTE : By the way I think there is a mistake
in the knowledge base :
on Mac OS X (Open console and type "open $TEMP" without quotes, then navigate further): ./gideros/[YOUR APP NAME]/documents/
should be :
on Mac OS X (Open console and type "open $TMPDIR " without quotes, then navigate further): ./gideros/[YOUR APP NAME]/documents/
Comments
And about settings, there should not be such problems, with both json and lua. It's all about your settings class implementation.
Usually what I do is to save the settings in global table or class, then when settings are modified, I firstly modify this table, secondly modify the file, that way I have both table and file in constant sync and need to read from while only upon app initialization.
Look at this Settings class for example:
https://github.com/ar2rsawseen/GameTemplate/blob/master/classes/Settings.lua
Or this one:
https://github.com/atilimcetin/Settings/blob/master/settings.lua
First one uses json, second one is saving Lua tables, both function the same way I described and have no problems
But I have the feeling sometimes I had issues even with normal files (no settings implementation, just lua files that are required) that are in the resource folder...
I will make more tests.
Also it's 4am and sometimes
Likes: vitalitymobile