UndertaleModTool icon indicating copy to clipboard operation
UndertaleModTool copied to clipboard

Auto-create intermediate variables for function arguments

Open Caritusy opened this issue 7 months ago • 4 comments

Which component should be improved?

Decompiler

Describe your feature suggestion in more detail

Nowadays the decompiler will make the that thing like:

Image

This is not be able to compile if you are using a real GMS 2 IDE. So if there could be a intermediate variables, it should be looks more appropriate.

Just like:

function test(argument0 = undefined, argument1 = undefined)
{
    var func_argument0 = argument0;
    func_argument0(argument1);
}

Caritusy avatar Jun 03 '25 21:06 Caritusy

Are you using the latest version? I think we usually have argX instead of argumentX, and besides, this should compile. Just want to clarify what you mean here - an intermediate assignment is inaccurate to the original code.

colinator27 avatar Jun 03 '25 22:06 colinator27

Are you using the latest version? I think we usually have argX instead of argumentX, and besides, this should compile. Just want to clarify what you mean here - an intermediate assignment is inaccurate to the original code.

I'm not really using the lasted UTMT, I'm using a branch of UTMT, It just follows the version of UTMT, like the decompiler version, and so on. So I guess there's the difference. I'll tried to use original UTMT later.

Caritusy avatar Jun 03 '25 23:06 Caritusy

Are you using the latest version? I think we usually have argX instead of argumentX, and besides, this should compile.

From my experience, it compiles on UTMT but not GM (something about built-in variables not being able to be called IIRC).

CST1229 avatar Jun 04 '25 04:06 CST1229

Are you using the latest version? I think we usually have argX instead of argumentX, and besides, this should compile.

From my experience, it compiles on UTMT but not GM (something about built-in variables not being able to be called IIRC).

I could say, yes. UTMT does clear the compile of that one.

idk it's the optimization of compiler or in assembly that's it, but seems like UTMT's compile rule doesn't same as GMS Runtime's.

Because of even if GMS2 IDE think that's a function, it works as a function, but you can't directly use it as a function.

There should be a bridge between that argument and calling this argument as a function.

or this only works in UTMT side.

Caritusy avatar Jun 04 '25 04:06 Caritusy