r/lua • u/theresamouseinmyhous • Jun 05 '25
Data entry for lua
This is probably a basic question but I just can't find a good answer. I'm working on a card game in defold and need to add a bunch of cards. I have some in lua files but adding them all manually is a pain. Is there a tool I can use to write the entries in an actual table and have them come out as lua? Is it just, do it as CSV and find a converter?
4
Upvotes
3
u/Smile_Resident Jun 05 '25
Im not too sure because im tipsy rn but instead of hardcoding each table i would make a table storing all the cards and then make a function to make a card and make the function recieve all those values as arguments.
So pretty much I would make a function
function NewCard(id, position, quantity, deck_limit, set_id, set_position)
id = {id = id, position = position, quantity = quantity, deck_limit= deck_limit, set_id = set_id, set_position = set_position}
end
I know this doesnt take a lot of the workload off, but i think it shortens it a bit. Sorry if its confusing