Jump to content


Photo

room gmx file format


  • Please log in to reply
8 replies to this topic

#1 pucone

pucone

    GMC Member

  • GMC Member
  • 66 posts
  • Version:Unknown

Posted 13 October 2011 - 09:23 PM

For me, one of the most exciting aspects of GM HTML5 is how GM files are now stored as XML. I'm using Ogmo editor as a replacement for the room editor for a current project, and importing its XML output into GM. However, it seems a little unnecessary to import XML considering the rooms are saved as XML to begin with... so why not convert Ogmo's output to GM's own room format?

Looking at a simple room file, this certainly seems doable. Each tile and object instance has a 'name' attribute, though, which looks like a reference to an internal instance id ("inst_DF5BB643", for example). Obviously there is no way to generate these ids from outside GM... is this a problem? Why do these need to be stored, anyway? Aren't instance ids generated when the game is run or compiled?
  • 0

#2 paul23

paul23

    GMC Member

  • Global Moderators
  • 3357 posts
  • Version:GM8

Posted 13 October 2011 - 09:57 PM

The instance id is simply something you might wish to know when writing room-creation, or instance-creation code (not the events).. The instance DO have the same identifier in game as in the room. However they are NOT numbered or something like that. I think this also implies you can safely change the instance "id" - between some values.
  • 0

#3 pucone

pucone

    GMC Member

  • GMC Member
  • 66 posts
  • Version:Unknown

Posted 13 October 2011 - 10:05 PM

Thanks, that makes sense. What I'm worried about is what happens if I pass GM blank or duplicate instance names, though. Do we need to keep track of all instance names in the entire project in order to prevent conflicts, or does this system fail gracefully - or not matter at all if you're not using creation code for a given instance?

Edited by pucone, 13 October 2011 - 10:05 PM.

  • 0

#4 paul23

paul23

    GMC Member

  • Global Moderators
  • 3357 posts
  • Version:GM8

Posted 13 October 2011 - 10:39 PM

Thanks, that makes sense. What I'm worried about is what happens if I pass GM blank or duplicate instance names, though. Do we need to keep track of all instance names in the entire project in order to prevent conflicts, or does this system fail gracefully - or not matter at all if you're not using creation code for a given instance?

Test it out I'd say (though obviously only test in a new game specifically for testing). Somethings I discovered:

When manually editing always reopen the resource in gamemaker :P.

<instance index="0" objName="objRegex" x="224" y="160" name="inst_B137BFB8" locked="0" code=""/>
index & objName stands for the object.. However changing "index" doesn't seem to do anything (GM will change it back to the correct index on saving). Changing the name does work. Changing the name to an unexistent object will "remove" it, and the entry in the xml file has as name <undefined> (&lt;undefined&gt;)
x,y is the position in the room
name the instance "id".
locked is wether the object is locked. (Locked instances can't be deleted)
code is the creation code.
If you add an instance of object "A" to the room, and then delete object "A", the instance objName will change to "<undefined>" - however it won't be deleted from the xml file.
Making instances have the same "name" doesn't seem to crash anything.



Hmm someday someone should start on small documentation of those xml files
  • 0

#5 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 14 October 2011 - 03:27 PM

Hmm someday someone should start on small documentation of those xml files

Already on it. I've documented quite a few of the files (rooms, backgrounds and a few others) and I'm going do the larger ones soon. I'm just trying to figure out the best way to format my data.
  • 0

#6 pucone

pucone

    GMC Member

  • GMC Member
  • 66 posts
  • Version:Unknown

Posted 14 October 2011 - 07:26 PM

Already on it. I've documented quite a few of the files (rooms, backgrounds and a few others) and I'm going do the larger ones soon. I'm just trying to figure out the best way to format my data.


That's great news. The LateralGM guys must be having a field day with this stuff!
  • 0

#7 OMGCarlos

OMGCarlos

    GMC Member

  • GMC Member
  • 329 posts
  • Version:GM:HTML5

Posted 15 October 2011 - 03:19 AM

Lol seriously I figured IsmAvatar would have been all over this by now too. I'm surprised there isn't any native support for XML parsing though
  • 1

#8 Mayhem Games

Mayhem Games

    Proud Kiwi

  • GMC Member
  • 955 posts
  • Version:GM:Studio

Posted 15 October 2011 - 07:12 AM

I'm surprised there isn't any native support for XML parsing though

This...
  • 0

#9 Gamer_Dude64

Gamer_Dude64

    GM Html5 Programmer

  • GMC Member
  • 167 posts
  • Version:GM:Studio

Posted 15 October 2011 - 05:05 PM

i would really like native support too....

EDIT: check it out... .gmx file format documentation by Dark Matter. here

Edited by Gamer_Dude64, 16 October 2011 - 07:36 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users