UnderminersTeam / UndertaleModTool

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

Decompiler sometimes replace values with numbers #996

Closed Romualdo666 closed 2 years ago

Romualdo666 commented 2 years ago

Describe the bug

I don't know when, but sometimes the Decompiler replace a value like "true" with 1, and "false" with 0, for example, and it applies to all code, so it makes programing a bit annoying.

Reproducing steps

for example: original code: color = c_white change_color = false global.darkzone = false

Modified / buged code: color = 16777215 change_color = 0 global.darkzone = 1

Setup Details

I'm using the Bleeding edge of UndertaleModTool, but this happened to my in another versions. I'm using Windows 11. I'm modifying Deltarune chapter 1 & 2, but at chapter 1 happens the same.

Grossley commented 2 years ago

This issue is invalid because "true" actually is 1 internally and "false" is actually 0. Therefore, nothing is actually changed.

Romualdo666 commented 2 years ago

yeah but, there's no way to see it like "true", or "c_white"?

Miepee commented 2 years ago

Internally, due to how GameMaker works, not really. You can enable profile mode as a workaround, that should probably fit your needs a little.

Jacky720 commented 2 years ago

I feel like 16777215 is a sufficiently unique number that we could try to resolve it more often, but the current resolver is based on variable names and I'm not even sure it can access the value to check.

Romualdo666 commented 2 years ago

Internally, due to how GameMaker works, not really. You can enable profile mode as a workaround, that should probably fit your needs a little.

Uhh, what excatly does "Profile mode"?

Miepee commented 2 years ago

Basically, whenever you open a code file, the window shows you what you have written last, instead of decompiling the current code. It's neat for example if you want to have comments, as usually, those comments would get discarded when compiling. By having profile mode enabled you can keep your comments on-disk

Romualdo666 commented 2 years ago

oh I just realized it doesn't work with Deltarune Ch 1&2. Anyway thanks!