• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to import excel data or create database easily for RPG game?

K

krugen

Guest
What happens when a game requires massive data base for player's and NPC's stats?
What I think initially is that I have to do the following manually by hand:

data_table[row, column] = 90

for all entries.

Isn't that crazy?
 
D

Danei

Guest
JSON!

Lists within lists. Maps within maps. Lists within maps. Maps within lists within lists within maps. It's structures all the way down!

If JSON was a human being I would ask them to marry me.
 
K

krugen

Guest
JSON!

Lists within lists. Maps within maps. Lists within maps. Maps within lists within lists within maps. It's structures all the way down!

If JSON was a human being I would ask them to marry me.
So does this mean I have to code each entry manually? No simple way to import an excel table or such?
 
K

krugen

Guest
JSON!

Lists within lists. Maps within maps. Lists within maps. Maps within lists within lists within maps. It's structures all the way down!

If JSON was a human being I would ask them to marry me.
I dunno anything about jason. Are u saying Json is what I need?
 
D

Danei

Guest
I don't know for sure but I bet there are tools for outputting or converting excel files to JSON format, and if so, you can then import the JSON to gamemaker with some coding. Importing JSON itself isn't quite as simple as one might wish it to be, but it's not really complex either.

JSON is a way of structuring strings and values in maps and lists, and GMS has functions to import and encode it. It's useful for organizing and accessing large sums of game data. Or at least I sure find it useful.
 
Excel is easy, just export it as a .csv file (comma separated value file) and then write a string parsing script that takes the csv file and parses the string into chunks using the comma as a separator and stores each chunk into the corresponding row/column in a ds_grid. Doing it manually is absolutely not required.
 

Tony Brice

Member
I've used load_csv before and it does work but the important thing to remember is to use the real() command when you load in a number from the data. I found numeric comparisons were not working with them otherwise.
 
Top