Originally Posted by Resike
|
That's just a standard copyTable function that preserves the initial 'default' table.
My 'GetValue' and 'SetValue' would only affect a single value within the main table with all the various values.
You'd get to the single value within the main table with a small index table in the example.
My only issue is setting that value with an index table without having to do something less 'clean' in my eyes like this:
Lua Code:
local function SetValue(t,val)
if type(t) == "table" then
local a,b,c = t[1],t[2],t[3]
if c then
example[a][b][c] = val
elseif b then
example[a][b] = val
elseif a then
example[a] = val
end
else
example[t] = val
end
end