PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

XML in EDGE?

Is it possible to use xml files in EDGE? or must i use structs? because i wanted to set the position of each enemy at each level and i don't want to hardcode them on my code.
You can use structures to save your game data and read/write them to and from files using ClassEFile.

For the upcoming Edge 2.50 release, a new class will be added to read and write ini-type files.
okay, so can i write down the config file for ClassEFile using any text editor? or are there samples that using ClassEFile?
You can read and write files in a binary format. For example, if you have a structure named GAMECONFIG, you can write it with:
ClassEFile::Write(&gameconfig;, sizeof(GAMECONFIG))

Samples on how to use the file class can be found in the Samples folder of the Edge SDK. I suggest looking at the FileDemo sample for basic ClassEFile operations, and Blastar on how to manage a config file.
so basically it must be saved with the .cfg extension? or can i use .txt or custom extension like .stg?
It doesn't matter with which extension you save your file, although it is recommended to pick an extension which represents the type of your file.

When using your own extension, try to create an extension which isn't widely used (you can also use .dat or .bin as an extension, which are commonly used for all type of data files). However, the extension doesn't change the data within the file, only which program starts it when double clicking on it in Windows.