UnderminersTeam / UndertaleModTool

The most complete tool for modding, decompiling and unpacking Undertale (and other GameMaker games!)
GNU General Public License v3.0
1.18k stars 226 forks source link

Resolve references to room instances in room creation code #560

Open krzys-h opened 3 years ago

krzys-h commented 3 years ago

After fixing #559, the room creation code decompiles somewhat properly to:

endY = 102304.y
jumpToRide = 102304

Which references this object in the room: image It would probably be beneficial to link them together somehow in a more user-friendly way. I believe normally in GMS the instances can have names which get lost during build, perhaps we should just autogenerate one?

Implementing this is going to be non-trivial since the decompilation process has absolutely no way to get a reference to the room (but i think the instance IDs were globally unique?)

colinator27 commented 4 months ago

As an update, the latest GM versions have a special type in the bytecode for these IDs, making them easy to detect. Same issue with old versions, though, even on the new decompiler (which properly puts the number in parentheses). However, the compiler has a bug that subtracts 100000 from the ID.