Locked Room Glitch Explanation
5 years ago
New Jersey, USA

(Very long post incoming. tl;dr will be at the end.)

This is in response to the guide by @Wolfii that attempts to explain this glitch. His guide can be found here: https://www.speedrun.com/sjsm/guide/n955g

If you don't know what this glitch is, you can watch my video on it below.

As of September 9, 2018, his explanation is only partially correct. The glitch can be triggered by interacting with a locked door then obtaining the key for said locked door. What causes it, however, is rather complex, but I think I found the reason. It's not what Wolfii describes in his guide.

Let's start with the objects that spawn when the gel room loads for the first time. The two main objects responsible are the locked door trigger (door1_wait_trig) and the note about Specimen 1 (note_sp1_obj).

The door1_wait_trig object has two events (Game Maker's version of functions); an Alarm (an event that can only be activated after a specified amount of frames) with an index of 0 (will be referred to as "Alarm 0" from here on), and a collision event for when the player touches the trigger. Alarm 0 returns door1_wait_trig to it's spawn point. The collision event goes like this: -If the player pressed "E"

Show the text that tells the player to look around the room Move door1_wait_trig to (0, 0) (basically far outside of the room to not retrigger the text) In 120 frames (~2 seconds), execute Alarm 0

The note_sp1_obj object has three events, but only two are necessary for this explanation. It uses a create event and a collision event for the player. The create event scales the note object by 1.5 and sets the variable "do_var" to 0. The collision event is similar to the fake door, but it's a little different. -If the player pressed "E", and do_var is 0

Move note_sp1_obj to (0, 0) Create the paper that the player sees on the screen Create the object sp1_text (the words on the paper) Set do_var to 1 (this is done to prevent the player from re-picking up the note

The glitch now begins with the sp1_text object. There are only two events in sp1_text; destroy, and draw. Destroy does the following:

Create gel_obj (Specimen 1) Change door1_wait_trig into door1_trig (the real door trigger) Draw just displays the text for Specimen 1.

This is only a theory, but I think the glitch is caused when door1_wait_trig gets changed into door1_trig. The door1_trig object also has an Alarm 0 event. This event is the one that sends the player to the next room. Basically, reading the note within 2 seconds of interacting with the fake door causes the real door to mistakenly execute its Alarm 0 once the 2 seconds are up.

If I find anything new, I will update this post at a later point.

tl;dr The locked door has a function with the same name as a function of the real door and it gets executed after picking up the note, all within 2 seconds.

EDIT: The version of this glitch in the looping room is actually not a glitch but an oversight by the developers. As my second post says, the door in this room doesn't check the notes you pick up, but rather checks how many times you examined the door. If you examine the door 4 times, it will always open (when I tested it, at least).

Edited by the author 5 years ago
Texas, USA

what about the looping room? I'm able to do that room far more consistently and if you spam the 'E' key it gives you the message for each time you press it.

New Jersey, USA

Okay, so I've looked at the code for the door in the looping room and basically found this. The notes in the looping room are unnecessary, it only checks if you examined the door 3 times. The door's code works like this: -If the player presses "E"

Show the "locked" text Move door1_wait_trig to (0, 0) (this object is actually not present in this room, this may be a copy/paste mistake) Add 1 to the door's state variable (how many times you examined the door) If the state is 3, move the door trigger to its initial position (unneeded due to the copy/paste error) and change to a real door in 2 seconds Else, move the door trigger to its initial position (also unneeded) in 2 seconds

In a nutshell, the looping room does not have a glitch but an oversight from the developers.