Hello, I was looking for a correct (and now functional way) to read data from a file, I use to work with a plugin I do not remember the name, but it was something like ExcelReaderFactory or something like that, My idea was to create a little “database” on a xls/xlsx file, read it, ask for an ID and depending on the Language selected it would return it, at the moment it works perfectly but only in the editor, after building it, at the moment I use the data I read from the file it marks a Null error, so I was looking if there is a better way (and that actually work on a build project) to read the data ( I pick Excel because is easy for the artist and other people working on the game to modify a sentence)
I generally use CSV for this. For a parser I just googled “C# CSV parser” and grabbed the most promising link off the first page of search results. Works a treat.
everyone say the same, ok I would try it
But it is also easy for the non-code related people, easy to use? (some people are just scared of even plain text)
Yes, that’s why we use CSV. You can open and edit it in Excel or pretty much any other spreadsheet app (or, in an CSV editor, of which there are many).
The resx file format is another option. It’s supported by .Net, and there are many visual editors out there (here’s one, here’s another)
Pick your poison.
And it would work if I want to deploy the game on Xbox and Mac?
The same question, it would work on Xbox and Mac? It is now my biggest doubt
I’m not sure why it’d matter. Csv and resx are text files, and it’d be a huge failing in the parser if it wasn’t platform agnostic. In fact, resx is basically a glorified XML file. The resx format has also been supported since .Net 1.1.
That said, I haven’t personally tried building for the Mac or Xbox myself.
Same for CSV — it’s just a text file. It’ll work on any platform.
Well, at the end, I use the Json, there is more documentation that with the CSV and the .resx (also all I found about .resx where closed topics and no working sites)