lua - Save and access multidimensional arrays -


i'm working multidimensional arrays users settings.

i create them follows:

mygamesettings = {} mygamesettings["core"] = {}  mygamesettings["core"].soundon="sound^true^onof" mygamesettings["core"].musicon="music^true^onof" 

than when user change setting "widget.newswitch" want change value accordingly. problem is, when try save value creates new multidimensional array instead of changing existing one. can confirm print values correct

print("setting: " .. "mygamesettings" .. "[" .. type .."]" .. "." .. setting) mygamesettings[type].setting=tostring(switch.ison) 

print console setting: mygamesettings[core].musicon

try

mygamesettings[type][setting]=tostring(switch.ison) 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -