Parsing a map file

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Parsing a map file

Postby ffourcad » 19 May 2010, 14:30

Hello, I would like to parse and update a map file to add some random objects on the floor.
Is there any reference document to help me, or should reverse engineer the file format ?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 19 May 2010, 20:35

No reference documentation is available. The map format is simply JSON.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 20 May 2010, 10:02

yes, I figured it out, but the "keys" are not self-explanatory, so it's not obvious what they mean, and there are some things that are in the lib file too.
Flidode
Posts: 1
Joined: 27 Sep 2010, 09:33

Postby Flidode » 28 Sep 2010, 07:44

Up

Hi,

I try to override the loadMapData of OpenSpaceExtension to store maps in a database;

This method should be overridden by the OpenSpace Extension child class in case maps are stored in a custom way (for example a database), to load and return their data properly.


But even if i understand the return object is a String (JSon Map data) like the content of *.map files generated by OpenSpace Editor, i dont understand how to generate my own return object.

Is there any explanations somehere on how to generate JSON like valid map data ?

Edit: An explanation for keys and associated data
User avatar
svizzari
Posts: 64
Joined: 18 Jun 2010, 11:55

Postby svizzari » 28 Sep 2010, 22:18

Easiest way to work out the meaning of the JSON keys / attributes is just to create a test map in the editor and then cross-reference the JSON with any items you put on the map.

Like Bax says, no documentation, this goes beyond the standard way of working with OS, but, isn't that hard to work out.

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 61 guests