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

Can't change variable #111

Open
fractioneater opened this issue Jan 2, 2023 · 6 comments
Open

Can't change variable #111

fractioneater opened this issue Jan 2, 2023 · 6 comments

Comments

@fractioneater
Copy link

fractioneater commented Jan 2, 2023

Expected Behavior

When I set a variable to something, it should keep that value.

Actual Behavior

It only seems to be messed up in this project
Screen recording 2023-01-02 06.31.19.webm

Steps to Reproduce

Go to the project link above the video
Click "See Inside"
Go to the health sprite (column 1, row 2)
Add a _ type reporter and a set _ type to () block
Change the type variable and check if it's doing anything by clicking the reporter

Operating System and Browser

ChromeOS 108

@fractioneater
Copy link
Author

fractioneater commented Jan 2, 2023

It's fixed now, and I can't find a way to bring back the glitch.

If you're interested, this is how I fixed it:
First, I loaded the project into scratch and saved that file. I could now change the variable.
Next, I removed all uses of the variable and put them back. Everything worked again.

@GarboMuffin
Copy link
Member

GarboMuffin commented Jan 2, 2023

Can you send:

  • The broken project file, if you still have it
  • Your addon settings (addons > scroll to bottom > export)
  • I assume you are using the website, not the desktop app

if you can't attach them to github, email: contact@turbowarp.org

@fractioneater
Copy link
Author

I don't have a file, it got overwritten when I saved it in Scratch.

My addons:
Github doesn't support json (that seems odd), so I converted it to txt.
turbowarp-addons-settings.txt

And I was using the website.

@GarboMuffin
Copy link
Member

GarboMuffin commented Jan 3, 2023

I've looked at your project's JSON. It appears the "health" sprite has two different variables named "_ type" with different IDs. Lots breaks when this happens.

You will likely experience the same issue again unless you follow these steps to hopefully resolve it (make a backup first please):

  • Open the health sprite and rename the _ type variable to something like _ type 2
  • Switch to another sprite and go back
  • You should now see the variable you just renamed and another variable still named _ type
  • Swap one with the other and delete the unused one

Root cause still being investigated

@fractioneater
Copy link
Author

I had a theory that the cause was two different variables...

Thanks, the project is fixed now.

@fractioneater
Copy link
Author

fractioneater commented Jan 9, 2023

It seems this is caused by the searchable dropdowns.

If there is a local variable named _type in one sprite, I can still create a global variable with the same name in another sprite. That seems like it could be the cause of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants