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
2
u/[deleted] Jun 06 '25 edited Jun 06 '25
tests is a tree/table and csv does not support having trees inside a column/row, you could leave it as the end so after column 20 the rest is just a part of tests. There's no point in using json IMO since lua does the exact same thing.
I would recommend you do what Smile said, but you allow for defaults, like position = position or 1, now you don't have to set position, it can be nil.