Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'self' Throws Error "Expected token kind ProcVariable, got ProcFunction" #1133

Open
tmaster-terrarian opened this issue Dec 6, 2022 · 6 comments · May be fixed by #1683
Open

Using 'self' Throws Error "Expected token kind ProcVariable, got ProcFunction" #1133

tmaster-terrarian opened this issue Dec 6, 2022 · 6 comments · May be fixed by #1683
Labels
bug Something isn't working compiler Problems with the compiler

Comments

@tmaster-terrarian
Copy link

tmaster-terrarian commented Dec 6, 2022

Describe the bug

When using self it throws an error when it should work (I tested in actual gamemaker and it works there)
Image:
image

Reproducing steps

  1. write self.<insert any local function here>
  2. attempt to compile
  3. viola, error

Setup Details

UndertaleModTool Version: bleeding-edge c897860
OS: Windows 10
Game: Benbo Quest 2: BenboWars https://thumbtack.itch.io/benbowars

@tmaster-terrarian tmaster-terrarian added the bug Something isn't working label Dec 6, 2022
@vorechick69
Copy link

Has any workaround been found for this?

@Jacky720
Copy link
Contributor

You should be able to edit it in the disassembly bytecode. Maybe the following steps:

  1. call it as a global function (center_camera(0, x, y))
  2. Switch to Disassembly tab
  3. Change the following bytecode from
call.i center_camera(argc=3)

to

call.i @@This@@(argc=0)
push.v builtin.center_camera
callv.v 3
  1. Type "center_camera" into the tool search bar.
  2. Delete the bottom result from Functions.

@vorechick69
Copy link

Any way to do this through the CLI? Using Linux.

@Jacky720
Copy link
Contributor

Try Wine or a Windows VM if you can. It might be possible to script, but the assembler isn't as open as the compiler.
Wait, there are ExportASM and ImportASM, right? You could use those. Deleting the function should be easier to script too.

@Lionmeow
Copy link

Does the workaround still work? While this solution does make the code compile, in-game, it's just causing a "Variable not set before reading it." error.

@Jacky720
Copy link
Contributor

The only reason I could guess that happening is if you also edited the function's definition and it broke as a result. At that point I might just recommend using a user event or global script.

@XdotCore XdotCore linked a pull request Feb 17, 2024 that will close this issue
@Miepee Miepee added the compiler Problems with the compiler label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Problems with the compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants