I am using dataSaver module and in dataSaver.lua there is require "json". I installed the plugin JSON and still getting such error "attempt to call a nil value" dataSaver.lua on line2 where is require "json"
you can convert the module to a class quite easily, someone should post it here or on the wiki actually. (i have a further modification, so that would not be that good for sharing)
hi definisto, as far as remember when you are using external lua modules like dataSaver, you should mark 'exclude from execution' in gideros studio. Because on run every lua file is merged into one main.lua file which datasaver.lua shouldn't be merged into. please try it, hence i am not using gideros for so long just my memory reminds me of such an error when i read your post. hope it will help.
hi definisto, as far as remember when you are using external lua modules like dataSaver, you should mark 'exclude from execution' in gideros studio. Because on run every lua file is merged into one main.lua file which datasaver.lua shouldn't be merged into. please try it, hence i am not using gideros for so long just my memory reminds me of such an error when i read your post. hope it will help.
when i've did this i'm getting such error
attempt to index nil with 'saveValue'
I think it because when i exclude dataSaver.lua from execution, in main.lua file dataSaver.saveFile command can't be recognized
in your code maybe you are trying to insert a null value to your json? If this is the case can you do it like this; -Use Json.Null() to insert a null value into a Json object
in your code maybe you are trying to insert a null value to your json? If this is the case can you do it like this; -Use Json.Null() to insert a null value into a Json object
This is from json.lua file in github.
No, the problem was in dataSaver.lua in this line
module("dataSaver", package.seeall)
I replaced it with
function DataSaver.init()end
and renamed the functions in dataSaver.lua and everything is now working
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
you should mark 'exclude from execution' in gideros studio. Because on run every lua file is merged into one main.lua file which datasaver.lua shouldn't be merged into.
please try it, hence i am not using gideros for so long just my memory reminds me of such an error when i read your post.
hope it will help.
I think it because when i exclude dataSaver.lua from execution, in main.lua file dataSaver.saveFile command can't be recognized
replace
Likes: definisto
Fragmenter - animated loop machine and IKONOMIKON - the memory game
If this is the case can you do it like this;
-Use Json.Null() to insert a null value into a Json object
This is from json.lua file in github.
https://github.com/ar2rsawseen/Json/blob/master/json.lua
Likes: MoKaLux, talis