• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED]A question about editing the XML (?) files of an object

I have been looking at the object files in notepad, as I wish to edit them manually.

For this part:

<event eventtype="0" enumb="0">

from what I have observed they are placed by GMS in numerical order for event eventtype, and the enumb part is not.

I switched around the order for the event type, and it did not seem to make any difference.
eventtype = 1
eventtype = 0

instead of how GMS places them

eventtype = 0
eventtype = 1
etc

When accessing the object, at least in the resource tree, it still showed everything where it should. I'm assuming because it reads the value of eventtype and gets what event it is, rather than the order of it's placement having any effect.

I can figure out how to rewrite them the same way, but am unsure if it's necessary since it didn't seem to affect them if they're not ordered by value.

It obviously isn't how GMS writes these files, so I just wondered if there is an aspect here I'm missing as to why they are placed numerically?
 
This isn't a huge problem, since I've fixed it anyway so that the event types are read in numerical order.

It's just a matter of curiosity now as to what the benefit is of doing so. But, since this hasn't had any response, I'll most likely just mark it as solved soon and be done with it.
 
H

Homunculus

Guest
There probably isn’t any reason, it is possible that it’s just the default way data is written by their xml processor, or it’s simply a way to make them a bit more easy to read by a human for debugging purposes.
 
There probably isn’t any reason, it is possible that it’s just the default way data is written by their xml processor, or it’s simply a way to make them a bit more easy to read by a human for debugging purposes.
Ah - okay. Thanks for the input. I thought it might be something to do with reading the keys in order, and that maybe it's a performance consideration at some point in the process. Since the event type and enumb part are referring to hidden engine elements: if it's looking through a database (or whatever) of the events within GMS, that it does so in a more linear fashion rather than jumping around....or something like that.

I understand now (through some trial and error) how the XML coding works, but beyond that it's not something I know anything about.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Pretty sure GMS1 sorts them by event type -> event number since editor sorts the internal state to display events in preferred order. There's no harm shuffling events in both GMS1 and GMS2
 
Top