ScratchData LogoScratchData
Back to nembence's profile

Set variable by name (hacked blocks)

NEnembence•Created March 15, 2025
Set variable by name (hacked blocks)
37
28
418 views
View on Scratch

Instructions

Choose one of the variables or create a new one, and enter its name in the text box - or - Enter the name of a new variable, then see inside and look at the "hacked" sprite's variables

Description

Thanks to @Geotale for the variable references idea: https://scratch.mit.edu/projects/1068153464/ -- I've found strange things involving the "BROADCAST_OPTION" input ID in Scratch's source code. As it turns out, Scratch treats broadcasts as special variables, and it generates variable references every time the [broadcast (message v)] block runs. I've managed to trick Scratch into generating variable references for a custom block. References can be used then to access variables. Sadly the generated references don't allow showing/hiding variables Also, when it's used for making a new variable, all generated references get remapped to the same hidden variable, effectively breaking them. Because of these, it's better to use normal (not hacked) blocks or hardcoded variable references. The problems are caused by the "id" in the generated reference always being null

Project Details

Project ID1147733462
CreatedMarch 15, 2025
Last ModifiedMarch 26, 2025
SharedMarch 25, 2025
Visibilityvisible
CommentsAllowed