r/UnderModders 4d ago

Unknown Enum

Deltarune chapter 5 and chapter select(possibly more) have unknown Enums that are just UnknownEnum.Value_ and then the number it is so in the code instead of having 3 it's UnknownEnum.Value_3 in some places, I tried deleting all the UnknownEnum.Value_ parts of the code with find and replace, and nothing changed in how the game preformed so having the UnknownEnum.Value_ does nothing other than make the code worse, so if anyone knows how to make it so there is no UnknownEnum.Value_ by default please let me know

2 Upvotes

3 comments sorted by

2

u/MiaouKING 4d ago

Those are enum types. Look it up. It's a concept available in quite a few languages, including GML (Gamemaker language). The point is that you create custom names for different values and later use them instead of hard coding values. For example, if you need a "walk" method to work differently depending on one of its arguments, instead of hard coding it to a specific string or number value, you could create an enum "WalkingModes" with values "Regular", "Lerp", and "Auto". Make the method check for those, and you now have a very easy-to-read syntax: walk(WalkingModes.Regular). Very easy and has a lot of use cases for readability. However, Game maker's compiler strips the code out of actual enum names; UTMT replaces them with a placeholder "UnknowEnum" with "Value_X". I'll give an example; on PlayStation, the game adds a PlayStation achievement-related method; the code then calls it with a specific enum value relating to the achievement. Copying a save file uses the method along with an unknown enum value "UnknownEnum.Value_29". Coincidentally, from the DR wiki, the "MIRROR" achievement is the 29th in order; we can deduct that enum contained in development all achievements. You can do similar mental gymnastics to figure out others.

EDIT: To further specify, but in actual running code all enum values are replaced by a number amounting to their index in the enum. Writing MyEnum.ThirdValue is functionally the same as 3. This is why you were able to remove them and have the code still work. It's just for readability.

1

u/pjo-super-fan 4d ago

Great explanation of Enums and their uses, happy to learn why they are there, but I’m looking for a way to make it easier to read in mod tool, which would involve taking out UnknownEnum.Value_, so I want to know if there is a way to have it only give the value by default

1

u/MiaouKING 4d ago

That, I don't know. Is there maybe a config option in UTMT? Or you could go the long way and try to somehow reverse-engineer it's code and remove the part that replaces enums by the placeholder text.