When I call self.x to reference a property in init it works just find, but in get_story it returns an error. When I reference story in get_story it returns and empty string, but returns what I assign to it when I reference it in the init function.
go.property("x", 0)
go.property("y", 0)
local story
function get_story(self)
print(self.x)
return story
end
function init(self)
local f = io.open(sys.get_save_file("laser", "grid_data"), "r")
local dataS = f:read("*a")
local data = json.decode(dataS)
--print(dataS)
f:close()
print(self.x, self.y)
story = data[self.x][self.y]
print(story)
end