loading a CSV spreadsheet- reading string or value from it

This is already available in construct2 and it is absolutely excellent for story driven and rpg type games that need a database. So let me explain why csv files are excellent:
c2rexplugins.weebly.com/rex_csv.html
scirra.com/tutorials/833/mo … dialog-mod

A csv file is basicly a spreadsheet

  • You can make/edit them in google docs - as a spreadsheet
    -coordinate of a cell is called via the string value of a column and a row- so your table can be in any easy to read order you like.3

-Loading such file into your game at the start of frame, then use cells from it -

-to write them to a text file at the right time - for dialogue in a story driven game

-to use for your game’s stats - super useful for games with a lot of stats- jrpg type games

Other useful things:
-You can keep all of your game’s story on that file and have multiple people work on it at google docs
-Even better, while developing you can have the engine fetch the latest version of the file straight from google drive or dropbox.

  • It makes it easy to translate the game to different languages
  • Story writers and translators dont have to install gdevelop.
  • It is easy to correct dialogue typos without having to update the game build or open the engine. It makes a world of difference…
  • Makes it easy to keep track of stats of your game - have one place where you can tweak them easily and have a good look of a lot of them laid nicely together

maybe later on even make a small csv editor :smiley:

I am getting ahead of myself here

At first glance, seems “stilted”, you need an external software, a new format, not so cool :frowning:
But I think that an extra way to edit structures would be nice, of course this kind of dition would be possible only for bidimensional structures at first (the main childs of the selected structure, and sub-childs) :slight_smile:

This way, you could continue using built-in functions (just variable access), instead CSV.At(“Monk”, “Def”): MyStruct[“Monk”]["Def]

I think CSV files support having multiple tables within a file. So it is actually a three dimentional data structure, with the 3rd dimention being the table name.

Yes, will depend on an external file editor. CSV files however are really easy to edit- you can use google docs, libre office (open source and multiplatform like gdevelop) and even a normal text editor (wouldnt be as comfortable though).

Maybe in a future release gdevelop could have its own editor for csv resource files, but one shouldnt worry too much about that. If it had a simple implementation to load CSV files as a resources that I can edit externally (the way c2 does)- that would be enough for me to use it.

Again their advatages are:

  • Easy to read and understand - keep track of your game’s stats
  • Can be opened externally and edited without having to update the entire game - this is actually a big big advantage

I dont know if it’s relevant, but multimedia fusion lacked this feature, so I implemented it by using their string tokenizer, text box and list objects:

clickstore.clickteam.com/index.p … uct_id=300

:unamused:
Not sure if this can be achieved in gdevelop yet, as it doesnt seem to have a way to parse strings from a text file to a table, search for a string in a list or even do a fastloop.
It would be achieved in a very very different way I would imagine.

The biggest missing feature for me is fastloops/functions. I use fastloops all the time! Without fastloops I wouldnt have been able to implement an automated load/save to array system:
clickstore.clickteam.com/easy-load-save-system

fastloops/functions are an important tool of programming. They should not only be available for html5 games, but should also be by default a part of your toolbox- not just an add on to enable.

Because of how many different features clickteam fusion has, if something is missing - you can script it visually yourself. Gdevelop on the other hand is still requiring you to know java script in some instances.

adding even more to my CSV rant:

This comes from the need to implement a story/npc dialogue system.
Comparing a CSV to an XML or a JSON file:

Why csv tables? They require the least amount of typing for telling the engine when to use what avatar , sound effect and show text. Instead of typing over and over again “avatar=john” for each line john says - you just simply have a column called avatar and you type John in the cells that correspond to the ID of the dialogue line that is running.
It is the most convenient way so far. Less typing than jason for this sort of job.
The csv file is a simple text file with the abilities of a spreadsheet - it can contain the data of multiple tables - so it is sort of like a 3d array in a text file with the ability to get to cells by calling them via their row/column names- that opens the opportunity for some very cool scripting that arrays can not do. It is awesome!

Hey! Don’t be fooled by this “fast loop” name!
“Fastloop” is nothing more than a While event that GD support for ages!! :slight_smile:

I know that you can be missing some features from other softwares but please please, pleeaaase, really do some research about what extensions are really doing because it’s super sad for me to see that users seems to be lacking features while these features already exists in GD… And are named properly like everyone does in the computer/programming world :smiley:

For CVS, recall that JSON is very handy:

[ { a:"John", line:"Hello!" }, { a:"William", line:"Hi John!" }, //... ]

You should really consider JSON if you can instead of CSV. :slight_smile: For two characters (a and : here), it’s really not difficult to type and copy/paste is here to help you :wink:
I understand that CSV can be handy for your particular case, but I don’t see much demand for this particular file type… Or you could write a CSV “parser” with actions/conditions to read a raw file. It would not be diffuclt and the actions/conditions could be used for other usages.

Well, the beauty of csv is that you dont have to open and close brackets and dont need to put quotes everywhere. :smiley:
You dont have to repeatedly write the operators such as - “a” and “line”. It saves up a lot of writing and reduces the chance of human syntax error.

Its not the same as json or xml. it is obviously more convenient.

I made a CSV parser for multimedia fusion. Not sure if I can do it with gdevelop, as its got different tools.

There are quite a few CSV parser made in java on the web, but I have no idea how to implement with gdevelop.
opencsv.sourceforge.net/

code.google.com/p/opencsv/
commons.apache.org/proper/commo … arser.html

code.google.com/p/jcsv/
google.bg/webhp?sourceid=ch … va&es_th=1

Ok, how about exporting a sppreadsheet in the form of an XML file from gnumeric or open office ? Gdevelop’s valriable access syntax is not compatible with the way values are saved in the table there!

I filed a feature request here:
viewtopic.php?f=22&t=6430

since gdevelop is not accessing values the same way as other software does.