Writting :
Code: Select all
data.raw["foo"]["bar"].subgroup = "baz"
data.raw["foo"]["bar"].subgroup = "qux"
Something like
Code: Select all
modify = function(dataType, name, subgroup, order)
data.raw[dataType][name].subgroup = subgroup
data.raw[dataType][name].subgroup = order
end
modify("foo", "bar", "baz", "qux")
The function in itself seems to work, but when a enter an incorrect value, for exemple : modify("itemINCORRECTVALUE", "land-mine", "weapons-capsule", "a"), the error I get on load is
How can get the error message to display where is the error ? In this case i'd like to have isattempt to index field '?' (a nil value)
attempt to index field 'itemINCORRECTVALUE' (a nil value)