Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Tuesday, November 22, 2011

GameMaker - INI without an *.ini

So, say, you would like to load data from INI without creating an *.ini file somewhere.
There can be many reasons for doing so, be that security, performance, or simple fact of INI contents being defined inside of game's code.

There are two things to do about it - deciding on presentation of data, and creating a algorithm to load it. Presentation of data is relatively simple with INI - file is split into named sections, which contain named values. Since both use string index, using ds_map (sections) with other ds_map's inside (values) seems like an approriate choice. Below is my implementation.