I am brainstorming an easy and flexible way to store item stats in my game.
I would like to do something preferably, as easy as item.<item>.function() in my code so that coding new items (and adding more through mods) is as easy as setting a few parameters, and then writing a basic function to run every frame
However, due to this, I really don't want to type out
items = {
item1 = {
name = "example",
model = "model",
function = function()
{ .... }
},
etc. etc.
Is there an easier or more concise way to do this? EVERY item needs the exact same parameters so typing it out manually every time would get extremely tedious.
Or even a DS Grid to store items instead? But how would I access the functions, then?
Due to wanting mod-ability to be a big part of the game, storing functions inside of the item data is a big deal, I don't just want pointers to a bunch of functions I write elsewhere, unless that's the best / my only option.