In these 3 games, basically obby blocks are consisted of quiz boards so that players can learn about math.
Now I am developing an ESL game in which players can learn about English grammar.
And I am developing a quiz board set now.
For math game, making quiz boards were not so hard because targets are numbers
and I could use random() to generate questions and answers automatically.
However, for English grammar, it looks more complicated.
So I want to prepare Excel file like below:
If I can import this kind of Excel files into Roblox Studio and prepare the matrix data,
I think it would be much easier to make the new game.
If it is impossible to import Excel data, is it possible to import Python data?
(Because I can convert Excel file to Python file with pandas.)
And so I will appreciate if you guys give me any advice or idea.
One reason I want to use Excel is for data management
because these questions and answers may be changed often.
I want to use cell reference and only change Excel file if possible.
Another reason I want to use Excel is for players including teachers and parents.
In the future I want they make question and answer set by themselves and so
the handling should be easy and simple, and I believe many of them are familiar with Excel.
There’s plenty of libraries to convert csv files to json data. One of those is literally called csv to json. So figure out how to use it from there, once you got your setup done just stringify that json array and set it as a response header in a node server (javascript). Then setup that server either on your localhost if this is a one time thing or use heroku to set it up and use http service to get the data from that
A way I would approach is send a request from studio to a python webserver or something , where you use pandas to read the csv file and convert it to json and return it , with the returned json you can assign create the Excel frame easily since its key-value based.
Before you start setting up a server and everything, consider if it’s acceptable for you to just copy/paste some text from a file into a ModuleScript whenever you make a change. You can just open any CSV file in notepad and copy/paste the text into Studio. You can then parse the CSV into a table like so:
local csv =
[[
1,I ( ) you.,love,loves,loved,will love
2,He ( ) pork.,hate,hates,hated,will hate
3,She ( ) beef.,eats,eat,ate,will eat
]]
local linePattern = "[^\r\n]+"
local csWordPattern = "[^,]+"
function parseCsv(csv)
local rows = {}
for line in string.gmatch(csv, linePattern) do
local row = {}
for word in string.gmatch(line,csWordPattern) do
table.insert(row, word)
end
table.insert(rows, row)
end
return rows
end
local sheet = parseCsv(csv)
print(sheet[3][2]) --prints 'She ( ) beef.'
It really depends on whether the data is static (will it have to change) or not. Importing the data using HTTP requests as @Razor_IB mentioned is probably the cleanest way, since you can easily make adjustments in Google Sheets for example.
Well, I think my data for this game is static, although maybe I need to change the data sometimes.
Google Sheet is another good idea though, which may be useful for other games.